Reputation: 45
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?
Upvotes: 0
Views: 189
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