问题:
在hbase shell中执行语句报如下异常:
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2379)
at org.apache.hadoop.hbase.master.MasterRpcServices.getTableNames(MasterRpcServices.java:900)
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:55650)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2196)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:112)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:133)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:108)
at java.lang.Thread.run(Thread.java:748)
然后查看HRegionServer是否正常启动,发现slave1,slave2没有启动。去其中一个slave的hbase日志查看是否有异常提示,比如目录 hbase-1.2.6/logs/hbase-xxx-regionserver-slave1.log,日志中出现如下提示
org.apache.hadoop.hbase.ClockOutOfSyncException:
Server slave1,16020,1539533067108 has been rejected; Reported time is too far out of sync with master. Time difference of 34509042ms > max allowed of 30000ms
原因:
date命令查看了master和slave的时间,master与slave间的时间不一致,相差太大。
解决办法:
修改slave的时间,让其与master保持一致。因此hbase运行异常了,我们首先去查看HMaster和HRegionServer是否正常启动,然后查看hbase日志根据日志中的异常提示找到解决办法。