1. 程式人生 > >安裝zookeeper出現java.net.NoRouteToHostException: 沒有到主機的路由

安裝zookeeper出現java.net.NoRouteToHostException: 沒有到主機的路由

java.net.NoRouteToHostException: 沒有到主機的路由 (Host unreachable)
	at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:400)
	at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:243)
	at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:225)
	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:402)
	at java.base/java.net.Socket.connect(Socket.java:591)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:558)
	at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:610)
	at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:845)
	at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:957)
2018-04-04 09:15:37,452 [myid:1] - INFO  [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:
[email protected]
] - Resolved hostname: 192.168.248.129 to address: /192.168.248.129 2018-04-04 09:15:37,453 [myid:1] - INFO [QuorumPeer[myid=1]/0:0:0:0:0:0:0:0:2181:[email protected]]

原因:防火牆沒有關閉:

CentOS7 禁用防火牆
[[email protected] ~]# systemctl stop firewalld.service
[[email protected] ~]#systemctl disable firewalld.service
[
[email protected]
~]#systemctl status firewalld.service (檢視關閉狀態)