问题
Is there a formula to calculate the number of zookeeper servers I need? Say a cluster may have 50, 500, or 5000 servers running, how do I convert those numbers into how many zookeeper server I want to start?
To put it another way, what's a good estimate for the workload a zk server can handle? Is it based on the size of the storage, or QPS the quorum receives, or some other metrics?
回答1:
The workload an ensemble (cluster) of ZooKeeper servers can handle, is primarily dependent on the number of writes your application performs. It's not dependent on the number of clients to the ZooKeeper ensemble.
The number of ZooKeeper servers in the ensemble will have an effect on the write performance where having fewer (optimal is 3) is faster. However, you would like to have more than 3 ZooKeeper servers in order to be able to roll your ZooKeeper servers without downtime. As an example you can restart one server and still survive a crash with a 5 ZooKeeper ensemble.
See also throughput example here: https://wiki.apache.org/hadoop/ZooKeeper/Performance
Does that answer your question?
来源:https://stackoverflow.com/questions/42880362/how-to-calculate-the-number-of-zookeeper-servers-i-need-for-a-cluster