ZooKeeper instances will answer requests from clients if they form a quorum.
A majority formed from a minimum set of "up and running" ZooKeeper instances is called a quorum.
If your ZooKeeper ensemble contains 3 ZooKeeper instances, then a quorum will be formed if a minimum of 2 ZooKeeper instances are up and running.
The recommendation is that your ZooKeeper ensemble contain an odd number of ZooKeeper instances.
You can use the equation “2f + 1”
to calculate how many failures your ZooKeeper ensemble will tolerate in order to continue responding requests from clients.
“f” stands for the number of instances that can be down.
For example, if your ZooKeeper ensemble contains:
-
3 ZooKeeper instances (2 * 1 + 1), then 1 instance can be down.
-
5 ZooKeeper instances (2 * 2 + 1), then 2 instances can be down.
-
7 ZooKeeper instances (2 * 3 + 1), then 3 instances can be down.