cdh zookeeper 不断拒绝连接

测试hiveserver2高可用的时候,需要登录zookeeper检查hiveserver2是否在zookeeper中注册

执行

zookeeper-client

不断的拒绝连接

-- ::, [myid:] - INFO [main-SendThread(localhost:):ClientCnxn$SendThread@] - Opening socket connection to server localhost/::::::::. Will not attempt to authenticate using SASL (unknown error)
-- ::, [myid:] - WARN [main-SendThread(localhost:):ClientCnxn$SendThread@] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: 拒绝连接
at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method)
at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:)
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:)
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:)

解决

注释掉/etc/hosts如图所示的前2行

#127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
#:: localhost localhost.localdomain localhost6 localhost6.localdomain6
上一篇:Linux命令系列之 - 路径切换和查看cd - pwd - ls - find


下一篇:对MySQL性能影响较大的五类配置参数