zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Olivier Mallassi <olivier.malla...@gmail.com>
Subject Re: Dynamic reconfiguration: New participant server opens wrong ports
Date Thu, 19 Jun 2014 12:02:34 GMT
hi

I am not sure to understand the lines server.1=localhost:2801:3801;2181
does it mean server.1=localhost:2801:3801 and clientPort set to 2181?

I assume  yes.
in that case, your behavior looks normal
http://zookeeper.apache.org/doc/r3.4.5/zookeeperAdmin.html#sc_minimumConfiguration


server.x=[hostname]:nnnnn[:nnnnn], etc

(No Java system property)

servers making up the ZooKeeper ensemble. When the server starts up, it
determines which server it is by looking for the file myid in the data
directory. That file contains the server number, in ASCII, and it should
match *x* in *server.x* in the left hand side of this setting.

The list of servers that make up ZooKeeper servers that is used by the
clients must match the list of ZooKeeper servers that each ZooKeeper server
has.

There are two port numbers *nnnnn*. The first followers use to connect to
the leader, and the second is for leader election. The leader election port
is only necessary if electionAlg is 1, 2, or 3 (default). If electionAlg is
0, then the second port is not necessary. If you want to test multiple
servers on a single machine, then different ports can be used for each
server.


so regarding your config, you have just change to port for client
connection not for "membership/leader connection". and it looks that is why
the server.3 joins the cluster but no longer accept tcp request on 2183 but
on 2184.

HTH.



On Thu, Jun 19, 2014 at 1:03 PM, Niko Vuokko <niko.vuokko@gmail.com> wrote:

> Starting from a stable 3-member quorum:
>
> server.1=localhost:2801:3801;2181
> server.2=localhost:2802:3802;2182
> server.3=localhost:2803:3803;2183
>
> I then kill server 3, clear its data directory, keep its myid=3 and change
> its static configuration to
>
> server.1=localhost:2801:3801;2181
> server.2=localhost:2802:3802;2182
> server.3=localhost:2804:3804;2184
>
> Now what I would expect is that this "new" server 3 will not join the
> quorum since the ports don't match what the servers 1 and 2 expect.
> However, it can join. The problem is that the "new" server 3 does not
> respect its configuration. Its logs will contain the new port number 2184,
> but it will actually pick up the dynamic configuration offered by the
> quorum and open up the old ports 2183 etc. After joining again, the dynamic
> configuration file for server 3 contains
>
> server.3=localhost:2803:3803:participant;0.0.0.0:2183
>
> Also, echo conf | localhost 2184 never replies but echo conf | localhost
> 2183 returns
>
> server.3=localhost:2803:3803:participant;0.0.0.0:2183
>
> Is this actually intentional or a bug?
>
>
> Best,
> Niko Vuokko
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message