安装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:QuorumPeer$QuorumServer@184] - 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:FastLeaderElection@854] 

原因:防火墙没有关闭:

CentOS7 禁用防火墙
[root@centos06 ~]# systemctl stop firewalld.service
[root@centos06 ~]#systemctl disable firewalld.service
[root@centos06 ~]#systemctl status firewalld.service (查看关闭状态)

你可能感兴趣的:(安装zookeeper出现java.net.NoRouteToHostException: 没有到主机的路由)