Я использую Zookeeper 3.6.0 в реплицированном режиме (всего 3 узла zookeeper) в AWS EKS кластер версии 1.15. Я тяну zookeeper: последнее изображение из Docker hub.
Это файл zoo.cfg узла 1 (prd-zoo1). Другие узлы имеют аналогичную конфигурацию за исключением трех последних записей, в которых указаны другие серверы зоопарка.
zoo.cfg Node 1:
dataDir=/data
dataLogDir=/datalog
tickTime=2000
initLimit=5
syncLimit=2
autopurge.snapRetainCount=3
autopurge.purgeInterval=0
maxClientCnxns=60
standaloneEnabled=true
admin.enableServer=true
server.1=0.0.0.0:2888:3888;2181
server.2=prd-zoo2:2888:3888;prd-zoo2:2181
server.3=prd-zoo3:2888:3888;prd-zoo3:2181
zoo.cfg Node 2:
<same as node1>
server.1=prd-zoo1:2888:3888;prd-zoo1:2181
server.2=0.0.0.0:2888:3888;2181
server.3=prd-zoo3:2888:3888;prd-zoo3:2181
zoo.cfg Node 3:
<same as node1>
server.1=prd-zoo1:2888:3888;prd-zoo1:2181
server.2=prd-zoo2:2888:3888;prd-zoo2:2181
server.3=0.0.0.0:2888:3888;2181
Кажется, что узлы зоопарка могут общаться друг с другом и завершить выборы лидера. Однако, когда я проверяю журналы, я вижу повторяющиеся ошибки java .lang.IllegalArgumentException. Я проверил, что у каждой службы есть IP-адрес конечной точки и выбор лидера портов, 3888, TCP-клиент, 2181, TCP-сервер, 2888, TCP
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@857] - Peer state changed: following
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@1453] - FOLLOWING
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ZooKeeperServer@1246] - minSessionTimeout set to 4000
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ZooKeeperServer@1255] - maxSessionTimeout set to 40000
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ResponseCache@45] - Response cache size is initialized with value 400.
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ResponseCache@45] - Response cache size is initialized with value 400.
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@111] - zookeeper.pathStats.slotCapacity = 60
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@112] - zookeeper.pathStats.slotDuration = 15
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@113] - zookeeper.pathStats.maxDepth = 6
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@114] - zookeeper.pathStats.initialDelay = 5
2020-04-13 17:20:17,793 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@115] - zookeeper.pathStats.delay = 5
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):RequestPathMetricsCollector@116] - zookeeper.pathStats.enabled = false
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ZooKeeperServer@1470] - The max bytes for all large requests are set to 104857600
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ZooKeeperServer@1484] - The large request threshold is set to -1
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):ZooKeeperServer@329] - Created server with tickTime 2000 minSessionTimeout 4000 maxSessionTimeout 40000 clientPortListenBacklog -1 datadir /datalog/version-2 snapdir /data/version-2
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):Follower@75] - FOLLOWING - LEADER ELECTION TOOK - 1381 MS
2020-04-13 17:20:17,794 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@863] - Peer state changed: following - discovery
2020-04-13 17:20:18,595 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:FOLLOWING; n.sid:3, n.state:LOOKING, n.leader:3, n.round:0x254, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,795 [myid:1] - WARN [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):Follower@129] - Exception when following the leader
java.lang.IllegalArgumentException
at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(Unknown Source)
at java.base/java.util.concurrent.Executors.newFixedThreadPool(Unknown Source)
at org.apache.zookeeper.server.quorum.Learner.connectToLeader(Learner.java:275)
at org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:87)
at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:1455)
2020-04-13 17:20:18,795 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):Follower@292] - shutdown Follower
2020-04-13 17:20:18,795 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@863] - Peer state changed: looking
2020-04-13 17:20:18,795 [myid:1] - WARN [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@1501] - PeerState set to LOOKING
2020-04-13 17:20:18,795 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@1371] - LOOKING
2020-04-13 17:20:18,795 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):FastLeaderElection@931] - New election. My id = 1, proposed zxid=0x0
2020-04-13 17:20:18,795 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:1, n.round:0x254, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,796 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:LOOKING; n.sid:3, n.state:LOOKING, n.leader:3, n.round:0x254, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,796 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:LOOKING; n.sid:1, n.state:LOOKING, n.leader:3, n.round:0x254, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,797 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:LOOKING; n.sid:2, n.state:LEADING, n.leader:2, n.round:0x253, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,797 [myid:1] - INFO [WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@376] - Notification: my state:LOOKING; n.sid:2, n.state:LEADING, n.leader:2, n.round:0x253, n.peerEpoch:0x0, n.zxid:0x0, message format version:0x2, n.config version:0x0
2020-04-13 17:20:18,997 [myid:1] - INFO [QuorumPeer[myid=1](plain=0.0.0.0:2181)(secure=disabled):QuorumPeer@857] - Peer state changed: following
. Лидер, закрывается, начинает искать, следует ...