运行hbase shell时报错:

hbase(main):001:0> list

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


解决方法:

(1)原因:运行hbase(zookeeper)的用户无法写入zookeeper文件,导致znode data为空。

解决:在hbase-site.xml指定一个运行hbase的用户有写入文件权限的目录作为zookeeper数据目录,如
  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/user88/zk_data</value>
  </property>

(2)hbase-site.xml文件中的

<property>  
<name>hbase.rootdir</name>   
<value>hdfs://hadoop1:49002/hbase</value>  
</property>

core-site.xml中fs.defaultFS中的路径不相同

<property>
      <name>fs.defaultFS</name>
      <value>hdfs://hadoop1:9000</value>
  </property>


Logo

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

更多推荐