问题描述

运行Hbase shell时报错:
hbase(main):006:0> list
TABLE                                                                                                                                                                   


ERROR: Can't get master address from ZooKeeper; znode data == null


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:.*'

解决方法

原因:运行hbase(zookeeper)的用户无法写入zookeeper文件,导致znode data为空
解决如下:
格式化hdfs  进入Hadoop/bin 目录下 : ./hadoop namenode –format
启动 zookeeper
启动 hadoop 
启动 hbase 

进入hbase shell 成功,执行list如下:

hbase shell
2017-02-15 16:19:01,906 INFO  [main] Configuration.deprecation: hadoop.native.lib is deprecated. Instead, use io.native.lib.available
2017-02-15 16:19:58,786 WARN  [main] util.NativeCodeLoader: Unable to load native-hadoop library for your platform... using builtin-java classes where applicable
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/cdh5.9.1/hbase/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/hadoop/cdh5.9.1/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.5.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.2.0-cdh5.9.1, rUnknown, Wed Jan 11 13:57:35 PST 2017


hbase(main):001:0> list
TABLE                                                                                                                                                                   
0 row(s) in 13.4580 seconds


=> []
hbase(main):002:0> 

 
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐