org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:218

在vmware中安装hadoop伪分布式,使用host-only模式使用hbase shell一直正常,后来为了能上网改为了Briged模式。

启动后再命令端看到了关于hbase的异常信息org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)认为是hbase的错误
一直找不出原因,上网也搜了,有的说是hbase-site.xml的zookeeper的配置,有的说是时钟不一致。唉,又是没好好看日志的原因,原来是hadoop的datanode没启动起来。

datanode失败的原因是旧的namespaceID和namenode格式化的不一致。

总结:好好看日志分析原因,对于新手操作后一定要检查操作达到目的,如可以使用jps检查进程是否启动。

2013-05-13 09:25:17,125 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x13e9b7d74560002
2013-05-13 09:25:17,181 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:34750 which had sessionid 0x13e9b7d74560002
2013-05-13 09:25:18,193 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:34759
2013-05-13 09:25:18,194 INFO org.apache.zookeeper.server.ZooKeeperServer: Client attempting to establish new session at /127.0.0.1:34759
2013-05-13 09:25:18,195 INFO org.apache.zookeeper.server.ZooKeeperServer: Established session 0x13e9b7d74560003 with negotiated timeout 40000 for client /127.0.0.1:34759
2013-05-13 09:25:22,197 DEBUG org.apache.hadoop.hbase.util.FSUtils: Created version file at hdfs://localhost:9100/hbase set its version at:7
2013-05-13 09:25:22,199 WARN org.apache.hadoop.hdfs.DFSClient: DataStreamer Exception: org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /hbase/hbase.version could only be replicated to 0 nodes, instead of 1
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1558)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:696)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)
 at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)
 at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAs(Subject.java:396)
 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
 at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)

 at org.apache.hadoop.ipc.Client.call(Client.java:1070)
 at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
 at $Proxy11.addBlock(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
 at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
 at $Proxy11.addBlock(Unknown Source)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.locateFollowingBlock(DFSClient.java:3510)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.nextBlockOutputStream(DFSClient.java:3373)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.access$2600(DFSClient.java:2589)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2829)

2013-05-13 09:25:22,199 WARN org.apache.hadoop.hdfs.DFSClient: Error Recovery for block null bad datanode[0] nodes == null
2013-05-13 09:25:22,199 WARN org.apache.hadoop.hdfs.DFSClient: Could not get block locations. Source file "/hbase/hbase.version" - Aborting...
2013-05-13 09:25:22,199 FATAL org.apache.hadoop.hbase.master.HMaster: Unhandled exception. Starting shutdown.
org.apache.hadoop.ipc.RemoteException: java.io.IOException: File /hbase/hbase.version could only be replicated to 0 nodes, instead of 1
 at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.getAdditionalBlock(FSNamesystem.java:1558)
 at org.apache.hadoop.hdfs.server.namenode.NameNode.addBlock(NameNode.java:696)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.ipc.RPC$Server.call(RPC.java:563)
 at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1388)
 at org.apache.hadoop.ipc.Server$Handler$1.run(Server.java:1384)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAs(Subject.java:396)
 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121)
 at org.apache.hadoop.ipc.Server$Handler.run(Server.java:1382)

 at org.apache.hadoop.ipc.Client.call(Client.java:1070)
 at org.apache.hadoop.ipc.RPC$Invoker.invoke(RPC.java:225)
 at $Proxy11.addBlock(Unknown Source)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.io.retry.RetryInvocationHandler.invokeMethod(RetryInvocationHandler.java:82)
 at org.apache.hadoop.io.retry.RetryInvocationHandler.invoke(RetryInvocationHandler.java:59)
 at $Proxy11.addBlock(Unknown Source)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.locateFollowingBlock(DFSClient.java:3510)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.nextBlockOutputStream(DFSClient.java:3373)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream.access$2600(DFSClient.java:2589)
 at org.apache.hadoop.hdfs.DFSClient$DFSOutputStream$DataStreamer.run(DFSClient.java:2829)
2013-05-13 09:25:22,200 INFO org.apache.hadoop.hbase.master.HMaster: Aborting
2013-05-13 09:25:22,200 DEBUG org.apache.hadoop.hbase.master.HMaster: Stopping service threads
2013-05-13 09:25:22,200 INFO org.apache.hadoop.ipc.HBaseServer: Stopping server on 50705
2013-05-13 09:25:22,200 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 0 on 50705: exiting
2013-05-13 09:25:22,200 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 1 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 2 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 3 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 4 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 5 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 6 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 7 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 8 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: IPC Server handler 9 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: REPL IPC Server handler 0 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: REPL IPC Server handler 1 on 50705: exiting
2013-05-13 09:25:22,201 INFO org.apache.hadoop.ipc.HBaseServer: REPL IPC Server handler 2 on 50705: exiting
2013-05-13 09:25:22,202 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server listener on 50705
2013-05-13 09:25:22,204 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server Responder
2013-05-13 09:25:22,204 INFO org.apache.hadoop.ipc.HBaseServer: Stopping IPC Server Responder
2013-05-13 09:25:22,217 INFO org.apache.zookeeper.server.PrepRequestProcessor: Processed session termination for sessionid: 0x13e9b7d74560000
2013-05-13 09:25:22,222 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:34745 which had sessionid 0x13e9b7d74560000
2013-05-13 09:25:22,222 INFO org.apache.zookeeper.ClientCnxn: EventThread shut down
2013-05-13 09:25:22,222 INFO org.apache.zookeeper.ZooKeeper: Session: 0x13e9b7d74560000 closed
2013-05-13 09:25:22,222 INFO org.apache.hadoop.hbase.master.HMaster: HMaster main thread exiting
2013-05-13 09:25:22,224 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:34747 which had sessionid 0x13e9b7d74560001
2013-05-13 09:25:22,225 INFO org.apache.zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x13e9b7d74560001, likely server has closed socket, closing socket connection and attempting reconnect
2013-05-13 09:25:22,225 INFO org.apache.zookeeper.server.NIOServerCnxn: Closed socket connection for client /127.0.0.1:34759 which had sessionid 0x13e9b7d74560003
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.NIOServerCnxnFactory: NIOServerCnxn factory exited run method
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.ZooKeeperServer: shutting down
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.SessionTrackerImpl: Shutting down
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.PrepRequestProcessor: Shutting down
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.PrepRequestProcessor: PrepRequestProcessor exited loop!
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.SyncRequestProcessor: Shutting down
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.SyncRequestProcessor: SyncRequestProcessor exited!
2013-05-13 09:25:22,226 INFO org.apache.zookeeper.server.FinalRequestProcessor: shutdown of request processor complete
2013-05-13 09:25:22,227 INFO org.apache.hadoop.hbase.zookeeper.MiniZooKeeperCluster: Shutdown MiniZK cluster with all ZK servers
2013-05-13 09:25:23,012 INFO org.apache.hadoop.hbase.master.SplitLogManager$TimeoutMonitor: fakeDistnode,50705,1368408291524.splitLogManagerTimeoutMonitor exiting
2013-05-13 09:25:23,855 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:23,855 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:24,001 INFO org.apache.zookeeper.server.SessionTrackerImpl: SessionTrackerImpl exited loop!
2013-05-13 09:25:25,508 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:25,508 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:27,405 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:27,406 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:28,709 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:28,709 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:30,717 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:30,717 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:32,456 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:32,456 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:34,039 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:34,039 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:35,267 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:35,267 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:36,875 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:36,875 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:38,104 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:38,104 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:39,811 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:39,811 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:41,420 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:41,421 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:42,648 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:42,648 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:44,112 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:44,113 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:45,828 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:45,828 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:47,413 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:47,413 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:48,671 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:48,671 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:50,292 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:50,292 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:51,484 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:51,484 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:52,734 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:52,734 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:54,821 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:54,821 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:56,125 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:56,125 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:57,730 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:57,730 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:25:59,184 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:25:59,184 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:26:00,710 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:26:00,711 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:26:02,694 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:26:02,694 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:26:03,915 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:26:03,915 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:26:05,741 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:26:05,741 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 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:574)
 at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:350)
 at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1068)
2013-05-13 09:26:07,440 INFO org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (Unable to locate a login configuration)
2013-05-13 09:26:07,440 WARN org.apache.zookeeper.ClientCnxn: Session 0x13e9b7d74560001 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused

本文转载自csdn文章:org.apache.zookeeper.ClientCnxn: Opening socket connection to server localhost/127.0.0.1:218

为什么出现如下报错[localhost][demo-hello][2025-07-17 15:31:29.305][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Opening socket connection to server localhost/0:0:0:0:0:0:0:1:2181. Will not attempt to authenticate using SASL (unknown error) [localhost][demo-hello][2025-07-17 15:31:31.347][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Socket error occurred: localhost/0:0:0:0:0:0:0:1:2181: Connection refused: no further information [localhost][demo-hello][2025-07-17 15:31:32.449][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error) [localhost][demo-hello][2025-07-17 15:31:34.464][ INFO][24992][localhost:2181)][o.a.z.ClientCnxn ] : [] [] [] Socket error occurred: localhost/127.0.0.1:2181: Connection refused: no further information [localhost][demo-hello][2025-07-17 15:31:35.302][ERROR][24992][ main][o.a.c.ConnectionState ] : [] [] [] Connection timed out for connection string (localhost:2181) and timeout (5000) / elapsed (18644) org.apache.curator.CuratorConnectionLossException: KeeperErrorCode = ConnectionLoss at org.apache.curator.ConnectionState.checkTimeouts(ConnectionState.java:225) at org.apache.curator.ConnectionState.getZooKeeper(ConnectionState.java:94) at org.apache.curator.CuratorZookeeperClient.getZooKeeper(CuratorZookeeperClient.java:117) at org.apache.curator.framework.imps.CuratorFrameworkImpl.getZooKeeper(CuratorFrameworkImpl.java:489) at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:237) at org.apache.curator.framework.imps.ExistsBuilderImpl$3.call(ExistsBuilderImpl.java:226) at org.apache.curator.RetryLoop.callWithRetry(RetryLoop.java:109) at org.apache.curator.framework.imps.ExistsBuilderImpl.pathInForegroundStandard(ExistsBuilderImpl.java:223)
07-18
25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:java.library.path=/usr/local/hadoop/lib/native 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:java.io.tmpdir=/tmp 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:java.compiler=<NA> 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:os.name=Linux 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:os.arch=amd64 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:os.version=3.10.0-1160.el7.x86_64 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:user.name=root 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:user.home=/root 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Client environment:user.dir=/usr/local/hadoop/sbin 25/12/02 16:25:39 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=abc:2181,bcd:2181,cde:2181 sessionTimeout=5000 watcher=org.apache.hadoop.ha.ActiveStandbyElector$WatcherWithClientRef@478190fc 25/12/02 16:25:39 INFO zookeeper.ClientCnxn: Opening socket connection to server bcd/192.168.177.131:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:39 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) 25/12/02 16:25:39 INFO zookeeper.ClientCnxn: Opening socket connection to server abc/192.168.177.130:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:39 INFO zookeeper.ClientCnxn: Socket connection established to abc/192.168.177.130:2181, initiating session 25/12/02 16:25:39 INFO zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect 25/12/02 16:25:39 INFO zookeeper.ClientCnxn: Opening socket connection to server cde/192.168.177.132:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:39 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) 25/12/02 16:25:41 INFO zookeeper.ClientCnxn: Opening socket connection to server bcd/192.168.177.131:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:41 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) 25/12/02 16:25:42 INFO zookeeper.ClientCnxn: Opening socket connection to server abc/192.168.177.130:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:42 INFO zookeeper.ClientCnxn: Socket connection established to abc/192.168.177.130:2181, initiating session 25/12/02 16:25:42 INFO zookeeper.ClientCnxn: Unable to read additional data from server sessionid 0x0, likely server has closed socket, closing socket connection and attempting reconnect 25/12/02 16:25:43 INFO zookeeper.ClientCnxn: Opening socket connection to server cde/192.168.177.132:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:43 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect java.net.ConnectException: 拒绝连接 at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:715) at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361) at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081) 25/12/02 16:25:44 ERROR ha.ActiveStandbyElector: Connection timed out: couldn't connect to ZooKeeper in 5000 milliseconds 25/12/02 16:25:44 INFO zookeeper.ClientCnxn: Opening socket connection to server bcd/192.168.177.131:2181. Will not attempt to authenticate using SASL (unknown error) 25/12/02 16:25:44 INFO zookeeper.ZooKeeper: Session: 0x0 closed 25/12/02 16:25:44 FATAL ha.ZKFailoverController: Unable to start failover controller. Unable to connect to ZooKeeper quorum at abc:2181,bcd:2181,cde:2181. Please check the configured value for ha.zookeeper.quorum and ensure that ZooKeeper is running. 25/12/02 16:25:44 INFO zookeeper.ClientCnxn: EventThread shut down
最新发布
12-04
Hadoop 中 ZooKeeper 连接超时、拒绝连接,无法启动 ZKFailoverController 可能由多种原因导致,以下是一些常见的解决方案: ### 检查 ZooKeeper 服务状态 确保 ZooKeeper 服务正在运行,并且所有 ZooKeeper 节点都正常工作。可以使用以下命令检查 ZooKeeper 服务状态: ```bash zkServer.sh status ``` 如果 ZooKeeper 服务未启动,可以使用以下命令启动: ```bash zkServer.sh start ``` ### 检查网络连接 确保 Hadoop 节点与 ZooKeeper 节点之间的网络连接正常。可以使用 `ping` 命令测试网络连通性: ```bash ping <zookeeper_node_ip> ``` 同时,确保防火墙没有阻止 Hadoop 节点与 ZooKeeper 节点之间的通信。可以临时关闭防火墙进行测试: ```bash # 对于 CentOS 系统 systemctl stop firewalld # 对于 Ubuntu 系统 sudo ufw disable ``` ### 检查配置文件 确保 Hadoop 的配置文件(`core-site.xml`)中 ZooKeeper 的连接信息正确。配置示例如下: ```xml <property> <name>ha.zookeeper.quorum</name> <value>zk1:2181,zk2:2181,zk3:2181</value> </property> ``` 确保 `ha.zookeeper.quorum` 属性中的 ZooKeeper 节点地址和端口号正确。 ### 检查 ZooKeeper 节点状态 如果 ZooKeeper 集群中有节点出现故障,可能会导致连接超时或拒绝连接。可以使用 `zkCli.sh` 连接到 ZooKeeper 节点,检查节点状态: ```bash zkCli.sh -server <zookeeper_node_ip>:2181 ``` 在 ZooKeeper 客户端中,可以使用 `ls /` 命令查看 ZooKeeper 的根节点,确保节点正常工作。 ### 检查 ZooKeeper 节点资源 确保 ZooKeeper 节点有足够的资源(CPU、内存、磁盘空间)来处理 Hadoop 的请求。可以使用系统监控工具(如 `top`、`df -h`)检查节点资源使用情况。 ### 初始化 ZooKeeper 节点 如果 ZooKeeper 节点的数据目录损坏或丢失,可能会导致连接问题。可以尝试初始化 ZooKeeper 节点: ```bash hdfs zkfc -formatZK ``` ### 检查 ZooKeeper 版本兼容性 确保 Hadoop 和 ZooKeeper 的版本兼容。不同版本的 Hadoop 和 ZooKeeper 可能存在兼容性问题,建议使用官方推荐的版本组合。 ### 检查 ZKFailoverController 日志 查看 ZKFailoverController 的日志文件,获取更多详细的错误信息。日志文件通常位于 `$HADOOP_LOG_DIR` 目录下。根据日志中的错误信息,进一步排查问题。
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值