Zookeeper启动报错

我在三台机器上部署了zookeeper,启动的时候报错了,部署步骤如下:
1、在conf目录下创建 zoo.cfg
 
tickTime=2000
dataDir=/usr/local/zookeeper/data 
dataLogDir=/usr/local/zookeeper/dataLog
clientPort=2181
initLimit=5
syncLimit=2
server.1=liullei-1:2888:3888
server.2=liulei-2:2888:3888
server.3=liulei-3:2888:3888
 
 复制这个文件到另外两台机器的conf目录下
3、修改主机liulei-1中的zoo.cfg中的两个配置:
peerType=observer
server.1:localhost:2181:3181:observer
4、在每一台机器的dataDir=/usr/local/zookeeper/data  下新建一个文件myid,内容分别为:1、2、3
 
 
 
报错如下:2016-03-09 14:35:58,580 [myid:] - INFO [main-SendThread(118.127.0.0:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 118.127.0.0/118.127.0.0:2181. Will not attempt to authenticate using SASL (unknown error)
2016-03-09 14:36:13,594 [myid:] - WARN [main-SendThread(118.127.0.0:2181):ClientCnxn$SendThread@1108] - Client session timed out, have not heard from server in 15014ms for sessionid 0x0
2016-03-09 14:36:13,595 [myid:] - INFO [main-SendThread(118.127.0.0:2181):ClientCnxn$SendThread@1156] - Client session timed out, have not heard from server in 15014ms for sessionid 0x0, closing socket connection and attempting reconnect
2016-03-09 14:36:14,695 [myid:] - INFO [main-SendThread(localhost:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server localhost/127.0.0.1:2181. Will not attempt to authenticate using SASL (unknown error)
2016-03-09 14:36:14,696 [myid:] - WARN [main-SendThread(localhost:2181):ClientCnxn$SendThread@1162] - Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect
java.net.ConnectException: Connection refused
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)
2016-03-09 14:36:14,797 [myid:] - INFO [main-SendThread(118.127.0.0:2181):ClientCnxn$SendThread@1032] - Opening socket connection to server 118.127.0.0/118.127.0.0:2181. Will not attempt to authenticate using SASL (unknown error)

wangxiaolei

赞同来自:

为什么会出现 118.127.0.0 看下hosts文件是不是有问题啊

要回复问题请先登录注册