linux下,zookeeper安裝並啟動起來了
DEMO時,JAVA控制台出現:
- 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 (無法定位登錄配置)
- WARN 2014-03-06 09:49:02,320 (ClientCnxn.java:1089) - 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:574)
- at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
- at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
zookeeper控制台日志
- 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)
- 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
- 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
- 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
- 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
- EndOfStreamException: Unable to read additional data from client sessionid 0x14491611e2f0002, likely client has closed socket
- at org.apache.zookeeper.server.NIOServerCnxn.doIO(NIOServerCnxn.java:220)
- at org.apache.zookeeper.server.NIOServerCnxnFactory.run(NIOServerCnxnFactory.java:208)
- at java.lang.Thread.run(Thread.java:736)
- 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
- 2014-03-06 10:01:16,015 [myid:] - INFO [SessionTracker:ZooKeeperServer@325] - Expiring session 0x14491611e2f0002, timeout of 30000ms exceeded
- 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版本不一致。
當關閉防火牆還是沒有解決問題時候,可以看看是否版本不一致,我的問題在關閉防火牆之后解決。