zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Benjamin Jaton <benjamin.ja...@gmail.com>
Subject ZK read-only issue
Date Tue, 12 Jul 2016 23:23:14 GMT

I'm having problems using ZK in read-only mode.
I am using a fresh install of ZK 3.5.1-alpha where I configure the
installation to be in a 3 nodes ensemble.
I start this node only (QA-E8WIN11) with -Dreadonlymode.enabled=true.

I see that the node QA-E8WIN11 starts the RO server properly:
2016-07-12 16:10:10,955 [myid:1] - INFO
[Thread-4:ReadOnlyZooKeeperServer@73] - Read-only server started

Then I make a read-only enabled client:

        ZooKeeper zk = new ZooKeeper("QA-E8WIN12:2181,QA-E8WIN13:2181,
*QA-E8WIN11*:2181", 45000, this, true);
        System.out.println("Successfully established the connection with

        zk.getData("/", false, null);

Note that only *QA-E8WIN11* is started, the other 2 are not.

When the ZK client picks *QA-E8WIN11* first, it works.
But when it picks a different node, it fails with:

16:10:13.338 org.apache.zookeeper.ZooKeeper:716 - Initiating client
connection, connectString=QA-E8WIN12:2181,QA-E8WIN13:2181,QA-E8WIN11:2181
sessionTimeout=45000 watcher=TestZkReadOnly@68de145
Successfully established the connection with ZooKeeper
16:10:13.475 org.apache.zookeeper.ClientCnxn:1138 - Opening socket
connection to server QA-E8WIN13/ Will not attempt to
authenticate using SASL (unknown error)
16:10:28.469 org.apache.zookeeper.ClientCnxn:1251 - Client session timed
out, have not heard from server in 15001ms for sessionid 0x0, closing
socket connection and attempting reconnect
16:10:28.574 org.apache.zookeeper.ClientCnxn:1138 - Opening socket
connection to server QA-E8WIN12/ Will not attempt to
authenticate using SASL (unknown error)
Exception in thread "main"
KeeperErrorCode = ConnectionLoss for /
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:99)
    at org.apache.zookeeper.KeeperException.create(KeeperException.java:51)
    at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1753)
    at org.apache.zookeeper.ZooKeeper.getData(ZooKeeper.java:1782)
    at TestZkReadOnly.run(TestZkReadOnly.java:26)
    at TestZkReadOnly.main(TestZkReadOnly.java:16)

I'm attaching all the logs. The server and the client are on the same

Any help would be greatly appreciated!

Benjamin Jaton

View raw message