1. 程式人生 > >ZooKeeper單機偽集群搭建與啟動

ZooKeeper單機偽集群搭建與啟動

gdi cti logs 連接 變化 basic edi created source

下載解壓

[xiaobai@xiaobai ~]$ tar -zvxf zookeeper-3.4.9.tar.gz

本機ip地址映射

[xiaobai@xiaobai /]$ su - root
Password:
Last login: Sat Aug 4 18:59:38 EDT 2018 on :0

[root@xiaobai ~]# cd /etc

[root@xiaobai etc]# vim hosts

將本機ip映射為一個主機名,在zoo.cfg中可用這個主機名代替ip來配置:

添加一行:

172.20.10.60 xiaobai-rhel7

保存,退出,切換回普通用戶.

詳細配置

[xiaobai@xiaobai conf]$ cp zoo_sample.cfg zoo.cfg

[xiaobai@xiaobai 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的文件,編輯內容為該點對應的數字

環境變量

用戶主目錄下執行:

[xiaobai@xiaobai ~]$ 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

使配置生效:
[xiaobai@xiaobai ~]$ source .bash_profile

這個配置主要在真正集群環境每個點有意義,方便在任何目錄下直接使用ZooKeeper命令。在這裏反而引起了誤解:在偽集群的每個點應該使用全限定名或./xxx執行ZooKeeper命令(比如後面的啟動後查看狀態),否則生效的永遠是在這裏配置了路徑的那個點的。這裏僅作原理演示。

RHEL7防火墻設置

防火墻需要打開ZooKeeper集群中每個點所使用的端口,這裏一共是9個。RHEL7的默認防火墻工具有很大變化。這裏仍然使用6及以前的iptables方式,提示及切換效果如下:

[xiaobai@xiaobai ~]$ su - root
Password:
Last login: Sat Aug 4 19:39:17 EDT 2018 on pts/0

[root@xiaobai ~]# 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‘
[root@xiaobai ~]# systemctl enable iptables.service
[root@xiaobai ~]# service iptables start
Redirecting to /bin/systemctl start iptables.service
[root@xiaobai ~]# systemctl start iptables.service
[root@xiaobai ~]# vim /etc/sysconfig/iptables
[root@xiaobai ~]# service iptables restart
Redirecting to /bin/systemctl restart iptables.service
[root@xiaobai ~]# systemctl restart iptables.service
[root@xiaobai ~]# 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.
[root@xiaobai ~]# 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為不同的,防止端口沖突;修改每個點的dataDirdataLogDir配置,成該點對應的目錄

啟動每個點:

使用普通用戶,到該點目錄使用./xxx而不是默認環境變量配置的方式啟動:

[xiaobai@xiaobai bin]$ cd ../../zookeeper-3.4.9/bin
[xiaobai@xiaobai 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進程查看:

[xiaobai@xiaobai 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查看:

[xiaobai@xiaobai zookeeper-3.4.9_3]$ jps
10715 QuorumPeerMain
10672 QuorumPeerMain
10765 Jps
10643 QuorumPeerMain

其中QuorumPeerMain為每個點的ZooKeeper主進程

狀態監控

這裏使用ZooKeeper命令。因為前面環境變量配置中配置了其中一個點的路徑為ZOOKEEPER_HOME,所以這裏就不能直接使用命令,這樣永遠只看到這個配置的點的。需要到每個點路徑下使用./xxx這種相對路徑或者全限定名路徑:

其中的一個點:

[xiaobai@xiaobai bin]$ pwd
/home/xiaobai/zookeeper-3.4.9/bin
[xiaobai@xiaobai bin]$ cd ../../zookeeper-3.4.9_2/bin
[xiaobai@xiaobai 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文件)

[xiaobai@xiaobai bin]$ tail -100f zookeeper.out
2018-08-04 21:51:26,856 [myid:] - INFO [main:QuorumPeerConfig@124] - Reading configuration from: /home/xiaobai/zookeeper-3.4.9_3/bin/../conf/zoo.cfg
2018-08-04 21:51:26,879 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,879 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,880 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:51:26,880 [myid:] - INFO [main:QuorumPeerConfig@352] - Defaulting to majority quorums
2018-08-04 21:51:26,883 [myid:3] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2018-08-04 21:51:26,883 [myid:3] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2018-08-04 21:51:26,883 [myid:3] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2018-08-04 21:51:26,921 [myid:3] - INFO [main:QuorumPeerMain@127] - Starting quorum peer
2018-08-04 21:51:26,935 [myid:3] - INFO [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2183
2018-08-04 21:51:26,944 [myid:3] - INFO [main:QuorumPeer@1019] - tickTime set to 2000
2018-08-04 21:51:26,944 [myid:3] - INFO [main:QuorumPeer@1039] - minSessionTimeout set to -1
2018-08-04 21:51:26,944 [myid:3] - INFO [main:QuorumPeer@1050] - maxSessionTimeout set to -1
2018-08-04 21:51:26,944 [myid:3] - INFO [main:QuorumPeer@1065] - initLimit set to 10
2018-08-04 21:51:26,959 [myid:3] - INFO [main:QuorumPeer@533] - 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:QuorumPeer@548] - 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:QuorumCnxManager$Listener@534] - 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:QuorumPeer@774] - LOOKING
2018-08-04 21:51:26,979 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:FastLeaderElection@818] - New election. My id = 3, proposed zxid=0x0
2018-08-04 21:51:27,031 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection@600] - 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]:FastLeaderElection@600] - 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]:FastLeaderElection@600] - 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]:FastLeaderElection@600] - 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]:FastLeaderElection@600] - 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:QuorumPeer@844] - FOLLOWING
2018-08-04 21:51:27,089 [myid:3] - INFO [QuorumPeer[myid=3]/0:0:0:0:0:0:0:0:2183:Learner@86] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:ZooKeeperServer@173] - 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:Follower@61] - 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:QuorumPeer$QuorumServer@149] - 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:Learner@329] - 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:FileTxnSnapLog@240] - Snapshotting: 0x100000000 to /home/xiaobai/zookeeper-3.4.9_3/data/version-2/snapshot.100000000

Leader節點啟動日誌:

[xiaobai@xiaobai bin]$ tail -1000f zookeeper.out
2018-08-04 21:50:54,435 [myid:] - INFO [main:QuorumPeerConfig@124] - Reading configuration from: /home/xiaobai/zookeeper-3.4.9_2/bin/../conf/zoo.cfg
2018-08-04 21:50:54,452 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,452 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,453 [myid:] - INFO [main:QuorumPeer$QuorumServer@149] - Resolved hostname: xiaobai-rhel7 to address: xiaobai-rhel7/172.20.10.60
2018-08-04 21:50:54,453 [myid:] - INFO [main:QuorumPeerConfig@352] - Defaulting to majority quorums
2018-08-04 21:50:54,456 [myid:2] - INFO [main:DatadirCleanupManager@78] - autopurge.snapRetainCount set to 3
2018-08-04 21:50:54,456 [myid:2] - INFO [main:DatadirCleanupManager@79] - autopurge.purgeInterval set to 0
2018-08-04 21:50:54,456 [myid:2] - INFO [main:DatadirCleanupManager@101] - Purge task is not scheduled.
2018-08-04 21:50:54,469 [myid:2] - INFO [main:QuorumPeerMain@127] - Starting quorum peer
2018-08-04 21:50:54,493 [myid:2] - INFO [main:NIOServerCnxnFactory@89] - binding to port 0.0.0.0/0.0.0.0:2182
2018-08-04 21:50:54,500 [myid:2] - INFO [main:QuorumPeer@1019] - tickTime set to 2000
2018-08-04 21:50:54,500 [myid:2] - INFO [main:QuorumPeer@1039] - minSessionTimeout set to -1
2018-08-04 21:50:54,500 [myid:2] - INFO [main:QuorumPeer@1050] - maxSessionTimeout set to -1
2018-08-04 21:50:54,500 [myid:2] - INFO [main:QuorumPeer@1065] - initLimit set to 10
2018-08-04 21:50:54,520 [myid:2] - INFO [ListenerThread:QuorumCnxManager$Listener@534] - 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:QuorumPeer@774] - LOOKING
2018-08-04 21:50:54,533 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:FastLeaderElection@818] - New election. My id = 2, proposed zxid=0x0
2018-08-04 21:50:54,536 [myid:2] - WARN [WorkerSender[myid=2]:QuorumCnxManager@400] - 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]:QuorumPeer$QuorumServer@149] - 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]:QuorumCnxManager@400] - 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]:QuorumPeer$QuorumServer@149] - 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]:FastLeaderElection@600] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:QuorumCnxManager@400] - 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:QuorumPeer$QuorumServer@149] - 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:FastLeaderElection@852] - Notification time out: 12800
2018-08-04 21:51:08,911 [myid:2] - INFO [xiaobai-rhel7/172.20.10.60:5888:QuorumCnxManager$Listener@541] - 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]:FastLeaderElection@600] - 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:QuorumPeer@856] - LEADING
2018-08-04 21:51:09,142 [myid:2] - INFO [QuorumPeer[myid=2]/0:0:0:0:0:0:0:0:2182:Leader@59] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:Environment@100] - 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:ZooKeeperServer@173] - 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:Leader@361] - LEADING - LEADER ELECTION TOOK - 14650
2018-08-04 21:51:09,206 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:LearnerHandler@329] - Follower sid: 1 : info : org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer@94eefbf
2018-08-04 21:51:09,209 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:LearnerHandler@384] - 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:LearnerHandler@393] - leader and follower are in sync, zxid=0x0
2018-08-04 21:51:09,209 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:LearnerHandler@458] - Sending DIFF
2018-08-04 21:51:09,237 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46191:LearnerHandler@518] - 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:Leader@952] - 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:QuorumCnxManager$Listener@541] - Received connection request /172.20.10.60:35961
2018-08-04 21:51:27,083 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection@600] - 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:LearnerHandler@329] - Follower sid: 3 : info : org.apache.zookeeper.server.quorum.QuorumPeer$QuorumServer@64b36a83
2018-08-04 21:51:27,130 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:LearnerHandler@384] - 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:LearnerHandler@458] - Sending SNAP
2018-08-04 21:51:27,130 [myid:2] - INFO [LearnerHandler-/172.20.10.60:46194:LearnerHandler@482] - 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:LearnerHandler@518] - 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:NIOServerCnxnFactory@192] - 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:NIOServerCnxn@827] - Processing srvr command from /127.0.0.1:48578
2018-08-04 22:00:43,546 [myid:2] - INFO [Thread-3:NIOServerCnxn@1008] - Closed socket connection for client /127.0.0.1:48578 (no session established for client)

ZooKeeper單機偽集群搭建與啟動