2n + 是什么意思? 1法定人数意味着什么?

发布于 2024-10-03 05:56:33 字数 108 浏览 9 评论 0原文

我在描述 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

滥情哥ㄟ 2024-10-10 05:56:33

2f+1是指您需要的可靠性/可用性级别,一般与性能无关。

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

假设集合中有 3 台服务器 (f=1),如果其中一台出现故障,服务仍会运行(2 台占多数)。但是,如果第二台服务器出现故障,服务就会停止。

假设集合中有 5 台服务器 (f=2)。在这种情况下,两台服务器可能会发生故障(大多数是 3 台),而服务仍然正常运行。

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

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

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

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.

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.

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.

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.

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).

小傻瓜 2024-10-10 05:56:33

n 指的是系统可能遇到的故障数量,但仍然能够与至少大多数节点一起运行。两个示例:

n = 1 - 总共 2n+1 = 3 个节点中,一个节点可能会发生故障

n = 2 - 两个节点可能会发生故障总共 2n+1 = 5 个节点失败

等等!

n refers to the number of failures that the system can experience but still be able to function with at least a majority of nodes. Two examples:

n = 1 - one node can fail out of a total of 2n+1 = 3 nodes

n = 2 - two nodes can fail out of a total of 2n+1 = 5 nodes

And so on!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文