在 HBase Shell 交互模式下,使用 list
查看表时发生错误如下:
解决方法:
# 1. HMaster 节点 停止 HBASE服务
~ $HBASE_HOME/bin/stop-hbase.sh
# 2. 删除HDFS根目录下 /hbase 文件,如有需要可自己备份
~ hdfs dfs -rmr /hbase
# 3. 删除zk上hbase的数据
~ sh zkCli.sh
...
[zk: localhost:2181(CONNECTED) 0] rmr /hbase
# 4. 启动hbase
~ $HBASE_HOME/bin/start-hbase.sh
# 5. 查看hbase服务
~ jps
52865 Jps
96661 NameNode
52264 HMaster # 已启动,还可查看HRegionServer查看是否正常
88072 QuorumPeerMain
96954 ResourceManager
52540 Main
# 6. 再次进入hbase shell执行即可正常了
[root@hadoop0 hive]# hbase shell
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/software/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/software/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<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 1.3.1, r930b9a55528fe45d8edce7af42fef2d35e77677a, Thu Apr 6 19:36:54 PDT 2017
hbase(main):001:0> list
TABLE
0 row(s) in 0.2070 seconds
=> []
hbase(main):002:0>