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

Mark Harwood commented on ZOOKEEPER-127:
----------------------------------------

Thanks for the quick response, Flavio.

>>If we allow a different port for each peer, then we would need a line in the 
>>configuration file for each peer for leader election, right?

I currently do that. The config file allows you to specify an "electionPort" 
property which is read by QuorumPeerConfig. 
The javadocs for QuorumPeer don't document this but my assumption was that this 
was a legitimate setting and I could choose different values for each server as 
long as they all tied up OK.
This worked out OK for me using the sourceforge 2.2.1 version.

The main reason for me wanting to mess around with ports in this way was to 
allow me to test Zookeeper services out on my single development machine where 
I could fire up and kill individual processes. I imagine it may not be uncommon 
for people starting with Zookeeper to want to do this so I would suggest doing 
one of the following:

1) Documenting clearly that electionPorts must be the same on all machines (but 
this would disallow my scenario of single-machine testing of multiple 
QuorumPeerMain processes)
2) Fixing the code to allow multiple electionPorts to be used.

Am I understanding this correctly?
Thanks,
Mark






> Use of non-standard election ports in config breaks services
> ------------------------------------------------------------
>
>                 Key: ZOOKEEPER-127
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-127
>             Project: Zookeeper
>          Issue Type: Bug
>          Components: quorum
>    Affects Versions: 3.0.0
>            Reporter: Mark Harwood
>            Priority: Minor
>
> In QuorumCnxManager.toSend there is a call to create a connection as follows:
>     channel = SocketChannel.open(new InetSocketAddress(addr, port));
> Unfortunately "addr" is the ip address of a remote server while "port" is the 
> electionPort of *this* server.
> As an example, given this configuration (taken from my zoo.cfg)
>   server.1=10.20.9.254:2881
>   server.2=10.20.9.9:2882
>   server.3=10.20.9.254:2883
> Server 3 was observed trying to make a connection to host 10.20.9.9 on port 
> 2883 and obviously failing.
> In tests where all machines use the same electionPort this bug would not 
> manifest itself.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to