开发者社区> 问答> 正文

zookeeper集群测试,能启动,但是zkServer.sh status 报?400报错

zoo.cfg配置:
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/opt/zookeeper/zookeeper/data
clientPort=2181
server.1=192.168.56.99:2887:3887
server.2=192.168.56.100:2888:3888
server.3=192.168.56.101:2889:3889

 

报错日志:

2019-05-08 20:55:22,000 - INFO  [main:QuorumPeerConfig@90] - Reading configuration from: /opt/zookeeper/zookeeper/bin/../conf/zoo.cfg
2019-05-08 20:55:22,027 - INFO  [main:QuorumPeerConfig@310] - Defaulting to majority quorums
2019-05-08 20:55:22,057 - INFO  [main:QuorumPeerMain@119] - Starting quorum peer
2019-05-08 20:55:22,138 - INFO  [main:NIOServerCnxn$Factory@143] - binding to port 0.0.0.0/0.0.0.0:2181
2019-05-08 20:55:22,174 - INFO  [main:QuorumPeer@819] - tickTime set to 2000
2019-05-08 20:55:22,175 - INFO  [main:QuorumPeer@830] - minSessionTimeout set to -1
2019-05-08 20:55:22,175 - INFO  [main:QuorumPeer@841] - maxSessionTimeout set to -1
2019-05-08 20:55:22,175 - INFO  [main:QuorumPeer@856] - initLimit set to 10
2019-05-08 20:55:22,218 - INFO  [Thread-1:QuorumCnxManager$Listener@473] - My election bind port: 3888
2019-05-08 20:55:22,230 - INFO  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumPeer@621] - LOOKING
2019-05-08 20:55:22,232 - INFO  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:FastLeaderElection@663] - New election. My id =  2, Proposed zxid = 0
2019-05-08 20:55:27,248 - WARN  [WorkerSender Thread:QuorumCnxManager@384] - Cannot open channel to 1 at election address /192.168.56.99:3887
java.net.SocketTimeoutException
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:118)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:340)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:360)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:333)
    at java.lang.Thread.run(Thread.java:748)
2019-05-08 20:55:27,263 - INFO  [WorkerReceiver Thread:FastLeaderElection@496] - Notification: 2 (n.leader), 0 (n.zxid), 1 (n.round), LOOKING (n.state), 2 (n.sid), LOOKING (my state)
2019-05-08 20:55:27,267 - WARN  [WorkerSender Thread:QuorumCnxManager@384] - Cannot open channel to 3 at election address /192.168.56.101:3889
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:340)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:360)
    at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:333)
    at java.lang.Thread.run(Thread.java:748)
2019-05-08 20:55:27,283 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 1 at election address /192.168.56.99:3887
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:404)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:688)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:622)
2019-05-08 20:55:27,285 - INFO  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:FastLeaderElection@697] - Notification time out: 400
2019-05-08 20:55:27,692 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 1 at election address /192.168.56.99:3887
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:404)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:688)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:622)
2019-05-08 20:55:27,703 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 3 at election address /192.168.56.101:3889
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:404)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:688)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:622)
2019-05-08 20:55:27,707 - INFO  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:FastLeaderElection@697] - Notification time out: 800
2019-05-08 20:55:28,512 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 1 at election address /192.168.56.99:3887
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:404)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:688)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:622)
2019-05-08 20:55:28,518 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 3 at election address /192.168.56.101:3889
java.net.NoRouteToHostException: No route to host
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at sun.nio.ch.SocketAdaptor.connect(SocketAdaptor.java:111)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:371)
    at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:404)
    at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:688)
    at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:622)
2019-05-08 20:55:28,522 - INFO  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:FastLeaderElection@697] - Notification time out: 1600
2019-05-08 20:55:30,128 - WARN  [QuorumPeer:/0:0:0:0:0:0:0:0:2181:QuorumCnxManager@384] - Cannot open channel to 1 at election address /192.168.56.99:3887

展开
收起
爱吃鱼的程序员 2020-06-06 09:21:56 977 0
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB
                        <p>你系统几块网卡,我之前其他事情遇到过类似问题,两块网卡路由会有问题,你可以配置下路由表试试,我测试用,把其中一个网关去了就好了,我用的CentOS</p>
                    
    
                        <p>看看你的所有的myid</p>
                    
    
                        <p>也许就是myid的问题</p>
    
    2020-06-06 09:22:12
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载
F2etest — 多浏览器兼容性测试整体解决方案 立即下载