1. 程式人生 > >解決ERROR: Can't get master address from ZooKeeper; znode data == null

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

問題描述

執行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>