【Java】zookeeper集群报错

zookeeper集群其中一个节点报错:【Have smaller server identifier, so dropping the connection: (2, 1)】
原始配置:
zoo.cfg:

clientPort=2181
dataDir=/server/zookeeper
dataLogDir=/server/zookeeper
syncLimit=2
ticketTime=2000
initLimit=5
dynamicConfigFile=/usr/local/zookeeper-3.5.0/bin/../conf/zoo.cfg.dynamic

zoo.cfg.dynamic:

server.1=10.173.165.51:2888:3888:participant
server.2=10.173.166.217:2888:3888:participant
server.3=10.173.163.238:2888:3888:participant
version=100000000

响应的pid和目录,以及配置的空格都检测了一遍,重启等等,zkServer.sh start后,zookeeper.out日志就报错:【Have smaller server identifier, so dropping the connection: (2, 1)】,而集群其他两台相同配置的启动成功后,使用脚本监测:

jps
25717 QuorumPeerMain
25822 Jps

echo mntr | nc 127.0.0.1 2181

zk_version 3.5.0-alpha-1615249, built on 08/01/2014 22:13 GMT
zk_avg_latency 1
zk_max_latency 5
zk_min_latency 0
zk_packets_received 7
zk_packets_sent 6
zk_num_alive_connections 1
zk_outstanding_requests 0
zk_server_state follower
zk_znode_count 20
zk_watch_count 0
zk_ephemerals_count 0
zk_approximate_data_size 1449
zk_open_file_descriptor_count 42
zk_max_file_descriptor_count 65535

./zkCli.sh -server localhost:2181

Connecting to localhost:2181
2016-10-09 00:58:07,932 [myid:] - INFO [main:[email protected]] - Client environment:zookeeper.version=3.5.0-alpha-1615249, built on 08/01/2014 22:13 GMT
2016-10-09 00:58:07,936 [myid:] - INFO [main:[email protected]] - Client environment:host.name=iZ23nhyj1upZ
2016-10-09 00:58:07,936 [myid:] - INFO [main:[email protected]] - Client environment:java.version=1.8.0_40
2016-10-09 00:58:07,938 [myid:] - INFO [main:[email protected]] - Client environment:java.vendor=Oracle Corporation
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:java.home=/usr/lib/jvm/jdk1.8.0_40/jre
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:java.class.path=/usr/local/zookeeper-3.5.0/bin/../build/classes:/usr/local/zookeeper-3.5.0/bin/../build/lib/.jar:/usr/local/zookeeper-3.5.0/bin/../lib/slf4j-log4j12-1.7.5.jar:/usr/local/zookeeper-3.5.0/bin/../lib/slf4j-api-1.7.5.jar:/usr/local/zookeeper-3.5.0/bin/../lib/servlet-api-2.5-20081211.jar:/usr/local/zookeeper-3.5.0/bin/../lib/netty-3.7.0.Final.jar:/usr/local/zookeeper-3.5.0/bin/../lib/log4j-1.2.16.jar:/usr/local/zookeeper-3.5.0/bin/../lib/jline-2.11.jar:/usr/local/zookeeper-3.5.0/bin/../lib/jetty-util-6.1.26.jar:/usr/local/zookeeper-3.5.0/bin/../lib/jetty-6.1.26.jar:/usr/local/zookeeper-3.5.0/bin/../lib/javacc.jar:/usr/local/zookeeper-3.5.0/bin/../lib/jackson-mapper-asl-1.9.11.jar:/usr/local/zookeeper-3.5.0/bin/../lib/jackson-core-asl-1.9.11.jar:/usr/local/zookeeper-3.5.0/bin/../lib/commons-cli-1.2.jar:/usr/local/zookeeper-3.5.0/bin/../zookeeper-3.5.0-alpha.jar:/usr/local/zookeeper-3.5.0/bin/../src/java/lib/.jar:/usr/local/zookeeper-3.5.0/bin/../conf:.:/usr/lib/jvm/jdk1.8.0_40/lib:/usr/lib/jvm/jdk1.8.0_40/jre/lib
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:java.io.tmpdir=/tmp
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:java.compiler=<NA>
2016-10-09 00:58:07,939 [myid:] - INFO [main:[email protected]] - Client environment:os.name=Linux
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:os.arch=amd64
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:os.version=3.2.0-4-amd64
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:user.name=root
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:user.home=/root
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:user.dir=/usr/local/zookeeper-3.5.0/bin
2016-10-09 00:58:07,940 [myid:] - INFO [main:[email protected]] - Client environment:os.memory.free=233MB
2016-10-09 00:58:07,942 [myid:] - INFO [main:[email protected]] - Client environment:os.memory.max=241MB
2016-10-09 00:58:07,943 [myid:] - INFO [main:[email protected]] - Client environment:os.memory.total=241MB
2016-10-09 00:58:07,943 [myid:] - INFO [main:[email protected]] - Initiating client connection, connectString=localhost:2181 sessionTimeout=30000 [email protected]
Welcome to ZooKeeper!
2016-10-09 00:58:07,974 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Opening socket connection to server localhost/127.0.1.1:2181. Will not attempt to authenticate using SASL (unknown error)
JLine support is enabled
2016-10-09 00:58:08,048 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Socket connection established to localhost/127.0.1.1:2181, initiating session
2016-10-09 00:58:08,059 [myid:] - INFO [main-SendThread(localhost:2181):[email protected]] - Session establishment complete on server localhost/127.0.1.1:2181, sessionid = 0x257a5389d5e0001, negotiated timeout = 30000

WATCHER::

WatchedEvent state:SyncConnected type:None path:null

这三个命令都是正常的,但是有问题的那一台发现端口这些都没有启动成功,(启动后出现对外通讯的端口正常,集群内部端口2888这一个没有成功,但是也没有其他占用),google了很久一直没有找到问题,这个是生产环境的集群,只有想办法恢复,求帮忙~

补充报错的更多信息如图【Java】zookeeper集群报错

回答

按照集群配置内的PID 顺序 从小到大依次启动

以上是 【Java】zookeeper集群报错 的全部内容, 来源链接: utcz.com/a/91024.html

回到顶部