zookeeper注册重连

异常信息

2014-11-24 19:42:44,399 [Thread-3-SendThread(192.168.90.147:4181)] WARN  org.apache.zookeeper.ClientCnxn - Session 0x149c21809731325 for server 192.168.90.147/192.168.90.147:4181, unexpected error, closing socket connection and attempting reconnect  
java.lang.NoClassDefFoundError: org/apache/zookeeper/proto/SetWatches  
        at org.apache.zookeeper.ClientCnxn$SendThread.primeConnection(ClientCnxn.java:867) ~[zookeeper-3.4.5.jar:3.4.5-1392090]  
        at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:352) ~[zookeeper-3.4.5.jar:3.4.5-1392090]  
2016-02-29 15:50:04,937 [myid:] - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1162] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:716)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
2016-02-29 15:50:05,039 [myid:] - INFO  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/192.168.133.130:2181. Will not attempt to authenticate using SASL (unknown error)
2016-02-29 15:50:05,040 [myid:] - WARN  [main-SendThread(localhost:2181):ClientCnxn$SendThread@1162] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused

 

 

解决方案(已确认)

参考地址:http://blog.csdn.net/li396864285/article/details/54574955

步骤:

  1、检查Java进程,判断是否多个同样的进程  “ps -ef|grep java”

  2、全部关闭同样的进程,然后重启,保证进程唯一

posted @ 2017-11-06 23:25  刘广平  阅读(1252)  评论(0)    收藏  举报