1、zookeeper配置完毕之候报错,信息如下:
-
grid@master1:~$ zkCli.sh -server 10.10.10.70:2181
-
..............................
-
2015-08-21 06:29:48,412 [myid:] - INFO [main-SendThread(10.10.10.70:2181):ClientCnxn$SendThread@975] - Opening socket connection to server 10.10.10.70/10.10.10.70:2181. Will not attempt to authenticate using SASL (unknown error)
-
Welcome to
-
2015-08-21 06:29:48,420 [myid:] - WARN [main-SendThread(10.10.10.70:2181):ClientCnxn$SendThread@1102] - 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:739)
-
at org.apache.zookeeper.ClientCnxnSocketNIO.doTransport(ClientCnxnSocketNIO.java:361)
-
at org.apache.zookeeper.ClientCnxn$SendThread.run(ClientCnxn.java:1081)
这是连接zookeeper的server一直不断的报错
2、查看zookeeper配置信息
-
grid@master1:/usr/local/zookeeper/conf$ cat zoo.cfg
-
# The number of milliseconds of each tick
-
tickTime=2000
-
# The number of ticks that the initial
-
# synchronization phase can take
-
initLimit=10
-
# The number of ticks that can pass between
-
# sending a request and getting an acknowledgement
-
syncLimit=5
-
# the directory where the snapshot is stored.
-
# do not use /tmp for storage, /tmp here is just
-
# example sakes.
-
dataDir=/data/zk
-
dataLogDir=/data/zk/logs
-
# the port at which the clients will connect
-
clientPort=2181
-
# the maximum number of client connections.
-
# increase this if you need to handle more clients
-
#maxClientCnxns=60
-
#
-
# Be sure to read the maintenance section of the
-
# administrator guide before turning on autopurge.
-
#
-
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
-
#
-
# The number of snapshots to retain in dataDir
-
#autopurge.snapRetainCount=3
-
# Purge task interval in hours
-
# Set to "0" to disable auto purge feature
-
#autopurge.purgeInterval=1
-
-
server.70=10.10.10.70:2888:3888
-
server.71=10.10.10.71:2888:3888
-
server.72=10.10.10.72:2888:3888
-
server.73=10.10.10.73:2888:3888
2、在每个服务器上更改myid文件,如10.10.10.70文件
之候启动zookeeper,服务正常
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12219480/viewspace-1778740/
,如需转载,请注明出处,否则将追究法律责任。