背景
CDH集群切换数据盘,导致服务无法启动,卸载重装了 hbase、hdfs、yarn、oozie、spark等服务,未卸载重装的zookeeper、kafka。
重装hbase后无法创建表。
报错
hbase(main):001:0> create 'test','cf1'
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2976)
at org.apache.hadoop.hbase.master.HMaster.createTable(HMaster.java:1972)
at org.apache.hadoop.hbase.master.MasterRpcServices.createTable(MasterRpcServices.java:630)
at org.apache.hadoop.hbase.shaded.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:413)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:324)
at org.apache.hadoop.hbase.ipc.RpcExecutor$Handler.run(RpcExecutor.java:304)
For usage try 'help "create"'
Took 9.3743 seconds
问题排查与解决方案
排查:新装hbase HMaster / RS与原始卸载的HBase不在之前对应的节点上,zookeeper中信息未更新。
解决:进入zk客户端,删除/hbase ,并重启 hbase 服务
bash
# apache zookeeper访问路径: $ZOOKEEPER_HOME/bin/zkCli.sh
# CDH集群 zookeeper访问路径
sh /opt/cloudera/parcels/CDH/bin/zookeeper-client
# zk客户端下输入 ls /
[zk: localhost:2181(CONNECTED) 0] ls /
# 显示结果 [cluster, controller, brokers, zookeeper, yarn-leader-election, hadoop-ha, admin, isr_change_notification, log_dir_event_notification, controller_epoch, rmstore, consumers, hive_zookeeper_namespace_hive, latest_producer_id_block, config, hbase]
# zk 客户端下继续输入 rmr /hbase
[zk: localhost:2181(CONNECTED) 0] rmr /hbase
重点:一定要重启,不重启建表报错展示:
完成上述步骤,展示: