2014-01-07 38 views
1

嗨,大家好,我正在嘗試關注quick start of HBase並在本地文件系統上啓動HBase(不使用HDFS)。但是,當我使用./hbase shell啓動shell並輸入「status」時,出現zookeeper錯誤?獨立HBase本地文件系統獲取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> 

有什麼建議?

回答

1

您的動物園管理員仲裁名稱必須是您計算機的主機名,並且還必須存在於/ etc/hosts文件中。嘗試在此之後重新啓動網絡。

1

的問題是在這裏(在你的conf - conf/hbase-site.xml):

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

由於錯誤 「錯誤zookeeper.RecoverableZooKeeper:ZooKeeper的存在後3個重失敗」 表示有一些問題與您zookeeper.quorum指令。或盯着之前HBase的外殼,你可以驗證,如果ZKQuorum到了,使用:

$ jps 

命令會列出機器上的所有Java進程即可能的輸出必須是:

62019 Jps 
61098 HMaster   
61233 HRegionServer  
61003 HQuorumPeer 

解決方案

在您的HBase的目錄中,先停止HBase的:

$ ./bin/stop-hbase.sh 

如果你想制定出「獨立HBase的」例子 - 堅持在本例中規定的最低的conf:

<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 
相關問題