HBase Master is initializing问题

阿里云ECS异常重启后(因为受到攻击),Hbase出现Master is initializing问题:

root@iZ2ze77za5f39z5j0xexocZ:~# hbase shell
2023-03-22 10:01:04,349 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.4.16, rd1714710877653691e2125bd94b68a5b484a3a06, Wed Feb  1 09:46:35 UTC 2023
Took 0.0032 seconds                                                                                                                                                                                         
hbase:001:0> list_namespace
list_namespace          list_namespace_tables   
hbase:001:0> list_namespace
NAMESPACE                                                                                                                                                                                                   

ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
        at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2823)
        at org.apache.hadoop.hbase.master.HMaster.listNamespaces(HMaster.java:3125)
        at org.apache.hadoop.hbase.master.MasterRpcServices.listNamespaces(MasterRpcServices.java:1017)
        at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
        at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:387)
        at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:132)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:369)
        at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:349)

For usage try 'help "list_namespace"'

Took 10.7576 seconds                                                                                                                                                                                        
hbase:002:0> quit
root@iZ2ze77za5f39z5j0xexocZ:~# stop-hbase.sh 

解决步骤:

  1. 关闭hbase,如果关闭失败,手动关闭hbase相关进程。

root@iZ2ze77za5f39z5j0xexocZ:~# stop-hbase.sh 
no hbase master found
  1. 用zookeeper命令行客户端删除/hbase,根据zookeeper版本不同,选择使用rmr或者deleteall

root@iZ2ze77za5f39z5j0xexocZ:~/test# zkCli.sh 
ls /
[zookeeper, hbase]
rmr /hbase
ls /
[zookeeper]
quit

  1. hdfs 删除hbase节点,如果有重要数据需要提前备份

 hdfs dfs  -rm -r /hbase
  1. 重新启动hbase

start-hbase.sh
  1. 用hbase shell查看namespace,正常

root@iZ2ze77za5f39z5j0xexocZ:~# hbase shell
HBase Shell
Use "help" to get list of supported commands.
Use "exit" to quit this interactive shell.
For Reference, please visit: http://hbase.apache.org/2.0/book.html#shell
Version 2.4.16, rd1714710877653691e2125bd94b68a5b484a3a06, Wed Feb  1 09:46:35 UTC 2023
Took 0.0057 seconds                                                                                                                                                                                         
hbase:001:0> list_namespace
NAMESPACE                                                                                                                                                                                                   
default                                                                                                                                                                                                     
hbase                                                                                                                                                                                                       
2 row(s)
Took 1.1131 seconds                                                                                                                                                                                         
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值