我执行“bin/hbase shell”命令本来成功进入了shell界面的,但是利用shell命令操作在HBase中创建表时,出现了如下的错误
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2177)
at org.apache.hadoop.hbase.master.MasterRpcServices.getTableDescriptors(MasterRpcServices.java:822)
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:48468)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2114)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:748)
Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:
hbase> list
hbase> list 'abc.*'
hbase> list 'ns:abc.*'
hbase> list 'ns:.*'
我之前做利用Shell命令在HBase中创建表执行相关命令都没有出现这个问题,可是过了好久,老师在实验课上抽查同学学习情况时被抽中,演示给老师看的时候突然出现了这个错误(猝不及防,就是很巧也好尴尬,但也发现了问题吧,哈哈),当时由于时间有限,没有解决,课后我在网上找了好多解决办法都没有解决,很幸运最后很简单就解决了… |
具体执行情况如下:
hadoop@mango-virtual-machine:/usr/local/hbase$ bin/hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
HBase Shell; enter ‘help’ for list of supported commands.
Type “exit” to leave the HBase Shell
Version 1.1.2, rcc2b70cf03e3378800661ec5cab11eb43fafe0fc, Wed Aug 26 20:11:27 PDT 2015
hbase(main):001:0> list
TABLE
ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing
at org.apache.hadoop.hbase.master.HMaster.checkInitialized(HMaster.java:2177)
at org.apache.hadoop.hbase.master.MasterRpcServices.getTableDescriptors(MasterRpcServices.java:822)
at org.apache.hadoop.hbase.protobuf.generated.MasterProtos$MasterService$2.callBlockingMethod(MasterProtos.java:48468)
at org.apache.hadoop.hbase.ipc.RpcServer.call(RpcServer.java:2114)
at org.apache.hadoop.hbase.ipc.CallRunner.run(CallRunner.java:101)
at org.apache.hadoop.hbase.ipc.RpcExecutor.consumerLoop(RpcExecutor.java:130)
at org.apache.hadoop.hbase.ipc.RpcExecutor$1.run(RpcExecutor.java:107)
at java.lang.Thread.run(Thread.java:748)
Here is some help for this command:
List all tables in hbase. Optional regular expression parameter could
be used to filter the output. Examples:
hbase> list
hbase> list ‘abc.’
hbase> list 'ns:abc.’
hbase> list ‘ns:.*’
解决办法
- 把时间同步,执行如下命令
ntpdate 1.cn.pool.ntp.org
2.先停止HBase运行,再启动HBase运行,命令如下
cd /usr/local/hbase
bin/stop-hbase.sh
bin/start-hbase.sh
(我在重启过程中遇到很多“regionserver running as process 1*****. Stop it first.”这样的问题,网上说直接kill,再重启还是会有很多这样的问题,这时我就直接执行“bin/stop-hbase.sh”命令停止HBase运行再重启“bin/start-hbase.sh”就解决了!)
3.进入shell界面,执行“list”查表命令看是否成功
bin/hbase shell
list
从上图可以发现,我执行list命令没有原来的错误了,已经成功解决了,加油!