问题: Address family not supported by protocol family: connect [html] view plain copy 15/05/0910:44:22INFOzookeeper.ZooKeeper:Initiatingclientconnection, connectString = localhost :2000/storm sessionTimeout = 20000 watcher = org .apache
问题:
Address family not supported by protocol family: connect
- 15/05/09 10:44:22 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2000/storm sessionTimeout=20000 watcher=org.apache.curator.ConnectionState@612438f1
- 15/05/09 10:44:22 INFO zookeeper.ClientCnxn: Opening socket connection to server 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2000. Will not attempt to authenticate using SASL (无法定位登录配置)
- 15/05/09 10:44:22 ERROR zookeeper.ClientCnxnSocketNIO: Unable to open socket to 0:0:0:0:0:0:0:1/0:0:0:0:0:0:0:1:2000
- 15/05/09 10:44:22 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
- java.net.SocketException: Address family not supported by protocol family: connect
- at sun.nio.ch.Net.connect(Native Method)
- at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)
- at org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:266)
- at org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:276)
- at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:958)
- at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:993)
- 15/05/09 10:44:22 INFO zookeeper.ClientCnxn: Opening socket connection to server 127.0.0.1/127.0.0.1:2000. Will not attempt to authenticate using SASL (无法定位登录配置)
- 15/05/09 10:44:22 INFO zookeeper.ClientCnxn: Socket connection established to 127.0.0.1/127.0.0.1:2000, initiating session
- 15/05/09 10:44:22 INFO server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:4923
- 15/05/09 10:44:22 INFO server.ZooKeeperServer: Client attempting to establish new session at /127.0.0.1:4923
- 15/05/09 10:44:22 INFO server.ZooKeeperServer: Established session 0x14d368f1954000b with negotiated timeout 20000 for client /127.0.0.1:4923
- 15/05/09 10:44:22 INFO zookeeper.ClientCnxn: Session establishment complete on server 127.0.0.1/127.0.0.1:2000, sessionid = 0x14d368f1954000b, negotiated timeout = 20000
- 15/05/09 10:44:22 INFO state.ConnectionStateManager: State change: CONNECTED
- 15/05/09 10:44:22 WARN state.ConnectionStateManager: There are no ConnectionStateListeners registered.
原因:
Zookeeper无法连接localhost(127.0.0.1)。
解决方案:
修改本机C盘hosts文件,将127.0.0.1映射成localhost。