Hbase错误java.lang.RuntimeException:无法运行Quorum Server

时间:2013-08-22 05:04:15

标签: hadoop hbase apache-zookeeper

我无法启动Hbase,每当我开始时我只能在jps中获得Hmaster和Hregionserver。 Hquorompeer一直缺少。我检查了日志,我收到了以下错误:

java.lang.RuntimeException: Unable to run quorum server
        at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:454)
        at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:409)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:151)
        at org.apache.hadoop.hbase.zookeeper.HQuorumPeer.runZKServer(HQuorumPeer.java:80)
        at org.apache.hadoop.hbase.zookeeper.HQuorumPeer.main(HQuorumPeer.java:70)
Caused by: java.io.IOException: Failed to process transaction type: 1 error: KeeperErrorCode = NoNode for /hbase
        at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:153)
        at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:223)
        at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:417)
        ... 4 more
Caused by: org.apache.zookeeper.KeeperException$NoNodeException: KeeperErrorCode = NoNode for /hbase
        at org.apache.zookeeper.server.persistence.FileTxnSnapLog.processTransaction(FileTxnSnapLog.java:211)
        at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:151)

3 个答案:

答案 0 :(得分:3)

您遇到此错误的原因可能是Zookeeper存储快照和日志损坏的数据目录。

为了避免HQuorumpeer守护程序消失,您需要提供一个新目录的路径,zookeeper可以在其中存储其快照。为此,您需要在Hbase.site.xml中添加以下属性

<property>
<name>hbase.zookeeper.property.dataDir</name>
<value>location of the newly created folder</value>
<description>Property from ZooKeeper's config zoo.cfg.
The directory where the snapshot is stored.
</description>
</property>

答案 1 :(得分:1)

&#34; hbase.zookeeper.property.dataDir&#34;的默认路径是/ tmp / hbase - * / zookeeper(/ tmp / hbase-hadoop / zookeeper),删除它并尝试再次启动zookeeper

答案 2 :(得分:0)

从ZooKeeper目录中删除所有文件解决了这个问题。在我的情况下

rm /var/lib/zookeeper/version-2/*