[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-4276?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17774073#comment-17774073
 ] 

Andor Molnar commented on ZOOKEEPER-4276:
-----------------------------------------

[~kkori] [~larsfrancke] 

I cannot repro this issue. Would you please upload your zoo.cfg?

This one works for me:
{noformat}
tickTime=2000
initLimit=10
syncLimit=5
dataDir=./andor-5560-ubuntu:2181/data
secureClientPort=2181
clientCnxnSocket=org.apache.zookeeper.ClientCnxnSocketNetty
...
serverCnxnFactory=org.apache.zookeeper.server.NettyServerCnxnFactory
...
server.1=andor-5560-ubuntu:3181:4181
server.2=andor-5560-ubuntu:3182:4182
server.3=andor-5560-ubuntu:3183:4183
{noformat}
I don't set clientPort and clientPortAddress. Startup logs look like:
{noformat}
2023-10-11 15:28:35,358 [myid:] - INFO  [main:o.a.z.s.q.QuorumPeerConfig@177] - 
Reading configuration from: ./andor-5560-ubuntu:2181/zoo.cfg
2023-10-11 15:28:35,360 [myid:] - INFO  [main:o.a.z.s.q.QuorumPeerConfig@431] - 
clientPort is not set
2023-10-11 15:28:35,366 [myid:] - INFO  [main:o.a.z.s.q.QuorumPeerConfig@453] - 
secureClientPortAddress is 0.0.0.0:2181
...
2023-10-11 15:28:35,635 [myid:1] - INFO  
[main:o.a.z.s.NettyServerCnxnFactory@707] - binding to port 0.0.0.0/0.0.0.0:2181
2023-10-11 15:28:35,704 [myid:1] - INFO  
[main:o.a.z.s.NettyServerCnxnFactory@712] - bound to port 2181{noformat}
ZooKeeper is listening in secure-mode only.

> Serving only with secureClientPort fails
> ----------------------------------------
>
>                 Key: ZOOKEEPER-4276
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4276
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: server
>    Affects Versions: 3.7.0, 3.5.8, 3.6.2, 3.8.0
>            Reporter: Kei Kori
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2h
>  Remaining Estimate: 0h
>
> clientPort in zoo.cfg is forcefully complemented from client address by 
> QuorumPeerConfig#setupClientPort even though secureClientPort is set and 
> matches with client address' port.
> Because of this behavior, in case rolling update with replacing clientPort to 
> secureClientPort in the same port number following [Upgrading existing 
> non-TLS cluster with no 
> downtime|https://zookeeper.apache.org/doc/r3.7.0/zookeeperAdmin.html#Upgrading+existing+nonTLS+cluster]
>  conflicts and gets errors below.
> {code}
> 2021-03-29 23:21:58,638 - INFO  [main:NettyServerCnxnFactory@590] - binding 
> to port /0.0.0.0:2281
> 2021-03-29 23:21:58,748 - INFO  [main:NettyServerCnxnFactory@595] - bound to 
> port 2281
> 2021-03-29 23:21:58,749 - INFO  [main:NettyServerCnxnFactory@590] - binding 
> to port 0.0.0.0/0.0.0.0:2281
> 2021-03-29 23:21:58,753 - ERROR [main:QuorumPeerMain@101] - Unexpected 
> exception, exiting abnormally
> java.net.BindException: Address already in use
> {code}
> QuorumPeerConfig#setupClientPort should complement only when both clientPort 
> and secureClientPort are empty, and allow serving zookeeper server only with 
> secure client port.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to