打赏

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.解决方法2:格式化namenode
  这里,不多赘述。但是一般没到没办法情况下,不要去格式化。

  至于,为什么,请见

Hadoop的多节点集群启动,唯独没有namenode进程?(血淋淋教训,一定拍快照)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

欢迎大家,加入我的微信公众号:大数据躺过的坑        人工智能躺过的坑
 
 
 

同时,大家可以关注我的个人博客

   http://www.cnblogs.com/zlslch/   和     http://www.cnblogs.com/lchzls/      http://www.cnblogs.com/sunnyDream/   

   详情请见:http://www.cnblogs.com/zlslch/p/7473861.html

 

  人生苦短,我愿分享。本公众号将秉持活到老学到老学习无休止的交流分享开源精神,汇聚于互联网和个人学习工作的精华干货知识,一切来于互联网,反馈回互联网。
  目前研究领域:大数据、机器学习、深度学习、人工智能、数据挖掘、数据分析。 语言涉及:Java、Scala、Python、Shell、Linux等 。同时还涉及平常所使用的手机、电脑和互联网上的使用技巧、问题和实用软件。 只要你一直关注和呆在群里,每天必须有收获

 

      对应本平台的讨论和答疑QQ群:大数据和人工智能躺过的坑(总群)(161156071) 

 

 

 

 

 

 

 

 

 

 

 

 


posted @ 2017-03-15 21:49  大数据和AI躺过的坑  阅读(67603)  评论(2编辑  收藏  举报