@MrNicen
This is a very common problem where the table gets stuck in a DISABLING state.
First, please try these series of diagnostic and repair steps:
First, verify the current state: Spoiler (Highlight to read) echo "scan 'hbase:meta'" | hbase shell
echo "scan 'hbase:meta'" | hbase shell
Try to force the table state change using HBCK2: If that doesn't work, try cleaning the znode: Spoiler (Highlight to read) # Connect to ZooKeeper ./zkCli.sh -server localhost:2181 # Check the table znode ls /hbase/table/< table_name> # Delete the table znode if present rmr /hbase/table/<table_name>
# Connect to ZooKeeper ./zkCli.sh -server localhost:2181 # Check the table znode ls /hbase/table/<table_name># Delete the table znode if present rmr /hbase/table/<table_name>
If the issue persists, try manually updating the meta table: Spoiler (Highlight to read) hbase shell # Disable table disable '<table_name>' # Wait a few seconds, then enable enable '<table_name>' # If that fails, try force disable disable_all '<table_name>'
hbase shell # Disable table disable '<table_name>' # Wait a few seconds, then enable enable '<table_name>' # If that fails, try force disable disable_all '<table_name>'
If still stuck, try these repair commands: Spoiler (Highlight to read) # Clear the META table state echo "put 'hbase:meta', '<table_name>', 'table:state', ' \x08 \x00 '" | hbase shell # Recreate the regions hbase hbck -j ./hbase-hbck2-2.0.2.jar assigns < table_name>
# Clear the META table state echo "put 'hbase:meta', '<table_name>', 'table:state', '\x08\x00'" | hbase shell # Recreate the regions hbase hbck -j ./hbase-hbck2-2.0.2.jar assigns <table_name>
As a last resort, try a full cleanup: Spoiler (Highlight to read) # Stop HBase ./bin/stop-hbase.sh # Clear ZooKeeper data ./zkCli.sh -server localhost:2181 rmr /hbase # Remove the META directory rm -rf /hbase/data/hbase/meta # Start HBase ./bin/start-hbase.sh # Recreate the table structure hbase shell create '<table_name>' , { NAME = > 'cf' } # Adjust column families as needed
# Stop HBase ./bin/stop-hbase.sh # Clear ZooKeeper data ./zkCli.sh -server localhost:2181 rmr /hbase # Remove the META directory rm -rf /hbase/data/hbase/meta # Start HBase ./bin/start-hbase.sh # Recreate the table structure hbase shell create '<table_name>', {NAME => 'cf'} # Adjust column families as needed
If none of these steps work, we can try a more aggressive approach:
Back up your data: Spoiler (Highlight to read) hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot < snapshot_name> -copy-to hdfs://backup-cluster/hbase
hbase org.apache.hadoop.hbase.snapshot.ExportSnapshot -snapshot <snapshot_name> -copy-to hdfs://backup-cluster/hbase
Try a clean META rebuild:
Spoiler (Highlight to read) # Stop HBase ./bin/stop-hbase.sh # Clear META rm -rf /hbase/data/default/hbase/meta # Start HBase in repair mode env HBASE_OPTS = "-XX:+UseParNewGC -XX:+UseConcMarkSweepGC" ./bin/hbase org.apache.hadoop.hbase.util.hbck.OfflineMetaRepair # Start HBase normally ./bin/start-hbase.sh
# Stop HBase ./bin/stop-hbase.sh # Clear META rm -rf /hbase/data/default/hbase/meta # Start HBase in repair mode env HBASE_OPTS="-XX:+UseParNewGC -XX:+UseConcMarkSweepGC" ./bin/hbase org.apache.hadoop.hbase.util.hbck.OfflineMetaRepair # Start HBase normally ./bin/start-hbase.sh
Additional troubleshooting tips:
Check HBase logs for specific errors: Spoiler (Highlight to read) tail -f /var/log/hbase/hbase-master.log
tail -f /var/log/hbase/hbase-master.log
Verify cluster health:
Monitor region transitions: Spoiler (Highlight to read) echo "scan 'hbase:meta', {COLUMNS => 'info:regioninfo'}" | hbase shell
echo "scan 'hbase:meta', {COLUMNS => 'info:regioninfo'}" | hbase shell
If you encounter any specific errors during these steps, please share them and I can provide more targeted solutions.