curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Grove <>
Subject Curator client fails to connect if any one of my zookeeper instances is down
Date Tue, 25 Jun 2013 17:16:09 GMT

I'm using the following code to connect to my zookeeper instances:

            client = CuratorFrameworkFactory.newClient(connectString, sessionTimeout, connectTimeout,new
ExponentialBackoffRetry(1000, 3));

I have three hosts, lets call them host1, host2 and host3. If all hosts are running then everything
works as expected.

If host1 is down (server shut down) then all operations on the curator client fail and I see
errors like this:

ERROR - Connection timed out for connection string (host1:8090,host2:8090,host3:8090)
and timeout (15000) / elapsed (15310)

It doesn't matter what order I specify the hosts in, I always get these errors and my operation
eventually fails with:

     [java] Caused by: org.apache.zookeeper.KeeperException$ConnectionLossException: KeeperErrorCode
= ConnectionLoss
     [java] 	at
     [java] 	at
     [java] 	at
     [java] 	at$
     [java] 	at$
     [java] 	at
     [java] 	at
     [java] 	at
     [java] 	at
     [java] 	at com.dbshards.nameserver.ZKClient.createPath(

I would expect Curator/Zookeeper to try this operation with host2 or host3 after an error
connecting to host1 but this is not the case. I even have a retry loop in my code that tries
the operation 10 times and it fails every time if host1 is in the connect string.

I'm hoping I'm missing something obvious here. Any help would be appreciated.



Andy Grove
CodeFutures Corporation

Share Nothing, Shard Everything!

View raw message