Got it

Ultimate Solution for Rectifying HBase Faults

Created: Jul 25, 2019 06:43:15Latest reply: Jul 25, 2019 06:44:49 429 2 0 0 1
  Rewarded HiCoins: 0 (problem resolved)

Ultimate Solution for Rectifying HBase Faults:

Symptom

The HBase status is abnormal, which may be caused by abnormal HBase data stored in ZooKeeper, abnormal table data in the HDFS system, or abnormal user table data. The fault cannot be rectified.

This section describes how to completely rectify the HBase fault.

Featured Answers
tanglei
Created Jul 25, 2019 06:44:49

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.
View more
  • x
  • convention:

All Answers
Thanks.
View more
  • x
  • convention:

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.
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register
Comment

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.