线上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文件

相关推荐
大圣数据星球24 分钟前
揭秘 Fluss 架构组件
大数据·设计模式·flink
沙滩de流沙37 分钟前
Hadoop生态
大数据·hadoop·分布式
进击的小小学生42 分钟前
多因子模型连载
大数据·python·数据分析·区块链
qiquandongkh43 分钟前
期权懂|期权入门知识:如何选择期权合约?
大数据·区块链
互联网资讯1 小时前
抖音生活服务商系统源码怎么搭建?
大数据·运维·人工智能·生活
Allen_LVyingbo1 小时前
医院大数据平台建设:基于快速流程化工具集的考察
大数据·网络·人工智能·健康医疗
jiejianyun8572 小时前
零售小程序怎么自己搭建?开个小卖铺如何留住客户?
大数据
web135085886353 小时前
9. 大数据集群(PySpark)+Hive+MySQL+PyEcharts+Flask:信用贷款风险分析与预测
大数据·hive·mysql
神秘打工猴11 小时前
Flink 集群有哪些⻆⾊?各⾃有什么作⽤?
大数据·flink
小刘鸭!11 小时前
Flink的三种时间语义
大数据·flink