James
James

Reputation: 45

Zookeeper Client Session will be timed-out or be transport to another server?

As is shown in pic, we have a zookeeper cluster composed by s1, s2 and s3, and two zookeeper client c1 and c2. c1 was connected to s1, and c2 to s3. I wonder what would happen to c2 if a network partition happen to s3, which means s3 can not connect to s1 and s2, but it still running. c2 will recieve an Exception or its session will be migrated to another server?

pic

split-brain

Upvotes: 0

Views: 189

Answers (1)

Valentina
Valentina

Reputation: 534

I am not a Zookeeper expert, but also have 3-nodes setup and was reading a lot about and making some experiments with it.

There are tickTime and syncLimit settings in Zookepeer, which define how long the followers can be unsynced (If followers fall too far behind a leader, they will be dropped).

I was making an experiment of shutting down the node, to which client was connected. I saw exception in logs and then client reconnected itself to another node.

However there is also a setting initLimit, which defines how much time client has to establish connection. If it fails to establish connection within this time, you will get ConnectionLoss exception.

Upvotes: 1

Related Questions