开发者社区> 问答> 正文

node连接不上zookeeper,实在没找出到底是node问题还是zookeeper问题

zookeeper.out日志:

2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:os.name=Linux 2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:os.arch=amd64 2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:os.version=3.10.0-327.10.1.el7.x86_64 2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:user.name=root 2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:user.home=/root 2016-07-22 14:20:53,489 [myid:] - INFO [main:Environment@100] - Server environment:user.dir=/ 2016-07-22 14:20:53,490 [myid:] - INFO [main:ZooKeeperServer@787] - tickTime set to 2000 2016-07-22 14:20:53,490 [myid:] - INFO [main:ZooKeeperServer@796] - minSessionTimeout set to -1 2016-07-22 14:20:53,490 [myid:] - INFO [main:ZooKeeperServer@805] - maxSessionTimeout set to -1 2016-07-22 14:20:53,497 [myid:] - INFO [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2181 2016-07-22 14:21:34,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@355] - Expiring session 0x156113ab8010000, timeout of 40000ms exceeded 2016-07-22 14:21:34,001 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@489] - Processed session termination for sessionid: 0x156113ab8010000 2016-07-22 14:21:34,001 [myid:] - INFO [SyncThread:0:FileTxnLog@199] - Creating new log file: log.14 2016-07-22 14:21:45,285 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /127.0.0.1:9984 2016-07-22 14:21:45,333 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /127.0.0.1:9984 2016-07-22 14:21:45,365 [myid:] - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x1561143878b0000 with negotiated timeout 40000 for client /127.0.0.1:9984 2016-07-22 14:22:23,050 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@357] - caught end of stream exception EndOfStreamException: Unable to read additional data from client sessionid 0x1561143878b0000, likely client has closed socket at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:230) at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:203) at java.lang.Thread.run(Thread.java:745) 2016-07-22 14:22:23,053 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1008] - Closed socket connection for client /127.0.0.1:9984 which had sessionid 0x1561143878b0000 2016-07-22 14:23:04,000 [myid:] - INFO [SessionTracker:ZooKeeperServer@355] - Expiring session 0x1561143878b0000, timeout of 40000ms exceeded 2016-07-22 14:23:04,001 [myid:] - INFO [ProcessThread(sid:0 cport:2181)::PrepRequestProcessor@489] - Processed session termination for sessionid: 0x1561143878b0000 2016-07-22 14:23:39,830 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@192] - Accepted socket connection from /127.0.0.1:9997 2016-07-22 14:23:39,833 [myid:] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@900] - Client attempting to establish new session at /127.0.0.1:9997 2016-07-22 14:23:39,849 [myid:] - INFO [SyncThread:0:ZooKeeperServer@645] - Established session 0x1561143878b0001 with negotiated timeout 40000 for client /127.0.0.1:9997 2016-07-22 14:23:56,903 [myid:] - WARN [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@357] - caught end of stream exception

node.log日志: java.net.ConnectException: Connection refused at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) ~[na:1.8.0_74] at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) ~[na:1.8.0_74] at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350) ~[zookeeper-3.4.5.jar:3.4.5-1392090] at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068) ~[zookeeper-3.4.5.jar:3.4.5-1392090] 2016-07-22 14:34:25.863 [main-SendThread(localhost:2081)] WARN org.apache.zookeeper.ClientCnxn - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 60000 at com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.connect(ZkClientx.java:974) at com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.(ZkClientx.java:104) at com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.(ZkClientx.java:98) at com.alibaba.otter.shared.common.utils.zookeeper.ZkClientx.(ZkClientx.java:86) at com.alibaba.otter.shared.arbitrate.impl.zookeeper.ZooKeeperClient.createClient(ZooKeeperClient.java:86) at com.alibaba.otter.shared.arbitrate.impl.zookeeper.ZooKeeperClient.access$000(ZooKeeperClient.java:38) at com.alibaba.otter.shared.arbitrate.impl.zookeeper.ZooKeeperClient$1.apply(ZooKeeperClient.java:45) at com.alibaba.otter.shared.arbitrate.impl.zookeeper.ZooKeeperClient$1.apply(ZooKeeperClient.java:42) at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:155) ... 56 more

原提问者GitHub用户 hjjoe1213123

展开
收起
大圣东游 2023-06-21 16:56:36 107 0
1 条回答
写回答
取消 提交回答
  • Caused by: org.I0Itec.zkclient.exception.ZkTimeoutException: Unable to connect to zookeeper server within timeout: 60000, 感觉还是zookeeper的问题

    原回答者GitHub用户agapple

    2023-06-21 18:01:25
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
《MSE 微服务网关》 立即下载
微服务引擎 MSE 治理中心重磅发布 立即下载
阿里云微服务引擎 MSE 2.0 线上发布 立即下载