[
https://issues.apache.org/jira/browse/ZOOKEEPER-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13846779#comment-13846779
]
Bruno Freudensprung commented on ZOOKEEPER-1691:
------------------------------------------------
Here is my next test. Reconfig has been successful although I am still unsure
about correct "start" conditions (should zoo.cfg files have
standaloneEnabled=false or standaloneEnabled=true?). I assume "false" in this
test (well.. I couldn't make it work with false anyway, I guess it is the
situation described here https://issues.apache.org/jira/browse/ZOOKEEPER-1726)
== Server 1 zoo.cfg:
standaloneEnabled=false
dynamicConfigFile=<path to>/confdyn1/zoo.cfg.dynamic
== Server 1 zoo.cfg.dynamic:
server.1=localhost:2888:3888:participant;localhost:2181
Now say I want to add server 2 to the "server 1 cluster".
== Server 2 zoo.cfg:
standaloneEnabled=false
dynamicConfigFile=<path to>/confdyn2/zoo.cfg.dynamic
== Server 2 zoo.cfg.dynamic (it is "aware" of the server 1, as mentioned in the
Dynamic Reconfiguration - User Manual
that I should have read more carefully yesterday):
server.1=localhost:2888:3888:participant;localhost:2181
server.2=localhost:2889:3889:participant;localhost:2182
Start server 1 => OK
Start server 2 => OK but something rather strange happens, server 2
zoo.cfg.dynamic now becomes (server.2 line disappears, although server 2 myid
file contains "2"):
server.1=localhost:2888:3888:participant;localhost:2181
version=100000000
== connect client 1 to server 1 and ask for the config:
[zk: localhost:2181(CONNECTED) 0] config
server.1=localhost:2888:3888:participant;localhost:2181
version=100000000
[zk: localhost:2181(CONNECTED) 1]
== connect client 2 to server 2 and ask for the config:
[zk: localhost:2182(CONNECTED) 1] config
server.1=localhost:2888:3888:participant;localhost:2181
version=100000000
[zk: localhost:2182(CONNECTED) 2]
== use client 1 to issue a reconfig command on server 1:
[zk: localhost:2181(CONNECTED) 1] reconfig -add
server.2=localhost:2889:3889:participant;localhost:2182
Committed new configuration:
server.1=localhost:2888:3888:participant;localhost:2181
server.2=localhost:2889:3889:participant;localhost:2182
version=100000003
[zk: localhost:2181(CONNECTED) 2]
== display config from client 2 connected to server 2:
[zk: localhost:2182(CONNECTED) 2] config
server.1=localhost:2888:3888:participant;localhost:2181
server.2=localhost:2889:3889:participant;localhost:2182
version=100000003
[zk: localhost:2182(CONNECTED) 3]
Looks fine!! Nodes created from client 1 are visible to client 2 and vice-versa.
Still, I can see strange stack traces in both server consoles.
Server 1:
2013-12-12 22:31:40,888 [myid:1] - WARN [ProcessThread(sid:1
cport:-1)::QuorumCnxManager@390] - Cannot open channel to 2 at election address
localhost/127.0.0.1:3889
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:375)
at
org.apache.zookeeper.server.quorum.QuorumPeer.connectNewPeers(QuorumPeer.java:1252)
at
org.apache.zookeeper.server.quorum.QuorumPeer.setLastSeenQuorumVerifier(QuorumPeer.java:1272)
at org.apache.zookeeper.server.quorum.Leader.propose(Leader.java:1071)
at
org.apache.zookeeper.server.quorum.ProposalRequestProcessor.processRequest(ProposalRequestProcessor.java:78)
at
org.apache.zookeeper.server.PrepRequestProcessor.pRequest(PrepRequestProcessor.java:864)
at
org.apache.zookeeper.server.PrepRequestProcessor.run(PrepRequestProcessor.java:144)
2013-12-12 22:31:41,919 [myid:1] - WARN
[LearnerHandler-/127.0.0.1:52301:QuorumPeer@1259] - Restarting Leader Election
2013-12-12 22:31:41,920 [myid:1] - INFO
[localhost/127.0.0.1:3888:QuorumCnxManager$Listener@571] - Leaving listener
2013-12-12 22:31:41,920 [myid:1] - INFO
[QuorumPeerListener:QuorumCnxManager$Listener@544] - My election bind port:
localhost/127.0.0.1:3888
2013-12-12 22:31:44,438 [myid:1] - INFO
[WorkerReceiver[myid=1]:FastLeaderElection$Messenger$WorkerReceiver@410] -
WorkerReceiver is down
2013-12-12 22:31:44,439 [myid:1] - INFO
[WorkerSender[myid=1]:FastLeaderElection$Messenger$WorkerSender@442] -
WorkerSender is down
Server 2:
2013-12-12 22:31:41,894 [myid:2] - WARN
[QuorumPeer[myid=2]/127.0.0.1:2182:QuorumCnxManager@390] - Cannot open channel
to 2 at election address localhost/127.0.0.1:3889
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:351)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:213)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:200)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:529)
at
org.apache.zookeeper.server.quorum.QuorumCnxManager.connectOne(QuorumCnxManager.java:375)
at
org.apache.zookeeper.server.quorum.QuorumPeer.connectNewPeers(QuorumPeer.java:1252)
at
org.apache.zookeeper.server.quorum.QuorumPeer.setLastSeenQuorumVerifier(QuorumPeer.java:1272)
at
org.apache.zookeeper.server.quorum.Follower.processPacket(Follower.java:131)
at
org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:89)
at
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:967)
2013-12-12 22:31:41,923 [myid:2] - WARN
[QuorumPeer[myid=2]/127.0.0.1:2182:QuorumPeer@1259] - Restarting Leader Election
2013-12-12 22:31:41,924 [myid:2] - INFO
[QuorumPeerListener:QuorumCnxManager$Listener@544] - My election bind port:
localhost/127.0.0.1:3889
Bruno.
> Add a flag to disable standalone mode
> -------------------------------------
>
> Key: ZOOKEEPER-1691
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1691
> Project: ZooKeeper
> Issue Type: Improvement
> Components: quorum
> Reporter: Michi Mutsuzaki
> Assignee: Helen Hastings
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1691.patch, ZOOKEEPER-1691.patch,
> ZOOKEEPER-1691.patch, ZOOKEEPER-1691.patch, ZOOKEEPER-1691.patch,
> ZOOKEEPER-1691.patch, test scenario.txt
>
>
> Currently you cannot use dynamic reconfiguration to bootstrap zookeeper
> cluster because the server goes into standalone mode when there is only one
> server in the cluster.
> --Michi
--
This message was sent by Atlassian JIRA
(v6.1.4#6159)