No snapshot found, but there are log entries. Something is broken!

问题

在新安装了Zookeeper之后,闪退报错

java.io.IOException: No snapshot found, but there are log entries. Something is broken!
        at org.apache.zookeeper.server.persistence.FileTxnSnapLog.restore(FileTxnSnapLog.java:222)
        at org.apache.zookeeper.server.ZKDatabase.loadDataBase(ZKDatabase.java:240)
        at org.apache.zookeeper.server.ZooKeeperServer.loadData(ZooKeeperServer.java:290)
        at org.apache.zookeeper.server.ZooKeeperServer.startdata(ZooKeeperServer.java:450)
        at org.apache.zookeeper.server.NIOServerCnxnFactory.startup(NIOServerCnxnFactory.java:764)
        at org.apache.zookeeper.server.ServerCnxnFactory.startup(ServerCnxnFactory.java:98)
        at org.apache.zookeeper.server.ZooKeeperServerMain.runFromConfig(ZooKeeperServerMain.java:144)
        at org.apache.zookeeper.server.ZooKeeperServerMain.initializeAndRun(ZooKeeperServerMain.java:106)
        at org.apache.zookeeper.server.ZooKeeperServerMain.main(ZooKeeperServerMain.java:64)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:128)
        at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:82)

 

参考

https://blog.csdn.net/baidu2030/article/details/92383629

 

原因

原因是之前装了别的版本的Zookeeper,导致dataDir数据冲突

No snapshot found, but there are log entries. Something is broken!_第1张图片

 

解决方式

如果之前的数据不重要,可以直接删除该目录下的数据。也可以改为别的目录。

 

 

你可能感兴趣的:(java,Zookeeper)