Zookeeper的Leader选举
摘自《ZooKeeper分布式过程协同技术详解》
每个服务器启动后进入LOOKING状态,开始选举一个新的群首或查找一个已经存在的群首,如果群首已经存在,其他服务器就会通知这个新启动的服务器,告知哪个服务器是群首,与此同时,新的服务器会与群首建立连接,以确保自己的状态与群首一致。
如果集群中所有的服务器均处于LOOKING状态,这些服务器之间就会进行通信来选举一个群首,通过信息交换对群首选举达成共识的选择。在本次选举中胜出的服务器将将入LEADING状态,而集群中的其他服务器将会将入FOLLOWING状态。
对于群首选举的消息,我们称之为群首选举通知消息(leader election notification),或简单地称之为通知(notifications)。该协议非常简单,当一个服务器进入LOOKING状态,就会向集群中的每个服务器发送一个通知消息,改消息中包括服务器的投票(vote)信息,投票中包含服务器标识(sid)和最近执行的事务的zxid信息,比如,一个服务器所发送的投票信息未(1,5),表示该服务器的sid为1,最近执行的事务的zxid为5(出于群首选举目的,zxid只有一个数字,而在其他协议中,zxid有时间戳epoch和计数器组成)。
当一个服务器收到一个投票信息,改服务器会根据以下规则修改自己的投票信息:
- 1.将接收的voteId和voteZxid作为一个标识符,并获取接收方当前的投票中的zxid,用myZxid和mySId表示接收方服务器自己的值。
- 2.如果(voteZxid > myZxid)或者(voteZxid = myZxid 且 voteId > mySid),保留当前投票信息。
- 3.否则,修改自己的投票信息,将voteZxid赋值给myZxid,将voteId赋值给mySid。
简而言之,只有最新的服务器将赢得选举,因为其拥有最近一次的zxid。如果多个服务器拥有最新的zxid值,其中sid值将赢得选举。
实验日志
- zoo-2181.cfg
2021-08-22 23:26:08,085 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@945] - New election. My id = 1, proposed zxid=0x100000006
2021-08-22 23:26:08,101 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:1, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:08,308 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 400
2021-08-22 23:26:08,709 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 800
2021-08-22 23:26:09,510 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 1600
2021-08-22 23:26:11,111 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 3200
2021-08-22 23:26:14,312 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 6400
2021-08-22 23:26:20,714 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 12800
2021-08-22 23:26:33,515 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 25600
2021-08-22 23:26:45,609 [myid:1] - INFO [ListenerHandler-localhost/127.0.0.1:3881:QuorumCnxManager$Listener$ListenerHandler@1071] - Received connection request from /127.0.0.1:40974
2021-08-22 23:26:45,629 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,829 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@901] - Peer state changed: following
2021-08-22 23:26:45,830 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@1512] - FOLLOWING
2021-08-22 23:26:45,860 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2181/version-2 snapdir /home/hx-admin/data/zookeeper/data/2181/version-2
2021-08-22 23:26:45,868 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Follower@77] - FOLLOWING - LEADER ELECTION TOOK - 37783 MS
2021-08-22 23:26:45,882 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@915] - Peer state changed: following - discovery
2021-08-22 23:26:45,891 [myid:1] - INFO [LeaderConnector-localhost/127.0.0.1:2882:Learner$LeaderConnector@381] - Successfully connected to leader, using address: localhost/127.0.0.1:2882
2021-08-22 23:26:45,929 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@915] - Peer state changed: following - synchronization
2021-08-22 23:26:45,933 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Learner@562] - Getting a diff from the leader 0x100000006
2021-08-22 23:26:45,934 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@920] - Peer state changed: following - synchronization - diff
2021-08-22 23:26:45,940 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Learner@734] - Learner received NEWLEADER message
- zoo-2182.cfg
2021-08-22 23:26:45,586 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):FastLeaderElection@945] - New election. My id = 2, proposed zxid=0x100000006
2021-08-22 23:26:45,601 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,631 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:1, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,631 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,835 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@901] - Peer state changed: leading
2021-08-22 23:26:45,836 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@1524] - LEADING
2021-08-22 23:26:45,864 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2182/version-2 snapdir /home/hx-admin/data/zookeeper/data/2182/version-2
2021-08-22 23:26:45,876 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):Leader@584] - LEADING - LEADER ELECTION TOOK - 290 MS
2021-08-22 23:26:45,886 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@915] - Peer state changed: leading - discovery
- zoo-2183.cfg
2021-08-22 23:26:54,805 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):FastLeaderElection@945] - New election. My id = 3, proposed zxid=0x100000006
2021-08-22 23:26:54,823 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:3, n.state:LOOKING, n.leader:3, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,833 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,834 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:FOLLOWING, n.leader:2, n.round:0x1, n.peerEpoch:0x2, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,835 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,839 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LEADING, n.leader:2, n.round:0x1, n.peerEpoch:0x2, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,839 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@901] - Peer state changed: following
2021-08-22 23:26:54,839 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@1512] - FOLLOWING
2021-08-22 23:26:54,853 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):AuthenticationHelper@67] - zookeeper.enforce.auth.schemes = []
2021-08-22 23:26:54,853 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2183/version-2 snapdir /home/hx-admin/data/zookeeper/data/2183/version-2
2021-08-22 23:26:54,854 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):Follower@77] - FOLLOWING - LEADER ELECTION TOOK - 49 MS
2021-08-22 23:26:54,857 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@915] - Peer state changed: following - discovery
- 综合时间线日志
2021-08-22 23:26:08,085 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@945] - New election. My id = 1, proposed zxid=0x100000006
2021-08-22 23:26:08,101 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:1, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:08,308 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 400
2021-08-22 23:26:08,709 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 800
2021-08-22 23:26:09,510 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 1600
2021-08-22 23:26:11,111 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 3200
2021-08-22 23:26:14,312 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 6400
2021-08-22 23:26:20,714 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 12800
2021-08-22 23:26:33,515 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@980] - Notification time out: 25600
2021-08-22 23:26:45,586 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):FastLeaderElection@945] - New election. My id = 2, proposed zxid=0x100000006
2021-08-22 23:26:45,601 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,609 [myid:1] - INFO [ListenerHandler-localhost/127.0.0.1:3881:QuorumCnxManager$Listener$ListenerHandler@1071] - Received connection request from /127.0.0.1:40974
2021-08-22 23:26:45,629 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,631 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:1, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,631 [myid:2] - INFO [WorkerReceiver[myid=2]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:45,829 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@901] - Peer state changed: following
2021-08-22 23:26:45,830 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@1512] - FOLLOWING
2021-08-22 23:26:45,835 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@901] - Peer state changed: leading
2021-08-22 23:26:45,836 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@1524] - LEADING
2021-08-22 23:26:45,860 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2181/version-2 snapdir /home/hx-admin/data/zookeeper/data/2181/version-2
2021-08-22 23:26:45,864 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2182/version-2 snapdir /home/hx-admin/data/zookeeper/data/2182/version-2
2021-08-22 23:26:45,868 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Follower@77] - FOLLOWING - LEADER ELECTION TOOK - 37783 MS
2021-08-22 23:26:45,876 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):Leader@584] - LEADING - LEADER ELECTION TOOK - 290 MS
2021-08-22 23:26:45,882 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@915] - Peer state changed: following - discovery
2021-08-22 23:26:45,886 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2182)(secure=disabled):QuorumPeer@915] - Peer state changed: leading - discovery
2021-08-22 23:26:45,891 [myid:1] - INFO [LeaderConnector-localhost/127.0.0.1:2882:Learner$LeaderConnector@381] - Successfully connected to leader, using address: localhost/127.0.0.1:2882
2021-08-22 23:26:45,929 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@915] - Peer state changed: following - synchronization
2021-08-22 23:26:45,933 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Learner@562] - Getting a diff from the leader 0x100000006
2021-08-22 23:26:45,934 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@920] - Peer state changed: following - synchronization - diff
2021-08-22 23:26:45,940 [myid:1] - INFO [QuorumPeer[myid=1](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):Learner@734] - Learner received NEWLEADER message
2021-08-22 23:26:54,805 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):FastLeaderElection@945] - New election. My id = 3, proposed zxid=0x100000006
2021-08-22 23:26:54,823 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:3, n.state:LOOKING, n.leader:3, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,833 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,834 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:1, n.state:FOLLOWING, n.leader:2, n.round:0x1, n.peerEpoch:0x2, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,835 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LOOKING, n.leader:2, n.round:0x1, n.peerEpoch:0x1, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,839 [myid:3] - INFO [WorkerReceiver[myid=3]:FastLeaderElection$Messenger$WorkerReceiver@390] - Notification: my state:LOOKING; n.sid:2, n.state:LEADING, n.leader:2, n.round:0x1, n.peerEpoch:0x2, n.zxid:0x100000006, message format version:0x2, n.config version:0x0
2021-08-22 23:26:54,839 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@901] - Peer state changed: following
2021-08-22 23:26:54,839 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@1512] - FOLLOWING
2021-08-22 23:26:54,853 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):AuthenticationHelper@67] - zookeeper.enforce.auth.schemes = []
2021-08-22 23:26:54,853 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):ZooKeeperServer@361] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /home/hx-admin/data/zookeeper/data/2183/version-2 snapdir /home/hx-admin/data/zookeeper/data/2183/version-2
2021-08-22 23:26:54,854 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):Follower@77] - FOLLOWING - LEADER ELECTION TOOK - 49 MS
2021-08-22 23:26:54,857 [myid:3] - INFO [QuorumPeer[myid=3](plain=[0:0:0:0:0:0:0:0]:2183)(secure=disabled):QuorumPeer@915] - Peer state changed: following - discovery
-
日志截图