ZooKeeper单机伪集群搭建与启动
Posted free-wings
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ZooKeeper单机伪集群搭建与启动相关的知识,希望对你有一定的参考价值。
下载解压
[[email protected] ~]$ tar -zvxf zookeeper-3.4.9.tar.gz
本机ip地址映射
[[email protected] /]$ su - root
Password:
Last login: Sat Aug 4 18:59:38 EDT 2018 on :0
[[email protected] ~]# cd /etc
[[email protected] etc]# vim hosts
将本机ip映射为一个主机名,在zoo.cfg中可用这个主机名代替ip来配置:
添加一行:
172.20.10.60 xiaobai-rhel7
保存,退出,切换回普通用户.
详细配置
[[email protected] conf]$ cp zoo_sample.cfg zoo.cfg
[[email protected] conf]$ vim zoo.cfg
配置项值及含义:
tickTime=2000 心跳间隔(ms)
initLimit=10 集群初始化连接间隔最大心跳个数
syncLimit=5 集群Follower与Leader请求与应答间隔最大心跳个数
dataDir=/home/xiaobai/zookeeper-3.4.9/data 集群中该点数据存储目录
dataLogDir=/home/xiaobai/zookeeper-3.4.9/logs 集群中该点日志存储目录
clientPort=2181 客户端访问端口,如是伪集群,每个点该端口都应不同,否则会端口冲突,只能启动一个点,客户端根据多点不同端口进行配置(配置每个点的ip:端口)
集群server配置:
server.1=xiaobai-rhel7:2888:3888
server.2=xiaobai-rhel7:4888:5888
server.3=xiaobai-rhel7:6888:7888
集群中的点至少3个,伪集群要保证端口都不相同,否则端口冲突。与该点ip、端口匹配的的server.xxx...,server.后面的数字与该点配置的myid内容应相同
在每个点配置的data目录中创建名为myid的文件,编辑内容为该点对应的数字
环境变量
用户主目录下执行:
[[email protected] ~]$ vim .bash_profile
配置内容:
#zookeeper env
export ZOOKEEPER_HOME=/home/xiaobai/zookeeper-3.4.9
PATH=$ZOOKEEPER_HOME/bin:$PATH:$HOME/.local/bin:$HOME/bin
export PATH
注意第一行的变量ZOOKEEPER_HOME定义不要写成$ZOOKEEPER_HOME
使配置生效:
[[email protected] ~]$ source .bash_profile
这个配置主要在真正集群环境每个点有意义,方便在任何目录下直接使用ZooKeeper命令。在这里反而引起了误解:在伪集群的每个点应该使用全限定名或./xxx执行ZooKeeper命令(比如后面的启动后查看状态),否则生效的永远是在这里配置了路径的那个点的。这里仅作原理演示。
RHEL7防火墙设置
防火墙需要打开ZooKeeper集群中每个点所使用的端口,这里一共是9个。RHEL7的默认防火墙工具有很大变化。这里仍然使用6及以前的iptables方式,提示及切换效果如下:
[[email protected] ~]$ su - root
Password:
Last login: Sat Aug 4 19:39:17 EDT 2018 on pts/0
[[email protected] ~]# chkconfig iptables on
Note: Forwarding request to ‘systemctl enable iptables.service‘.
ln -s ‘/usr/lib/systemd/system/iptables.service‘ ‘/etc/systemd/system/basic.target.wants/iptables.service‘
[[email protected] ~]# systemctl enable iptables.service
[[email protected] ~]# service iptables start
Redirecting to /bin/systemctl start iptables.service
[[email protected] ~]# systemctl start iptables.service
[[email protected] ~]# vim /etc/sysconfig/iptables
[[email protected] ~]# service iptables restart
Redirecting to /bin/systemctl restart iptables.service
[[email protected] ~]# systemctl restart iptables.service
[[email protected] ~]# service iptables status
Redirecting to /bin/systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: active (exited) since Sat 2018-08-04 21:21:57 EDT; 17s ago
Process: 9208 ExecStop=/usr/libexec/iptables/iptables.init stop (code=exited, status=0/SUCCESS)
Process: 9259 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 9259 (code=exited, status=0/SUCCESS)
Aug 04 21:21:57 xiaobai.rhel7 systemd[1]: Starting IPv4 firewall with iptables...
Aug 04 21:21:57 xiaobai.rhel7 iptables.init[9259]: iptables: Applying firewall rules: [ OK ]
Aug 04 21:21:57 xiaobai.rhel7 systemd[1]: Started IPv4 firewall with iptables.
[[email protected] ~]# systemctl status iptables.service
iptables.service - IPv4 firewall with iptables
Loaded: loaded (/usr/lib/systemd/system/iptables.service; enabled)
Active: active (exited) since Sat 2018-08-04 21:21:57 EDT; 1min 32s ago
Process: 9208 ExecStop=/usr/libexec/iptables/iptables.init stop (code=exited, status=0/SUCCESS)
Process: 9259 ExecStart=/usr/libexec/iptables/iptables.init start (code=exited, status=0/SUCCESS)
Main PID: 9259 (code=exited, status=0/SUCCESS)
Aug 04 21:21:57 xiaobai.rhel7 systemd[1]: Starting IPv4 firewall with iptables...
Aug 04 21:21:57 xiaobai.rhel7 iptables.init[9259]: iptables: Applying firewall rules: [ OK ]
Aug 04 21:21:57 xiaobai.rhel7 systemd[1]: Started IPv4 firewall with iptables.
iptables文件最终配置内容(新增):
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2181 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2182 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2183 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 4888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 5888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 6888 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 7888 -j ACCEPT
集群启动
拷贝一个配置好的点的整个ZooKeeper目录,做出另外两个点。真正集群几个点的配置是完全相同的。这里的伪集群中,server集群配置不需要改动,所有点ip与端口都已配置好。只需修改每个点的clientPort为不同的,防止端口冲突;修改每个点的dataDir与dataLogDir配置,成该点对应的目录。
启动每个点:
使用普通用户,到该点目录使用./xxx而不是默认环境变量配置的方式启动:
[[email protected] bin]$ cd ../../zookeeper-3.4.9/bin
[[email protected] bin]$ ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /home/xiaobai/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
Java进程查看:
[[email protected] bin]$ ps -ef|grep java
xiaobai 10643 1 1 21:50 pts/0 00:00:00 java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/xiaobai/zookeeper-3.4.9_2/bin/../build/classes:/home/xiaobai/zookeeper-3.4.9_2/bin/../build/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/slf4j-api-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/netty-3.10.5.Final.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/log4j-1.2.16.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/jline-0.9.94.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../zookeeper-3.4.9.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../src/java/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/xiaobai/zookeeper-3.4.9_2/bin/../conf/zoo.cfg
xiaobai 10672 1 1 21:51 pts/0 00:00:00 java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/xiaobai/zookeeper-3.4.9/bin/../build/classes:/home/xiaobai/zookeeper-3.4.9/bin/../build/lib/*.jar:/home/xiaobai/zookeeper-3.4.9/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9/bin/../lib/slf4j-api-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9/bin/../lib/netty-3.10.5.Final.jar:/home/xiaobai/zookeeper-3.4.9/bin/../lib/log4j-1.2.16.jar:/home/xiaobai/zookeeper-3.4.9/bin/../lib/jline-0.9.94.jar:/home/xiaobai/zookeeper-3.4.9/bin/../zookeeper-3.4.9.jar:/home/xiaobai/zookeeper-3.4.9/bin/../src/java/lib/*.jar:/home/xiaobai/zookeeper-3.4.9/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/xiaobai/zookeeper-3.4.9/bin/../conf/zoo.cfg
xiaobai 10715 1 5 21:51 pts/0 00:00:00 java -Dzookeeper.log.dir=. -Dzookeeper.root.logger=INFO,CONSOLE -cp /home/xiaobai/zookeeper-3.4.9_3/bin/../build/classes:/home/xiaobai/zookeeper-3.4.9_3/bin/../build/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/slf4j-api-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/netty-3.10.5.Final.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/log4j-1.2.16.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/jline-0.9.94.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../zookeeper-3.4.9.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../src/java/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../conf: -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false org.apache.zookeeper.server.quorum.QuorumPeerMain /home/xiaobai/zookeeper-3.4.9_3/bin/../conf/zoo.cfg
xiaobai 10755 9691 0 21:51 pts/0 00:00:00 grep --color=auto java
jps查看:
[[email protected] zookeeper-3.4.9_3]$ jps
10715 QuorumPeerMain
10672 QuorumPeerMain
10765 Jps
10643 QuorumPeerMain
其中QuorumPeerMain为每个点的ZooKeeper主进程
状态监控
这里使用ZooKeeper命令。因为前面环境变量配置中配置了其中一个点的路径为ZOOKEEPER_HOME,所以这里就不能直接使用命令,这样永远只看到这个配置的点的。需要到每个点路径下使用./xxx这种相对路径或者全限定名路径:
其中的一个点:
[[email protected] bin]$ pwd
/home/xiaobai/zookeeper-3.4.9/bin
[[email protected] bin]$ cd ../../zookeeper-3.4.9_2/bin
[[email protected] bin]$ ./zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /home/xiaobai/zookeeper-3.4.9_2/bin/../conf/zoo.cfg
Mode: leader
客户端访问
日志监控
启动日志:(其中一个点bin目录下的zookeeper.out文件)
[[email protected] bin]$ tail -100f zookeeper.out
2018-08-04 21:51:26,856 [myid:] - INFO [main:[email protected]] - Reading configuration from: /home/xiaobai/zookeeper-3.4.9_3/bin/../conf/zoo.cfg
2018-08-04 21:51:26,879 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,879 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,880 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,880 [myid:] - INFO [main:[email protected]] - Defaulting to majority quorums
2018-08-04 21:51:26,883 [myid:3] - INFO [main:[email protected]] - autopurge.snapRetainCount set to 3
2018-08-04 21:51:26,883 [myid:3] - INFO [main:[email protected]] - autopurge.purgeInterval set to 0
2018-08-04 21:51:26,883 [myid:3] - INFO [main:[email protected]] - Purge task is not scheduled.
2018-08-04 21:51:26,921 [myid:3] - INFO [main:[email protected]] - Starting quorum peer
2018-08-04 21:51:26,935 [myid:3] - INFO [main:[email protected]] - binding to port 0.0.0.0/0.0.0.0:2183
2018-08-04 21:51:26,944 [myid:3] - INFO [main:[email protected]] - tickTime set to 2000
2018-08-04 21:51:26,944 [myid:3] - INFO [main:[email protected]] - minSessionTimeout set to -1
2018-08-04 21:51:26,944 [myid:3] - INFO [main:[email protected]] - maxSessionTimeout set to -1
2018-08-04 21:51:26,944 [myid:3] - INFO [main:[email protected]] - initLimit set to 10
2018-08-04 21:51:26,959 [myid:3] - INFO [main:[email protected]] - currentEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2018-08-04 21:51:26,961 [myid:3] - INFO [main:[email protected]] - acceptedEpoch not found! Creating with a reasonable default of 0. This should only happen when you are upgrading your installation
2018-08-04 21:51:26,972 [myid:3] - INFO [ListenerThread:[email protected]] - My election bind port: xiaobai-rhel7/172.20.10.60:7888
2018-08-04 21:51:26,978 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - LOOKING
2018-08-04 21:51:26,979 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - New election. My id = 3, proposed zxid=0x0
2018-08-04 21:51:27,031 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 1 (message format version), 3 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 3 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:27,082 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 2 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:27,082 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:27,082 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), FOLLOWING (n.state), 1 (n.sid), 0x1 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:27,083 [myid:3] - INFO [WorkerReceiver[myid=3]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LEADING (n.state), 2 (n.sid), 0x1 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:27,084 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - FOLLOWING
2018-08-04 21:51:27,089 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - TCP NoDelay set to: true
2018-08-04 21:51:27,117 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2018-08-04 21:51:27,118 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:host.name=<NA>
2018-08-04 21:51:27,118 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.version=1.7.0_51
2018-08-04 21:51:27,118 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.vendor=Oracle Corporation
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51-2.4.5.5.el7.x86_64/jre
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.class.path=/home/xiaobai/zookeeper-3.4.9_3/bin/../build/classes:/home/xiaobai/zookeeper-3.4.9_3/bin/../build/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/slf4j-api-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/netty-3.10.5.Final.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/log4j-1.2.16.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../lib/jline-0.9.94.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../zookeeper-3.4.9.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../src/java/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_3/bin/../conf:
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.io.tmpdir=/tmp
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:java.compiler=<NA>
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:os.name=Linux
2018-08-04 21:51:27,119 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:os.arch=amd64
2018-08-04 21:51:27,120 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:os.version=3.10.0-123.el7.x86_64
2018-08-04 21:51:27,120 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]00] - Server environment:user.name=xiaobai
2018-08-04 21:51:27,120 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:user.home=/home/xiaobai
2018-08-04 21:51:27,120 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Server environment:user.dir=/home/xiaobai/zookeeper-3.4.9_3/bin
2018-08-04 21:51:27,122 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /home/xiaobai/zookeeper-3.4.9_3/logs/version-2 snapdir /home/xiaobai/zookeeper-3.4.9_3/data/version-2
2018-08-04 21:51:27,123 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - FOLLOWING - LEADER ELECTION TOOK - 144
2018-08-04 21:51:27,125 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:27,132 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Getting a snapshot from leader
2018-08-04 21:51:27,141 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:[email protected]] - Snapshotting: 0x100000000 to /home/xiaobai/zookeeper-3.4.9_3/data/version-2/snapshot.100000000
Leader节点启动日志:
[[email protected] bin]$ tail -1000f zookeeper.out
2018-08-04 21:50:54,435 [myid:] - INFO [main:[email protected]] - Reading configuration from: /home/xiaobai/zookeeper-3.4.9_2/bin/../conf/zoo.cfg
2018-08-04 21:50:54,452 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,452 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,453 [myid:] - INFO [main:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,453 [myid:] - INFO [main:[email protected]] - Defaulting to majority quorums
2018-08-04 21:50:54,456 [myid:2] - INFO [main:[email protected]] - autopurge.snapRetainCount set to 3
2018-08-04 21:50:54,456 [myid:2] - INFO [main:[email protected]] - autopurge.purgeInterval set to 0
2018-08-04 21:50:54,456 [myid:2] - INFO [main:[email protected]] - Purge task is not scheduled.
2018-08-04 21:50:54,469 [myid:2] - INFO [main:[email protected]] - Starting quorum peer
2018-08-04 21:50:54,493 [myid:2] - INFO [main:[email protected]] - binding to port 0.0.0.0/0.0.0.0:2182
2018-08-04 21:50:54,500 [myid:2] - INFO [main:[email protected]] - tickTime set to 2000
2018-08-04 21:50:54,500 [myid:2] - INFO [main:[email protected]] - minSessionTimeout set to -1
2018-08-04 21:50:54,500 [myid:2] - INFO [main:[email protected]] - maxSessionTimeout set to -1
2018-08-04 21:50:54,500 [myid:2] - INFO [main:[email protected]] - initLimit set to 10
2018-08-04 21:50:54,520 [myid:2] - INFO [ListenerThread:[email protected]] - My election bind port: xiaobai-rhel7/172.20.10.60:5888
2018-08-04 21:50:54,530 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - LOOKING
2018-08-04 21:50:54,533 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - New election. My id = 2, proposed zxid=0x0
2018-08-04 21:50:54,536 [myid:2] - WARN [WorkerSender[myid=2]:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:354)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:452)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:433)
at java.lang.Thread.run(Thread.java:744)
2018-08-04 21:50:54,537 [myid:2] - INFO [WorkerSender[myid=2]:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,538 [myid:2] - WARN [WorkerSender[myid=2]:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.toSend(QuorumCnxManager.java:354)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.process(FastLeaderElection.java:452)
at org.apache.zookeeper.server.quorum.FastLeaderElection$Messenger$WorkerSender.run(FastLeaderElection.java:433)
at java.lang.Thread.run(Thread.java:744)
2018-08-04 21:50:54,539 [myid:2] - INFO [WorkerSender[myid=2]:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,539 [myid:2] - INFO [WorkerReceiver[myid=2]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 2 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:50:54,741 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:54,742 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,742 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:54,743 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,743 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 400
2018-08-04 21:50:55,144 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:55,144 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:55,145 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:55,145 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:55,145 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 800
2018-08-04 21:50:55,946 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:55,956 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:55,956 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:55,957 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:55,957 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 1600
2018-08-04 21:50:57,558 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:57,559 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:57,559 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:50:57,560 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:57,560 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 3200
2018-08-04 21:51:00,761 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:51:00,761 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:00,762 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:51:00,762 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:00,762 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 6400
2018-08-04 21:51:07,163 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 1 at election address xiaobai-rhel7/172.20.10.60:3888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:51:07,163 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:07,164 [myid:2] - WARN [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Cannot open channel to 3 at election address xiaobai-rhel7/172.20.10.60:7888
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:579)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:381)
at org.apache.zookeeper.server.quorum.QuorumCnxManager.connectAll(QuorumCnxManager.java:426)
at org.apache.zookeeper.server.quorum.FastLeaderElection.lookForLeader(FastLeaderElection.java:843)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:822)
2018-08-04 21:51:07,164 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:07,164 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Notification time out: 12800
2018-08-04 21:51:08,911 [myid:2] - INFO [xiaobai-rhel7/172.20.10.60:5888:[email protected]] - Received connection request /172.20.10.60:35955
2018-08-04 21:51:08,921 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection@600] - Notification: 1 (message format version), 1 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:08,934 [myid:2] - INFO [WorkerReceiver[myid=2]:[email protected]] - Notification: 1 (message format version), 2 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 1 (n.sid), 0x0 (n.peerEpoch) LOOKING (my state)
2018-08-04 21:51:09,138 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - LEADING
2018-08-04 21:51:09,142 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - TCP NoDelay set to: true
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:zookeeper.version=3.4.9-1757313, built on 08/23/2016 06:50 GMT
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:host.name=<NA>
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.version=1.7.0_51
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.vendor=Oracle Corporation
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.51-2.4.5.5.el7.x86_64/jre
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.class.path=/home/xiaobai/zookeeper-3.4.9_2/bin/../build/classes:/home/xiaobai/zookeeper-3.4.9_2/bin/../build/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/slf4j-log4j12-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/slf4j-api-1.6.1.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/netty-3.10.5.Final.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/log4j-1.2.16.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../lib/jline-0.9.94.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../zookeeper-3.4.9.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../src/java/lib/*.jar:/home/xiaobai/zookeeper-3.4.9_2/bin/../conf:
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.library.path=/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.io.tmpdir=/tmp
2018-08-04 21:51:09,179 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:java.compiler=<NA>
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:os.name=Linux
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:os.arch=amd64
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:os.version=3.10.0-123.el7.x86_64
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:user.name=xiaobai
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:user.home=/home/xiaobai
2018-08-04 21:51:09,180 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Server environment:user.dir=/home/xiaobai/zookeeper-3.4.9_2/bin
2018-08-04 21:51:09,182 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 datadir /home/xiaobai/zookeeper-3.4.9_2/logs/version-2 snapdir /home/xiaobai/zookeeper-3.4.9_2/data/version-2
2018-08-04 21:51:09,183 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - LEADING - LEADER ELECTION TOOK - 14650
2018-08-04 21:51:09,206 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:[email protected]] - Follower sid: 1 : info : [email protected]bf
2018-08-04 21:51:09,209 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:[email protected]] - Synchronizing with Follower sid: 1 maxCommittedLog=0x0 minCommittedLog=0x0 peerLastZxid=0x0
2018-08-04 21:51:09,209 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:[email protected]] - leader and follower are in sync, zxid=0x0
2018-08-04 21:51:09,209 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:[email protected]] - Sending DIFF
2018-08-04 21:51:09,237 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:[email protected]] - Received NEWLEADER-ACK message from 1
2018-08-04 21:51:09,238 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:[email protected]] - Have quorum of supporters, sids: [ 1,2 ]; starting up and setting last processed zxid: 0x100000000
2018-08-04 21:51:27,019 [myid:2] - INFO [xiaobai-rhel7/172.20.10.60:5888:[email protected]] - Received connection request /172.20.10.60:35961
2018-08-04 21:51:27,083 [myid:2] - INFO [WorkerReceiver[myid=2]:[email protected]] - Notification: 1 (message format version), 3 (n.leader), 0x0 (n.zxid), 0x1 (n.round), LOOKING (n.state), 3 (n.sid), 0x0 (n.peerEpoch) LEADING (my state)
2018-08-04 21:51:27,129 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:[email protected]] - Follower sid: 3 : info : [email protected]a83
2018-08-04 21:51:27,130 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:[email protected]] - Synchronizing with Follower sid: 3 maxCommittedLog=0x0 minCommittedLog=0x0 peerLastZxid=0x0
2018-08-04 21:51:27,130 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:[email protected]] - Sending SNAP
2018-08-04 21:51:27,130 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:[email protected]] - Sending snapshot last zxid of peer is 0x0 zxid of leader is 0x100000000sent zxid of db as 0x100000000
2018-08-04 21:51:27,144 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:[email protected]] - Received NEWLEADER-ACK message from 3
2018-08-04 22:00:43,539 [myid:2] - INFO [NioserverCxn.Factory:0.0.0.0/0.0.0.0:2182:[email protected]] - Accepted socket connection from /127.0.0.1:48578
2018-08-04 22:00:43,543 [myid:2] - INFO [NIOServerCxn.Factory:0.0.0.0/0.0.0.0:2182:[email protected]] - Processing srvr command from /127.0.0.1:48578
2018-08-04 22:00:43,546 [myid:2] - INFO [Thread-3:[email protected]] - Closed socket connection for client /127.0.0.1:48578 (no session established for client)
以上是关于ZooKeeper单机伪集群搭建与启动的主要内容,如果未能解决你的问题,请参考以下文章