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为不同的,防止端口冲突;修改每个点的dataDirdataLogDir配置,成该点对应的目录

启动每个点:

使用普通用户,到该点目录使用./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]] - 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)

原文地址:https://www.cnblogs.com/free-wings/p/9424871.html

时间: 2024-10-01 07:41:25

ZooKeeper单机伪集群搭建与启动的相关文章

备忘zookeeper(单机+伪集群+集群)

#下载: #单机模式 解压到合适目录. 进入zookeeper目录下的conf子目录, 复制zoo_sample.cfg-->zoo.cfg(如果没有data和logs就新建):tickTime=2000 dataDir=/Users/apple/zookeeper/data dataLogDir=/Users/apple/zookeeper/logs clientPort=2180 参数说明:tickTime: zookeeper中使用的基本时间单位, 毫秒值.dataDir: 数据目录. 可

容器互联,单机伪集群搭建

1.集群示意图 2.从docker hub上获取响应的镜像 docker pull redis docker pull django docker pull haproxy docker pull ubuntu 3.应用栈的启动顺序 启动redis-master容器节点 两个redis-salve容器节点连接到redis-master节点上 两 app节点启动时要连接到redis-master节点上 Hapoxy节点要连接到两个app节点上 综上所述启动顺序为: redis-master----

centos7环境下zookeeper的搭建步骤之单机伪集群

首先说明:这里是单机版的伪集群搭建 第一步:下载zookeeper:zookeeper的下载地址: http://mirror.bit.edu.cn/apache/zookeeper/ 第二步:安装:将下载的zookeeper上传到linux系统中,使用命令解压 tar -zxvf zookeeper-3.4.10.tar.gz 查看解压的文件: ls 进入zookeeper-3.4.10/conf/目录下: cd zookeeper-3.4.10/conf/ 在/zookeeper-3.4.1

[dubbo实战] dubbo+zookeeper伪集群搭建

zookeeper作为注册中心,服务器和客户端都要访问,如果有大量的并发,肯定会有等待.所以可以通过zookeeper集群解决. 一.为什么需要zookeeper呢? 大部分分布式应用需要一个主控.协调器或者控制器来管理物理分布的子进程.目前,大多数都要开发私有的协调程序,缺乏一个通用机制,协调程序的反复编写浪费,且难以形成通用.伸缩性好的协调器,zookeeper提供通用的分布式锁服务,用以协调分布式应用.所以说zookeeper是分布式应用的协作服务. 二.zookeeper的工作原理 核心

zookeeper安装和配置(单机+伪集群+集群)

#单机模式 解压到合适目录. 进入zookeeper目录下的conf子目录, 复制zoo_sample.cfg-->zoo.cfg(如果没有data和logs就新建):tickTime=2000 dataDir=/Users/apple/zookeeper/data dataLogDir=/Users/apple/zookeeper/logs clientPort=2180 参数说明:tickTime: zookeeper中使用的基本时间单位, 毫秒值.dataDir: 数据目录. 可以是任意目

zookeeper 伪集群搭建

简介Zookeeper 是 一个分布式.开放源码的分布式应用程序协调服务,是Google Chubby的一个开源实现,大多数的分布式应用都需要Zookeeper的支持,这篇文章先简单的和大家分享如何搭建一个zookeeper集群.(笔者注:Chubby是一个lock service,通过这个lock service可以解决分布式中的一致性问题.为这个lock service的实现是一个分布式的文件系统. 环境: 由于我是用自己的笔记本做实验,所以就用了一台虚拟机:其实和真实的差不多:也就配置有些

zookeeper伪集群搭建

下载地址:http://mirror.bit.edu.cn/apache/zookeeper/ yum install telnet -y -y 不再提示 全部选择yes 1.解压三个zk文件夹分别为 zk8081 zk80822.zk2181: mkdir data mkdir logs touch /daata/myid 写入1zk2182: mkdir data mkdir logs touch /daata/myid 写入2zk2183: mkdir data mkdir logs to

大数据学习系列之七 ----- Hadoop+Spark+Zookeeper+HBase+Hive集群搭建 图文详解

引言 在之前的大数据学习系列中,搭建了Hadoop+Spark+HBase+Hive 环境以及一些测试.其实要说的话,我开始学习大数据的时候,搭建的就是集群,并不是单机模式和伪分布式.至于为什么先写单机的搭建,是因为作为个人学习的话,单机已足以,好吧,说实话是自己的电脑不行,使用虚拟机实在太卡了... 整个的集群搭建是在公司的测试服务搭建的,在搭建的时候遇到各种各样的坑,当然也收获颇多.在成功搭建大数据集群之后,零零散散的做了写笔记,然后重新将这些笔记整理了下来.于是就有了本篇博文. 其实我在搭

【Linux】zookeeper构造伪集群

1.在一台机器装安装3个zk server,构建伪集群模式安装步骤如下:1.下载zookeeper,下载地址:http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.4.6/2.解压到三个目录下,如 /data/zookeeper/zServer1,/data/zookeeper/zServer2,/data/zookeeper/zServer33.创建每个目录下的conf/zoo.cfg配置文件如/data/zookeeper/zServer