HBase错误:zookeeper.znode.parent不匹配

时间:2014-06-03 06:09:12

标签: hadoop hbase

我正在尝试学习Hadoop,并且我已经在Hadoop权威指南中找到了HBase部分。 我试图启动HBase并得到错误。有人可以给我一步一步的指导吗?

opel@ubuntu:~$ zkServer.sh start
JMX enabled by default
Using config: /home/opel/zookeeper-3.4.6/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
opel@ubuntu:~$ start-hbase.sh 
starting master, logging to /home/opel/hbase-0.94.20/logs/hbase-opel-master-ubuntu.out
opel@ubuntu:~$ hbase shell
HBase Shell; enter 'help<RETURN>' for list of supported commands.
Type "exit<RETURN>" to leave the HBase Shell
Version 0.94.20, r09c60d770f2869ca315910ba0f9a5ee9797b1edc, Fri May 23 22:00:41 PDT 2014

hbase(main):001:0> status
14/06/02 22:40:44 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:45 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:47 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:49 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:51 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:55 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.
14/06/02 22:40:59 ERROR client.HConnectionManager$HConnectionImplementation: Check the value configured in 'zookeeper.znode.parent'. There could be a mismatch with the one configured in the master.

ERROR: org.apache.hadoop.hbase.MasterNotRunningException: Retried 7 times

Here is some help for this command:
Show cluster status. Can be 'summary', 'simple', or 'detailed'. The
default is 'summary'. Examples:

  hbase> status
  hbase> status 'simple'
  hbase> status 'summary'
  hbase> status 'detailed'

有什么不对吗?

6 个答案:

答案 0 :(得分:4)

我遇到了同样的问题。对我来说,解决方案是将以下属性添加到hbase-site.xml(对我来说,它可以在/usr/lib/hbase/conf目录下找到):

<configuration>
        <property>
                <name>zookeeper.znode.parent</name>
                <value>/hbase-unsecure</value>
        </property>
</configuration>

但这仅适用于独立模式。在使用外部ZooKeeper时,我仍然不知道如何解决这个问题。

答案 1 :(得分:2)

如果您使用Cloudera Manager VM,配置不会有任何问题。

问题是HMaster没有启动。要解决此问题,请转至Cloudera Manager并重新启动HBase服务。它将解决问题。

答案 2 :(得分:1)

当我遇到这个问题时,我可以通过不使用zookeeper来解决这个问题。 如果您在独立模式下运行HBase,那么您就不需要zookeeper。我能够跳过动物园管理员部分,我将 hbase.cluster.distributed 属性 false

<property>     <name>hbase.cluster.distributed</name>     <value>false</value>   </property>

现在,我可以在没有zookeeper的情况下使用hbase。

答案 3 :(得分:0)

这个问题花了我一个晚上,这就是我解决的方法: 启动hadoop之后,请转到:http://localhost:50070/dfshealth.html#tab-datanode

您将在表中看到可用datanode的列表,只需将其添加到hbase-site.xml中,如下所示:

<configuration>
        <property>
                <name>zookeeper.znode.parent</name>
                <value>127.0.0.1:50010</value>
        </property>
</configuration>

答案 4 :(得分:0)

最好的方法是检查您的HBase日志。它将为您提供有关错误的清晰思路。就我而言,我在同一台服务器上运行Kafka + zookeeper和HBase。因此,每当我尝试运行hbase shell时,我都会在控制台上遇到相同的错误。当我检查日志并找到

  

端口已在使用中

所以我刚刚更改了

的值
  

hbase.zookeeper.property.clientPort

在hbase-site.xml文件中,一切开始运行。

答案 5 :(得分:0)

打开zookeeper / bin并运行命令- ./ zkServer.sh start

成功执行后,执行命令- /zkCli.sh

然后执行命令获取/ hbase-unsecure

如果返回为null,则创建-s / testmaster“ 127.0.0.1:2222”

此外,通过添加

来编辑hbase-site.xml
   <property>
            <name>zookeeper.znode.parent</name>
            <value>/testmaster</value>
    </property>

PS-保持hbase.cluster.distributed属性的值为false。

希望这可以解决您的错误。