Manually sets the state of a specific region in hbase:meta.
This command is high risk and should be used only as a last resort in extreme situations.
Command Syntax
hbase hbck -j <path-to-hbck2-jar> setRegionState [<ENCODED_REGIONNAME> <STATE> | -i <INPUT_FILE>...]Options
-i, --inputFiles <file1> [<file2>...]
Specifies one or more files containing encoded region names and region states, one pair per line.
Possible Region States
OFFLINE, OPENING, OPEN, CLOSING, CLOSEDSPLITTING, SPLIT, FAILED_OPEN, FAILED_CLOSEMERGING, MERGED, SPLITTING_NEW, MERGING_NEWABNORMALLY_CLOSEDDescription
Use this command when a region’s state in hbase:meta is incorrect and is blocking an operation such as assign or unassign. For example, an unassign operation may only proceed if the region is in one of the following states:
SPLITTING | SPLIT | MERGING | OPEN | CLOSINGBefore running this command, you must ensure that no active procedure—such as assign, split, or merge—is currently handling the region. To verify this, use the list_procedures command in the HBase shell.
For tables with region replicas, the region identifier must include both:
- The primary region’s encoded region name
- The replica ID
Use the format:
<PRIMARY_ENCODED_REGIONNAME>,<REPLICA_ID> <STATE>Return Values
"0"— The region state was successfully changed"1"— The region state could not be changed
Examples
- Set a region to the
CLOSINGstate:
hbase hbck -j <path-to-hbck2-jar> setRegionState de00010733901a05f5a2a3a382e27dd4 CLOSING- Set region states from a file (
fileName1):
Example contents of fileName1:
de00010733901a05f5a2a3a382e27dd4 OPENanotherencodedregionname CLOSEDRun the command:
hbase hbck -j <path-to-hbck2-jar> setRegionState -i fileName1