dubbo注册中心zookeeper出现异常 Opening socket connection to server 10.70.42.99/10.70.42.99:2181. Will not at...

linux下,zookeeper安装并启动起来了

DEMO时,JAVA控制台出现:

[java] view plain copy
  1. INFO 2014-03-06 09:48:41,276 (ClientCnxn.java:966) - Opening socket connection to server 10.70.42.99/10.70.42.99:2181. Will not attempt to authenticate using SASL (无法定位登录配置)  
  2.  WARN 2014-03-06 09:49:02,320 (ClientCnxn.java:1089) - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect  
  3. java.net.ConnectException: Connection timed out: no further information  
  4.     at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)  
  5.     at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:574)  
  6.     at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)  
  7.     at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)  


zookeeper控制台日志

[java] view plain copy
  1. 2014-03-05 17:59:32,173 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /10.70.41.42:44726 (no session established for client)  
  2. 2014-03-06 09:59:54,754 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxnFactory@197] - Accepted socket connection from /127.0.0.1:39106  
  3. 2014-03-06 09:59:54,783 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:ZooKeeperServer@839] - Client attempting to establish new session at /127.0.0.1:39106  
  4. 2014-03-06 09:59:54,835 [myid:] - INFO  [SyncThread:0:ZooKeeperServer@595] - Established session 0x14491611e2f0002 with negotiated timeout 30000 for client /127.0.0.1:39106  
  5. 2014-03-06 10:00:47,193 [myid:] - WARN  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@349] - caught end of stream exception  
  6. EndOfStreamException: Unable to read additional data from client sessionid 0x14491611e2f0002, likely client has closed socket  
  7.         at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)  
  8.         at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)  
  9.         at java.lang.Thread.run(Thread.java:736)  
  10. 2014-03-06 10:00:47,195 [myid:] - INFO  [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2181:NIOServerCnxn@1001] - Closed socket connection for client /127.0.0.1:39106 which had sessionid 0x14491611e2f0002  
  11. 2014-03-06 10:01:16,015 [myid:] - INFO  [SessionTracker:ZooKeeperServer@325] - Expiring session 0x14491611e2f0002, timeout of 30000ms exceeded  
  12. 2014-03-06 10:01:16,016 [myid:] - INFO  [ProcessThread(sid:0 cport:-1)::PrepRequestProcessor@476] - Processed session termination for sessionid: 0x14491611e2f0002  


JVM采用了socket代理,不知道跟代理有没有关系,安装不是以ROOT用户的

暂时没解决,记录下来先:

 

解决方案:

1.关闭防火墙。

通过zookeeper搭建dubbo注册中心遇到的问题:在linux下安装,配置并启动zookeeper。在window环境下启动服务提供方时,未成功启动,报以下错误:

报错信息

?
1
2
3
4
5
6
7
8
9
2017 - 03 - 02 19 : 52 : 32 , 270 INFO [org.apache.zookeeper.ZooKeeper] - Initiating client connection, connectString= 192.168 . 153.128 : 2181 sessionTimeout= 30000 watcher=org.I0Itec.zkclient.ZkClient @1d6ba2b
2017 - 03 - 02 19 : 52 : 32 , 288 INFO [org.apache.zookeeper.ClientCnxn] - Opening socket connection to server 192.168 . 153.128 / 192.168 . 153.128 : 2181 . Will not attempt to authenticate using SASL (unknown error)
2017 - 03 - 02 19 : 52 : 53 , 291 WARN [org.apache.zookeeper.ClientCnxn] - Session 0x0 for server null , unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection timed out: no further information
     at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
     at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java: 739 )
     at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java: 361 )
     at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java: 1081 )
2017 - 03 - 02 19 : 52 : 54 , 394 INFO [org.apache.zookeeper.ClientCnxn] - Opening socket connection to server 192.168 . 153.128 / 192.168 . 153.128 : 2181 . Will not attempt to authenticate using SASL (unknown error)

经检查,是linux下防火墙未关闭,使用一下命令关闭防火墙:

servcie iptables stop

关闭后查看防火墙状态

service  –status-all

查看到一下信息则说明linux防火墙已经关闭。

 

2.可能是 客户端 zookeper版本与服务器端安装的zookeper版本不一致。

  当关闭防火墙还是没有解决问题时候,可以看看是否版本不一致,我的问题在关闭防火墙之后解决。

你可能感兴趣的:(dubbo注册中心zookeeper出现异常 Opening socket connection to server 10.70.42.99/10.70.42.99:2181. Will not at...)