问题:

Address family not supported by protocol family: connect

[html]  view plain  copy
  1. 15/05/09 10:44:22 INFO zookeeper.ZooKeeper: Initiating client connection, connectString=localhost:2000/storm sessionTimeout=20000 watcher=org.apache.curator.ConnectionState@612438f1  
  2. 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 (无法定位登录配置)  
  3. 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  
  4. 15/05/09 10:44:22 WARN zookeeper.ClientCnxn: Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect  
  5. java.net.SocketException: Address family not supported by protocol family: connect  
  6.     at sun.nio.ch.Net.connect(Native Method)  
  7.     at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:507)  
  8.     at org.apache.zookeeper.ClientCnxnSocketNIO.registerAndConnect(ClientCnxnSocketNIO.java:266)  
  9.     at org.apache.zookeeper.ClientCnxnSocketNIO.connect(ClientCnxnSocketNIO.java:276)  
  10.     at org.apache.zookeeper.ClientCnxn$SendThread.startConnect(ClientCnxn.java:958)  
  11.     at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:993)  
  12. 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 (无法定位登录配置)  
  13. 15/05/09 10:44:22 INFO zookeeper.ClientCnxn: Socket connection established to 127.0.0.1/127.0.0.1:2000, initiating session  
  14. 15/05/09 10:44:22 INFO server.NIOServerCnxnFactory: Accepted socket connection from /127.0.0.1:4923  
  15. 15/05/09 10:44:22 INFO server.ZooKeeperServer: Client attempting to establish new session at /127.0.0.1:4923  
  16. 15/05/09 10:44:22 INFO server.ZooKeeperServer: Established session 0x14d368f1954000b with negotiated timeout 20000 for client /127.0.0.1:4923  
  17. 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  
  18. 15/05/09 10:44:22 INFO state.ConnectionStateManager: State change: CONNECTED  
  19. 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。

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐