Hi there!
Fault locating
Stop the HBase service, delete all data under the corresponding /hbase znode in ZooKeeper and delete all system table data under /hbase/data/hbase in HDFS.
Then, start HBase to rebuild the data and run the hbase hbck -repair command to rectify the fault.
Procedure
1. Disable the HBase service.
http://10.88.69.41:7088/idp-edit-service/editor/image/11108756775/A-1_1_en-us_image_0147205349.png
2. Go to the client installation path and run the source bigdata_env command to configure the environment variables.
3. Perform the security authentication if the cluster uses a secure version. Obtain the hbase.keytab file from the cluster and save it to the client installation directory.
kinit -kt hbase.keytab hbase/zkclient.hadoop.com
4. Enter the correct password as prompted.
[root@10-10-10-11 client]# source bigdata_env# configure environment variables [root@10-10-10-11 client]# kinit -kt hbase.keytab hbase/zkclient.hadoop.com
5. Log in to the ZooKeeper client and run hbase zkcli or zkCli.sh -server zkip:24002.
6. Connect to the ZooKeeper and run the hbase zkcli kinit -kt hbase.keytab hbase/zkclient.hadoop.com command.
[root@10-10-10-11 client]# hbase zkcli[zk: hadoop01:24002,hadoop02:24002,hadoop03:24002(CONNECTED) 1]
7. Run the deleteall /hbase command to delete the /hbase znode directory from ZooKeeper. For example:
[zk: hadoop01:24002,hadoop02:24002,hadoop03:24002(CONNECTED) 1] deleteall /hbase
8. Run the following command to remove the HBase system table data from HDFS:
hdfs dfs -mv /hbase/data/hbase/ /tmp/
For example:
hdfs dfs -mv /hbase/data/hbase/ /tmp/
9. Enable the HBase service.
http://10.88.194.32:7088/idp-edit-service/editor/image/11108756775/A-1_1_en-us_image_0147205351.png
10. Run the hbase hbck -repair command to restore user tables.
For example:
[root@10-10-10-11 client] # hbase hbck -repair
Result verification
1. Run the hbase shell command to log in to the HBase client and run the list command and check whether the created user tables are displayed.
For example:
hbase(main):003:0> list
TABLE
2018-05-21 07:16,649 INFO [main] ipc.AbstractRpcClient: RPC Server Kerberos principal name for service=MasterService is hbase/hadoop.hadoop.com@HADOOP.COM
JH_TAB
_ctmeta_
big_region_tab
big_region_tab_2
big_region_tab_3
big_region_tab_4
filter_test
hbase_sample_table
hive_hbase_student_3
stu_ctbase_table
test_tab
test_tab_idx
16 row(s) in 0.0480 seconds
=> ["JH_TAB", "_ctmeta_", "big_region_tab", "big_region_tab_2", "big_region_tab_3", "big_region_tab_4", "filter_test", "hbase_sample_table", "hive_hbase_student_3", "lgp2:t1", "lgp2:t2", "lgp:t1", "lgp:t2", "stu_ctbase_table", "test_tab", "test_tab_idx"]
2. Run the hbase hbck command on the client and check whether the status of all tables is OK.