本地文件系统上的独立hbase获取zookeeper错误?

vxqlmq5t  于 2021-06-03  发布在  Hadoop
关注(0)|答案(2)|浏览(291)

嗨,伙计们,我正试图遵循hbase的快速启动,并在本地文件系统上启动一个hbase(不使用hdfs),但当我启动shell时使用./hbase 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>

有什么建议吗?

33qvvth1

33qvvth11#

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

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

因为错误“error zookeeper.recoverablezookeeper:zookeeper exists failed after 3 retries”表示您的应用程序有问题 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>

i、 e.你的 conf/hbase-site.xml 应该有以上内容。
设置完成后,现在再次启动hbase:

$ ./bin/start-hbase.sh
h6my8fg2

h6my8fg22#

zookeeper仲裁名称必须是计算机的主机名,并且必须出现在/etc/hosts文件中。在此之后尝试重新启动网络。

相关问题