最近在弄zookpper, 发现虚拟机的zookeeper(observer)突然不能运行,查看日志发现是/temp/zookeeper下有个version-2文件夹,到当前epoch大于当前启动的epoch,查看了下,下面都是日志文件,删除该文件夹,可以运行了,觉得有点奇怪,mark下
完整报错日志贴在下方:
2019-10-12 02:19:03,036 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:QuorumPeer@922] - OBSERVING
2019-10-12 02:19:03,037 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:ZooKeeperServer@173] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /tmp/zookeeper/version-2 snapdir /tmp/zookeeper/version-2
2019-10-12 02:19:03,037 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:ObserverZooKeeperServer@64] - syncEnabled =true
2019-10-12 02:19:03,037 [myid:4] - INFO [WorkerReceiver[myid=4]:FastLeaderElection@600] - Notification: 1 (message format version), 3 (n.leader), 0x0 (n.zxid), 0x1 (n.round), FOLLOWING (n.state), 2 (n.sid), 0x2 (n.peerEpoch) OBSERVING (my state)
2019-10-12 02:19:03,037 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:QuorumPeer$QuorumServer@167] - Resolved hostname: 192.168.98.13 to address: /192.168.98.13
2019-10-12 02:19:03,037 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:Observer@65] - Observing /192.168.98.13:2188
2019-10-12 02:19:03,040 [myid:4] - WARN [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:Observer@77] - Exception when observing the leader
java.io.IOException: Leaders epoch, 2 is less than accepted epoch, 19
at org.apache.zookeeper.server.quorum.Learner.registerWithLeader(Learner.java:297)
at org.apache.zookeeper.server.quorum.Observer.observeLeader(Observer.java:68)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:924)
2019-10-12 02:19:03,040 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:Observer@135] - shutdown called
java.lang.Exception: shutdown Observer
at org.apache.zookeeper.server.quorum.Observer.shutdown(Observer.java:135)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:928)
2019-10-12 02:19:03,041 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:QuorumPeer@865] - LOOKING
2019-10-12 02:19:03,041 [myid:4] - INFO [QuorumPeer[myid=4]/0:0:0:0:0:0:0:0:2181:FastLeaderElection@818] - New election. My id = 4, proposed zxid=0x8000000000000000
2019-10-12 02:19:03,042 [myid:4] - INFO [WorkerReceiver[myid=4]:FastLeaderElection@600] - Notification: 1 (message format version), 3 (n.leader), 0x0 (n.zxid), 0x1 (n.round), FOLLOWING (n.state), 1 (n.sid), 0x2 (n.peerEpoch) LOOKING (my state)
2019-10-12 02:19:03,042 [myid:4] - INFO [WorkerReceiver[myid=4]:FastLeaderElection@600] - Notification: 1 (message format version), 3 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LEADING (n.state), 3 (n.sid), 0x2 (n.peerEpoch) LOOKING (my state)