In this section, we will discuss adding (commissioning) and removing (decommissioning) nodes from an HBase cluster.
Let's discuss the commissioning of nodes in an HBase cluster.
Prepare the machine, check the permissions twice, and check the connectivity, host entry, and host resolution. Once done and twice checked, copy the configuration file following the same path structure at the new machine, and start RegionServer using the following command:
hbase-daemon.sh start regionserver
Once this command is executed, RegionServer will automatically register with HMaster and start receiving local data. At the beginning, the newly added node will not have any data, and if balancer is not disabled, it will start moving new regions to the new RegionServer.
If the start and stop process is done using ssh and HBase script, add the newly added node host name to the conf/regionservers
file.
So, commissioning is just like checking the new machine, copying the configuration files, and starting the process if we want to say it in one line.
Decommissioning means removing a node (RegionServer) from the cluster. This process is not easy as commissioning a node. However, here we need to take care of things before removing the node from the cluster. Let's discuss this here.
First, disable the load balancer, because if it is running, it might create some inconsistencies due to the ongoing data transfer process. So, let's list the decommissioning process in steps:
hbase>balance_switch false
hbase> hbase-daemon.sh stop regionserver
Since this stopping method might take time, we can use the graceful shutdown. It unloads regions from RegionServer, allowing the node to be terminated without impacting data availability. It is in contrast to the first option that results in a short window of data unavailability, which HBase takes to recognize the failure and does the recovery. The script that is used for this is available in the bin
directory of HBase and named graceful_stop.sh
.
So, let's have a look at the steps:
bin/graceful_stop.sh <RegionServer_Hostname>
18.226.187.233