ZooKeeper not starting because acceptedEpoch is less than the currentEpoch

5,487

Solution 1

It worked, I just did:

cp currentEpoch acceptedEpoch

in a zookeeper data directory, and it started without any problem.

Solution 2

This did solve the problem,

cp ~/zookeeper/version-2/currentEpoch ~/zookeeper/version-2/acceptedEpoch

actual reason for this is issue is time sync b/w the zookeeper nodes

Share:
5,487
hdjur_jcv
Author by

hdjur_jcv

Updated on September 18, 2022

Comments

  • hdjur_jcv
    hdjur_jcv almost 2 years

    I have zookeeper.version=3.4.10, and I see:

    https://issues.apache.org/jira/browse/ZOOKEEPER-2307

    that is however in unresolved status. The problem appeared because of filling up the disk space. Now that I deleted some logs, and freed space, I would like to start zookeeper but it won't start due to this error:

    [2019-01-22 09:07:32,646] ERROR Unable to load database on disk 
    (org.apache.zookeeper.server.quorum.QuorumPeer)
    java.io.IOException: The accepted epoch, 13 is less than the current epoch, 
    14
        at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:645)
        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)
    [2019-01-22 09:07:32,648] ERROR Unexpected exception, exiting abnormally 
    (org.apache.zookeeper.server.quorum.QuorumPeerMain)
    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 accepted epoch, 13 is less than the current epoch, 14
        at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:645)
        ... 4 more
    

    Do I have to patch it (I'm not sure there is a patch ready), or can I just fix zookeeper data (like, make it somehow to accept new epoch) and continue with the same version?

  • Alihossein shahabi
    Alihossein shahabi over 2 years
    worked for me. thanks