5. Decommission HBase RegionServers

Use the following instructions to decommission HBase RegionServers in your cluster:

  1. Decommission RegionServers. The preferred method of decommissioning RegionServers is to use the graceful_stop.sh script (Option I). This option gradually unloads Regions from the RegionServer, allowing the node to be terminated without impacting data availability. You can also terminate the RegionServer without first unloading its Regions (Option II). This will result in a short window of data unavailability as HBase's natural data recovery operations execute.

    • Option I: Perform a Graceful Stop

      You can use the following command to gracefully decommission a loaded RegionServer. Execute this command from any host machine with HBase configuration installed.

      su <HBASE_USER>/usr/hdp/current/hbase-client/bin/graceful_stop.sh <RegionServer.Hostname>

      where <HBASE_USER> is the user who owns the HBase Services. For example, hbase.

      [Note]Note

      The value of <RegionServer.Hostname> must match the host name that HBase uses to identify RegionServers.

      To find the host name for a particular RegionServer, use the HBase web UI to check the list of RegionServers in the HBase Master UI. Typically, HBase Master uses host names but occassionally it can be the FQDN of a RegionServer.

    • Option II: Use hbase-daemon.sh

      At the RegionServer that you want to decommission, execute:

      su <HBASE_USER>
      /usr/hdp/current/hbase-client/bin/graceful_stop.sh <RegionServer.Hostname>

      where <HBASE_USER> is the user who owns the HBase Services. For example, hbase.

      RegionServer closes all the regions, then shuts down.

  2. Enable the load balancer. If you used the graceful_stop.sh script, you may need to re-enable the Region Balancer using the balance_switch shell command from. Use the true option to enable the balancer, and false to disable it. The command returns the value of the state of the balancer that existed before running the command.

    If graceful_stop.sh disabled the balancer, you can enable it again using the following series of commands:

    su <HBASE_USER>
    hbase shell
    hbase(main):001:0> balance_switch true
    false
    0 row(s) in 0.3590 seconds