线上Zookeeper问题解决记录


zookeeper问题:

日志目录: 

/home/cmccdata/app/zookeeper/logs

dataDir=/home/cmccdata/app/zookeeper/data/zoodata
dataLogDir=/home/cmccdata/app/zookeeper/data/zoolog

问题0:

2023-08-03 17:15:43,139 [myid:1] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@354] - Exception causing close of session 0x0 due to java.io.IOException: ZooKeeperServer not running
2023-08-03 17:15:43,139 [myid:1] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /10.26.1.1:20768 (no session established for client)
2023-08-03 17:15:43,485 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 2 at election address bj-cmcdn4/10.26.1.35:3888
java.net.ConnectException: Connection refused (Connection refused)
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  at java.net.Socket.connect(Socket.java:589)
  at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:354)
  at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
  at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
  at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)
2023-08-03 17:15:43,492 [myid:1] - WARN  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@368] - Cannot open channel to 3 at election address bj-cmcdn5/10.26.1.36:3888
java.net.ConnectException: Connection refused (Connection refused)
  at java.net.PlainSocketImpl.socketConnect(Native Method)
  at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
  at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
  at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
  at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
  at java.net.Socket.connect(Socket.java:589)
  at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:354)
  at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:388)
  at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:765)
  at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:716)


  
解决方案:
    关闭防火墙


问题1:

2023-08-03 17:28:14,783 [myid:1] - INFO  [main:FileSnap@83] - Reading snapshot /home/cmccdata/app/zookeeper/data/zoodata/version-2/snapshot.1b00000001
2023-08-03 17:28:14,969 [myid:1] - INFO  [PurgeTask:DatadirCleanupManager$PurgeTask@144] - Purge task completed.
2023-08-03 17:28:15,010 [myid:1] - ERROR [main:QuorumPeer@453] - Unable to load database on disk
java.io.IOException: The current epoch, 1c, is older than the last zxid, 124554051589
  at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:435)
  at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:409)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:156)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
2023-08-03 17:28:15,012 [myid:1] - ERROR [main:QuorumPeerMain@94] - Unexpected exception, exiting abnormally
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:156)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: java.io.IOException: The current epoch, 1c, is older than the last zxid, 124554051589
  at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:435)
  ... 4 more


解决方案:
删除/home/cmccdata/app/zookeeper/data/zoodata/version-2/ 下 currentepoch文件


问题2:

2023-08-03 18:08:04,514 [myid:] - INFO  [main:QuorumPeerConfig@101] - Reading configuration from: /home/cmccdata/app/zookeeper/bin/../conf/zoo.cfg
2023-08-03 18:08:04,518 [myid:] - INFO  [main:QuorumPeerConfig@334] - Defaulting to majority quorums
2023-08-03 18:08:04,521 [myid:1] - INFO  [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 10
2023-08-03 18:08:04,521 [myid:1] - INFO  [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 3
2023-08-03 18:08:04,522 [myid:1] - INFO  [PurgeTask:DatadirCleanupManager$PurgeTask@138] - Purge task started.
2023-08-03 18:08:04,531 [myid:1] - INFO  [main:QuorumPeerMain@132] - Starting quorum peer
2023-08-03 18:08:04,535 [myid:1] - INFO  [PurgeTask:DatadirCleanupManager$PurgeTask@144] - Purge task completed.
2023-08-03 18:08:04,539 [myid:1] - INFO  [main:NIOServerCnxnFactory@94] - binding to port 0.0.0.0/0.0.0.0:2181
2023-08-03 18:08:04,545 [myid:1] - INFO  [main:QuorumPeer@913] - tickTime set to 2000
2023-08-03 18:08:04,545 [myid:1] - INFO  [main:QuorumPeer@933] - minSessionTimeout set to -1
2023-08-03 18:08:04,545 [myid:1] - INFO  [main:QuorumPeer@944] - maxSessionTimeout set to -1
2023-08-03 18:08:04,545 [myid:1] - INFO  [main:QuorumPeer@959] - initLimit set to 10
2023-08-03 18:08:04,551 [myid:1] - INFO  [main:FileSnap@83] - Reading snapshot /home/cmccdata/app/zookeeper/data/zoodata/version-2/snapshot.1b00000001
2023-08-03 18:08:04,739 [myid:1] - INFO  [main:QuorumPeer@429] - currentEpoch not found! Creating with a reasonable default of 29. This should only happen when you are upgrading your installation
2023-08-03 18:08:04,766 [myid:1] - ERROR [main:QuorumPeer@453] - Unable to load database on disk
java.io.IOException: The current epoch, 1d is less than the accepted epoch, 1c
  at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:450)
  at org.apache.zookeeper.server.quorum.QuorumPeer.start(QuorumPeer.java:409)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.runFromConfig(QuorumPeerMain.java:156)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
2023-08-03 18:08:04,768 [myid:1] - ERROR [main:QuorumPeerMain@94] - Unexpected exception, exiting abnormally
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:156)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.initializeAndRun(QuorumPeerMain.java:116)
  at org.apache.zookeeper.server.quorum.QuorumPeerMain.main(QuorumPeerMain.java:79)
Caused by: java.io.IOException: The current epoch, 1d is less than the accepted epoch, 1c
  at org.apache.zookeeper.server.quorum.QuorumPeer.loadDataBase(QuorumPeer.java:450)
  ... 4 more
2023-08-03 18:08:24,556 [myid:] - INFO  [main:FourLetterWordMain@43] - connecting to localhost 2181


解决方案:
删除/home/cmccdata/app/zookeeper/data/zoodata/version-2/ 下  acceptedepoch文件

你可能感兴趣的:(大数据)