Hbase出现ERROR: Can't get master address from ZooKeeper; znode data == null解决办法

问题描述如下:

复制代码

hbase(main):001: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(main):002: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(main):003:0> 

复制代码

 出现此问题可能是zookeeper不稳定造成的,采用的是虚拟机,经常挂起的状态,使用hbase的list命令出现下面错误,这个可能是hbase的稳定性造成的,解决办法有两种。这里使用第一种办法就解决了。

解决方法:

1.重启hbase

  1. stop-hbase.sh

然后

  2.start-hbase.sh

  或者,要么实在不行,就关掉所有集群。再重新开启吧!

2.解决方法2:

(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>

rootdir中的IP设定很重要,需要设定对应的IP

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

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

3.弱智原因,弄了半天一直在datanode上启动操作,没有在namenode上操作HBase,回到master理科成功!!!!

发布了670 篇原创文章 · 获赞 631 · 访问量 126万+

猜你喜欢

转载自blog.csdn.net/zhangchen124/article/details/92801139
今日推荐