1

我无法启动 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)
4

3 回答 3

4

您遇到此错误的原因可能是 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>
于 2013-08-26T07:34:15.780 回答
1

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

于 2016-02-22T02:25:40.067 回答
0

从 ZooKeeper 目录中删除所有文件解决了这个问题。就我而言

rm /var/lib/zookeeper/version-2/*
于 2014-10-17T19:38:31.897 回答