HBase node management

In this section, we will discuss adding (commissioning) and removing (decommissioning) nodes from an HBase cluster.

Commissioning

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

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:

  1. Stop/disable the load balancer using the following command:
    hbase>balance_switch false
    
  2. Stop RegionServer on the node, which must be decommissioned as follows:
    hbase> hbase-daemon.sh stop regionserver
    
  3. When RegionServer is stopped, it will close all the regions and shut down.
  4. The ephemeral node of RegionServer will expire in ZooKeeper.
  5. The master will notice that RegionServer is down and treat it as crashed.
  6. Reassignment of regions served by RegionServer will be done.

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:

  1. Issue the following command:
    bin/graceful_stop.sh <RegionServer_Hostname>
    
  2. Always enable the balancer switch in the case of a graceful stop.
  3. For the remaining steps, refer to the steps 2 to 6 in the preceding set of instructions.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.229.44