zookeeper最常见的错误:防火墙没关

今天敲商城的时候,启动tomcat然后就报了这个错误,最后发现是因为Linux的防火墙没有关闭导致的

2017-11-13 09:26:45,448 [localhost-startStop-1] [org.apache.zookeeper.ClientCnxn]-[DEBUG] zookeeper.disableAutoWatchReset is false
2017-11-13 09:26:45,542 [localhost-startStop-1] [org.I0Itec.zkclient.ZkClient]-[DEBUG] Awaiting connection to Zookeeper server
2017-11-13 09:26:45,542 [localhost-startStop-1] [org.I0Itec.zkclient.ZkClient]-[DEBUG] Waiting for keeper state SyncConnected
2017-11-13 09:26:45,568 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxn]-[INFO] Opening socket connection to server 192.168.25.128/192.168.25.128:2181. Will not attempt to authenticate using SASL (unknown error)
2017-11-13 09:27:06,571 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxn]-[WARN] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection timed out: no further information
    at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
    at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717)
    at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1141)
2017-11-13 09:27:06,668 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxnSocketNIO]-[DEBUG] Ignoring exception during shutdown input
java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.shutdownInput(SocketChannelImpl.java:780)
    at sun.nio.ch.SocketAdaptor.shutdownInput(SocketAdaptor.java:399)
    at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:200)
    at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1246)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1170)
2017-11-13 09:27:06,668 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxnSocketNIO]-[DEBUG] Ignoring exception during shutdown output
java.nio.channels.ClosedChannelException
    at sun.nio.ch.SocketChannelImpl.shutdownOutput(SocketChannelImpl.java:797)
    at sun.nio.ch.SocketAdaptor.shutdownOutput(SocketAdaptor.java:407)
    at org.apache.zookeeper.ClientCnxnSocketNIO.cleanup(ClientCnxnSocketNIO.java:207)
    at org.apache.zookeeper.ClientCnxn$SendThread.cleanup(ClientCnxn.java:1246)
    at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1170)
2017-11-13 09:27:07,775 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxn]-[INFO] Opening socket connection to server 192.168.25.128/192.168.25.128:2181. Will not attempt to authenticate using SASL (unknown error)
2017-11-13 09:27:28,778 [localhost-startStop-1-SendThread(192.168.25.128:2181)] [org.apache.zookeeper.ClientCnxn]-[WARN] Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

解决方案:关闭防火墙

这里写图片描述

几条关于防火墙的命令:

1.查看状态:firewall-cmd -state
开启状态:running
关闭状态:not running
2.关闭防火墙:systemctl stop firewalld.service
3.开机不启动防火墙:systemctl disable firewalld.service

之前查到的一些资料都是使用service而不是systemctl,其实也就是systemctl是新的指令,它融合之前service和chkconfig的功能于一体,更加强大,有兴趣的同学可以单独的查一些资料

  • 3
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 31
    评论
评论 31
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值