HBase Shell数据库表创建出现ERROR: org.apache.hadoop.hbase.PleaseHoldException: Master is initializing(终于解决)

本文记录了在HBase中创建表时遇到“Masterisinitializing”错误的详细过程及解决办法,包括时间同步、HBase重启步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我执行“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:.*’

解决办法

  1. 把时间同步,执行如下命令
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命令没有原来的错误了,已经成功解决了,加油!

评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值