2 scp32 scp32 于 2017.08.30 21:12 提问

有关zookeeper连接的问题 1C

我是在eclipse上引用dubbo服务连接zookeeper时出现了问题,问题代码如下:
2017-08-30 20:44:22,156 [localhost-startStop-1] [org.apache.zookeeper.ClientCnxn]-[DEBUG] zookeeper.disableAutoWatchReset is false
2017-08-30 20:44:22,182 [localhost-startStop-1] [org.I0Itec.zkclient.ZkClient]-[DEBUG] Awaiting connection to Zookeeper server
2017-08-30 20:44:22,192 [localhost-startStop-1-SendThread(192.168.139.176:9090)] [org.apache.zookeeper.ClientCnxn]-[INFO] Opening socket connection to server 192.168.139.176/192.168.139.176:9090. Will not attempt to authenticate using SASL (unknown error)
2017-08-30 20:44:23,195 [localhost-startStop-1-SendThread(192.168.139.176:9090)] [org.apache.zookeeper.ClientCnxn]-[WARN] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused: no further information
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
2017-08-30 20:44:23,197 [localhost-startStop-1-SendThread(192.168.139.176:9090)] [org.apache.zookeeper.ClientCnxnSocketNIO]-[DEBUG] Ignoring exception during shutdown input
java.nio.channels.ClosedChannelException
at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:780)
at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:399)
at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:200)
at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1246)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1170)
2017-08-30 20:44:23,197 [localhost-startStop-1-SendThread(192.168.139.176:9090)] [org.apache.zookeeper.ClientCnxnSocketNIO]-[DEBUG] Ignoring exception during shutdown output
之后就是无限循环最后那个异常。有没有大神能帮忙解决这个问题?

2个回答

pansanday
pansanday   2017.08.31 13:54
  1. 你看下你在zookeeper有没有启动成功
  2. 看下你的程序代码中,配置的zookeeper端口号(默认是2181)、IP地址是否正确
scp32
scp32   2017.09.01 01:02

恩。找到原因了。是因为没有启动表现层,导致服务层接受不到信息然后无限循环

Csdn user default icon
上传中...
上传图片
插入图片