2n + 1 法定人数是什么意思? [英] what does 2n + 1 quorum mean?

查看:23
本文介绍了2n + 1 法定人数是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在描述 HBase 的 Zookeeper 配置时遇到过这个,我不熟悉这个术语.N"是否与我的 HBase 集群中的节点数量有关?或者我应该在我的 Zookeeper 集群中使用多少节点?

I've come across this when describing the Zookeeper configuration for HBase, and I'm unfamiliar with the term. Does the 'N' have anything to do with the number of nodes in my HBase cluster? Or the number of nodes I should use in my Zookeeper cluster?

推荐答案

2f+1 指的是你需要的可靠性/可用性级别,一般来说它与性能无关.

2f+1 refers to the level of reliability/availablility you require, in general it is not related to performance.

ZooKeeper 集成(服务集群)由一台或多台服务器组成,这些服务器对每次更改进行投票".大多数原始服务器在接受任何更改之前都需要批准".客户端(在本例中为 hbase)连接到集成并使用它进行协调.如果 ensemble 启动,客户端可以执行此操作,如果 ensemble 关闭,则 hbase 无法使用该服务.

ZooKeeper ensembles (serving clusters) are made up of one or more servers which "vote" on each change. A majority of the original servers are required to "approve" any change before it's accepted. Clients (hbase in this case) connect to the ensemble and use it to coordinate. If the ensemble is up the clients can do this, if the ensemble is down then hbase is unable to use the service.

假设您在集合中有 3 个服务器 (f=1),如果其中一个失败,则服务仍在运行(2 是多数).但是,如果第二台服务器出现故障,该服务就会关闭.

Say you have 3 servers (f=1) in the ensemble, if one fails the service is still up (2 is a majority). However if a second server fails the service would be down.

假设您在集合中有 5 个服务器 (f=2).在这种情况下,两台服务器可能会发生故障(3 台是大多数)并且服务仍在运行.

Say you have 5 servers (f=2) in the ensemble. In this case two servers can fail (3 is a majority) and the service is still up.

通常 3 台服务器就足够了.但是对于在线生产服务环境,我建议使用 5.为什么?假设您关闭 1 个服务器进行定期维护.如果您有 5 台服务器,即使剩余的一台活动服务器出现意外故障,您也可以保持正常运行.

Typically 3 servers is more than sufficient. However for online production serving environments I'd suggest 5. Why? Say you take 1 server down for scheduled maintenance. If you have 5 servers you can stay up even if one of the remaining active servers fails unexpectedly.

那为什么没有 101 台服务器呢?——坦斯塔夫.请参阅此处的图表.ZK 是基于仲裁的服务.随着服务器数量的增加,写入性能实际上会下降.需要更多服务器参与仲裁过程(投票).结果写操作/秒减少.(虽然读取不受影响).

Why not have 101 servers then? -- TANSTAAFL. See the graph here. ZK is a quorum based service. As the number of servers increases the write performance actually drops. More servers are required to participate in the quroum process (voting). As a result the write ops/sec decreases. (read is uneffected though).

这篇关于2n + 1 法定人数是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆