dubbo注冊中心zookeeper出現異常 Opening socket connection to server 10.70.42.99/10.70.42.99:2181. Will not attempt to authenticate using SASL (無法定位登錄配置)


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版本不一致。

  當關閉防火牆還是沒有解決問題時候,可以看看是否版本不一致,我的問題在關閉防火牆之后解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM