【问题标题】:Stand alone HBase on local file system getting zookeeper error?本地文件系统上的独立 HBase 出现 Zookeeper 错误?
【发布时间】:2014-01-25 00:29:21
【问题描述】:

大家好,我正在尝试遵循 quick start of HBase 并在本地文件系统上启动 HBase(不使用 HDFS)但是当我使用 ./hbase shell 启动 shell 并键入“status”时,我得到 zookeeper 错误?!

hbase(main):001:0> status
14/01/07 12:44:48 ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists failed after 3 retries
14/01/07 12:44:48 WARN zookeeper.ZKUtil: hconnection Unable to set watcher on znode (/hbase/hbaseid)
org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode = ConnectionLoss for /hbase/hbaseid

//......... ect ..... 

这是我的配置文件(hbase-site.xml)

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
<!--
/**
 * Copyright 2010 The Apache Software Foundation
 *
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
-->
<configuration>


<property>
    <name>hbase.rootdir</name>
    <value>file:///home/adio/workspace/hadoop/hbase/directories/hbase</value>
  </property>

  <property>
    <name>hbase.zookeeper.property.dataDir</name>
    <value>/home/adio/workspace/hadoop/hbase/directories/zookeeper</value>
  </property>

<property>
      <name>hbase.zookeeper.quorum</name>
      <value>localhost</value>
      <description>Comma separated list of servers in the ZooKeeper Quorum.
      For example, "host1.mydomain.com,host2.mydomain.com,host3.mydomain.com".
      By default this is set to localhost for local and pseudo-distributed modes
      of operation. For a fully-distributed setup, this should be set to a full
      list of ZooKeeper quorum servers. If HBASE_MANAGES_ZK is set in hbase-env.sh
      this is the list of servers which we will start/stop ZooKeeper on.
      </description>
 </property>

<property>
      <name>hbase.zookeeper.property.clientPort</name>
      <value>2222</value>
      <description>Property from ZooKeeper's config zoo.cfg.
      The port at which the clients will connect.
      </description>
</property>



<property>
      <name>hbase.zookeeper.property.maxClientCnxns</name>
      <value>1000</value>
      <description>
      </description>
</property>
</configuration>

有什么建议吗?

【问题讨论】:

    标签: hadoop hbase apache-zookeeper


    【解决方案1】:

    您的 zookeeper 仲裁名称必须是您机器的主机名,并且还必须存在于 /etc/hosts 文件中。尝试在此之后重新启动网络。

    【讨论】:

      【解决方案2】:

      问题就在这里(在你的 conf - conf/hbase-site.xml):

      <name>hbase.zookeeper.quorum</name>
            <value>localhost</value>
      

      由于错误“ERROR zookeeper.RecoverableZooKeeper: ZooKeeper exists 在 3 次重试后失败”表明您的 zookeeper.quorum 指令存在问题。或者在启动 HBase shell 之前,您可以使用以下方法验证 ZKQuorum 是否已启动:

      $ jps
      

      该命令将列出机器上的所有 java 进程,即可能的输出必须是:

      62019 Jps
      61098 HMaster        
      61233 HRegionServer     
      61003 HQuorumPeer
      

      解决方案

      在你的 HBase 目录中,首先停止 HBase:

      $ ./bin/stop-hbase.sh
      

      如果您尝试制定“独立 HBase”示例 - 请坚持示例中提供的最低配置:

      <configuration>
        <property>
          <name>hbase.rootdir</name>
          <value>file:///home/adio/workspace/hadoop/hbase/directories/hbase</value>
        </property>
        <property>
          <name>hbase.zookeeper.property.dataDir</name>
          <value>/home/adio/workspace/hadoop/hbase/directories/zookeeper</value>
        </property>
      </configuration>
      

      即你的conf/hbase-site.xml应该有以上内容。

      设置后,现在再次启动 HBase:

      $ ./bin/start-hbase.sh
      

      【讨论】:

        猜你喜欢
        • 2014-06-05
        • 2021-08-05
        • 2016-11-21
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2013-06-14
        • 2021-06-11
        • 1970-01-01
        相关资源
        最近更新 更多