zookeeper启动错误 ---- Unable to load database on disk
zk启动报错
解决办法,进入zkdata目录删除version-2下面的所有文件
参考:
https://issues.apache.org/jira/browse/ZOOKEEPER-1546
[hadoop@slave1 bin]$ cat zookeeper.out
2017-09-06 20:38:53,468 [myid:] - INFO [main:QuorumPeerConfig@134] - Reading configuration from: /usr/local/zookeeper/zookeeper-3.4.10/bin/../conf/zoo.cfg
2017-09-06 20:38:53,486 [myid:] - INFO [main:QuorumPeer$QuorumServer@167] - Resolved hostname: slave3 to address: slave3/192.168.1.198
2017-09-06 20:38:53,487 [myid:] - INFO [main:QuorumPeer$QuorumServer@167] - Resolved hostname: slave2 to address: slave2/192.168.1.197
2017-09-06 20:38:53,487 [myid:] - INFO [main:QuorumPeer$QuorumServer@167] - Resolved hostname: slave1 to address: slave1/192.168.1.196
2017-09-06 20:38:53,487 [myid:] - INFO [main:QuorumPeerConfig@396] - Defaulting to majority quorums
2017-09-06 20:38:53,490 [myid:1] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2017-09-06 20:38:53,490 [myid:1] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2017-09-06 20:38:53,490 [myid:1] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2017-09-06 20:38:53,501 [myid:1] - INFO [main:QuorumPeerMain@127] - Starting quorum peer
2017-09-06 20:38:53,509 [myid:1] - INFO [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181
2017-09-06 20:38:53,526 [myid:1] - INFO [main:QuorumPeer@1134] - minSessionTimeout set to -1
2017-09-06 20:38:53,526 [myid:1] - INFO [main:QuorumPeer@1145] - maxSessionTimeout set to -1
2017-09-06 20:38:53,526 [myid:1] - INFO [main:QuorumPeer@1419] - QuorumPeer communication is not secured!
2017-09-06 20:38:53,526 [myid:1] - INFO [main:QuorumPeer@1448] - quorum.cnxn.threads.size set to 20
2017-09-06 20:38:53,529 [myid:1] - INFO [main:FileSnap@83] - Reading snapshot /home/hadoop/zookeeper/zkdata/version-2/snapshot.400000000
2017-09-06 20:38:53,890 [myid:1] - ERROR [main:Util@239] - Last transaction was partial.
2017-09-06 20:38:53,896 [myid:1] - ERROR [main:QuorumPeer@648] - Unable to load database on disk
java.io.IOException: The current epoch, 12, is older than the last zxid, 81604378626
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:630)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:591)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:164)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
2017-09-06 20:38:53,899 [myid:1] - ERROR [main:QuorumPeerMain@89] - Unexpected exception, exiting abnormally
java.lang.RuntimeException: Unable to run quorum server
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:649)
at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:591)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:164)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:111)
at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:78)
Caused by: java.io.IOException: The current epoch, 12, is older than the last zxid, 81604378626
at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:630)
... 4 more