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理科成功!!!!

发布了669 篇原创文章 · 获赞 631 · 访问量 125万+
展开阅读全文

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

03-08

hadoop + zookeeper +hbase 环境 hadoop 和 zookeeper 集群环境都ok,hbase启动之后,查看hbase状态报错 ![图片说明](https://img-ask.csdn.net/upload/201903/07/1551957383_266120.jpg) 网上的各种重启hbase 重启服务 修改配置文件都试过了,解决不了,跪求会的大神指导一下。 /etc/profile配置 ``` export JAVA_HOME=/opt/java/jdk1.8.0_201 export HADOOP_HOME=/opt/hadoop/hadoop-2.8.0 export HADOOP_CONF_DIR=${HADOOP_HOME}/etc/hadoop export HADOOP_COMMON_LIB_NATIVE_DIR=${HADOOP_HOME}/lib/native export HADOOP_OPTS="-Djava.library.path=${HADOOP_HOME}/lib" #export HIVE_HOME=/opt/hive/apache-hive-2.1.1-bin #export HIVE_CONF_DIR=${HIVE_HOME}/conf #export SQOOP_HOME=/opt/sqoop/sqoop-1.4.6.bin__hadoop-2.0.4-alpha export HBASE_HOME=/opt/hbase/hbase-1.4.9 export ZK_HOME=/opt/zookeeper/zookeeper-3.4.13 export CLASS_PATH=.:${JAVA_HOME}/lib:${HIVE_HOME}/lib:$CLASS_PATH export PATH=.:${JAVA_HOME}/bin:${HADOOP_HOME}/bin:${HADOOP_HOME}/sbin:${SPARK_HOME}/bin:${ZOOKEEPER_HOME}/bin:${HIVE_HOME}/bin:${SQOOP_HOME}/bin:${HBASE_HOME}:${ZK_HOME}/bin:$PATH ``` hbase/conf/hbase.xml 配置 ``` <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://hadoop1:9000/hbase</value> <description>The directory shared byregion servers.</description> </property> <property> <name>hbase.zookeeper.property.dataDir</name> <value>/opt/hbase/zk_data</value> </property> <property> <name>hbase.zookeeper.property.clientPort</name> <value>2181</value> <description>Property from ZooKeeper'sconfig zoo.cfg. The port at which the clients will connect. </description> </property> <property> <name>zookeeper.session.timeout</name> <value>120000</value> </property> <property> <name>hbase.zookeeper.property.tickTime</name> <value>6000</value> </property> <property> <name>hbase.zookeeper.quorum</name> <value>hadoop1,hadoop2,hadoop3</value> </property> <property> <name>hbase.tmp.dir</name> <value>/root/hbase/tmp</value> </property> <property> <name>hbase.cluster.distributed</name> <value>true</value> </property> </configuration> ``` hbase/conf/conf/hbase-env.sh文件 ``` export HBASE_OPTS="-XX:+UseConcMarkSweepGC" # Configure PermSize. Only needed in JDK7. You can safely remove it for JDK8+ #export HBASE_MASTER_OPTS="$HBASE_MASTER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m" #export HBASE_REGIONSERVER_OPTS="$HBASE_REGIONSERVER_OPTS -XX:PermSize=128m -XX:MaxPermSize=128m -XX:ReservedCodeCacheSize=256m" export JAVA_HOME=/opt/java/jdk1.8.0_201 export HADOOP_HOME=/opt/hadoop/hadoop-2.8.0 export HBASE_HOME=/opt/hbase/hbase-1.4.9 export HBASE_CLASSPATH=/opt/hadoop/hadoop-2.8.0/etc/hadoop export HBASE_PID_DIR=/root/hbase/pids export HBASE_MANAGES_ZK=false ``` zookeeper/zoo.cfg 配置文件 ``` tickTime=2000 initLimit=10 syncLimit=5 clientPort=2181 dataDir=/opt/zookeeper/data dataLogDir=/opt/zookeeper/dataLog server.1=hadoop1:2886:3881 server.2=hadoop2:2887:3882 server.3=hadoop3:2888:3883 quorumListenOnAllIPs=true ``` /opt/hadoop/hadoop-2.8.0/etc/hadoop/core-site.xml 文件 ``` <configuration> <property>         <name>hadoop.tmp.dir</name>         <value>/root/hadoop/tmp</value>         <description>Abase for other temporary directories.</description>    </property>    <property>         <name>fs.default.name</name>         <value>hdfs://hadoop1:9000</value>    </property> </configuration> ``` 问答

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 创作都市 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览