On Mon, Jul 20, 2020 at 2:29 PM Szalay-Bekő Máté <[email protected]> wrote: > Can you try to change your configs by not using 0.0.0.0 in the ZOO_SERVERS? > Using 0.0.0.0 is not a recommended config since 3.5. If the java process > can not bind (due to some virtual network issue) to the host provided in > it's config, then you can use the quorumListenOnAllIPs parameter. > > So you should have the very same configuration for all nodes in your > cluster, like: > > ZOO_CFG_EXTRA="quorumListenOnAllIPs=true" > ZOO_SERVERS=server.1=x.x.x.1:2888:3888:participant;2181 \ > server.2=x.x.x.2:2888:3888:participant;2181 \ > server.3=x.x.x.3:2888:3888:participant;2181
That works, except that I cannot get the client port (2181) to listen on 0.0.0.0 so it can be mapped to the outside. Any idea how to achieve that? -- 8< -- 2020-07-24 16:04:59,243 [myid:] - INFO [main:QuorumPeerConfig@456] - clientPortAddress is 0.0.0.0:2181 2020-07-24 16:04:59,415 [myid:2] - INFO [main:NIOServerCnxnFactory@674] - binding to port /0.0.0.0:2181 2020-07-24 16:04:59,483 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):QuorumPeer@1371] - LOOKING 2020-07-24 16:04:59,483 [myid:2] - INFO [QuorumPeer[myid=2](plain=[0:0:0:0:0:0:0:0]:2181)(secure=disabled):FastLeaderElection@944] - New election. My id = 2, proposed zxid=0xb00000000 2020-07-24 16:04:59,531 [myid:2] - INFO [NIOServerCxnFactory.AcceptThread:/0.0.0.0:2181:NIOServerCnxnFactory$AcceptThread@209] - accept thread exitted run method 2020-07-24 16:04:59,531 [myid:2] - INFO [WorkerReceiver[myid=2]:NIOServerCnxnFactory@707] - binding to port /10.147.254.2:2181 2020-07-24 16:04:59,531 [myid:2] - ERROR [WorkerReceiver[myid=2]:NIOServerCnxnFactory@713] - Error reconfiguring client port to /10.147.254.2:2181 -- 8< -- It seems Zookeeper is rebinding the client port to the announced IP during the startup sequence. I also tried specifying the bind address in ZOO_SERVER as well as through clientPortAddress=0.0.0.0 - without any luck. > BTW, unfortunately there is no such thing as "official zookeeper Docker > image", at least it is not maintained by the Apache ZooKeeper community. (I > don't know who is maintaining the image on dockerHub > https://hub.docker.com/_/zookeeper - it would be nice to ask them to update > their examples / documentation) I'll open a PR once I get this sorted out. ;-) Thanks, Thilo
