ZooKeeper 可靠性 - 三节点对五节点 [英] ZooKeeper reliability - three versus five nodes

查看:41
本文介绍了ZooKeeper 可靠性 - 三节点对五节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自 ZooKeeper 常见问题:

Reliability:

A single ZooKeeper server (standalone) is essentially a coordinator with
no reliability (a single serving node failure brings down the ZK service).

A 3 server ensemble (you need to jump to 3 and not 2 because ZK works
based on simple majority voting) allows for a single server to fail and
the service will still be available.

So if you want reliability go with at least 3. We typically recommend
having 5 servers in "online" production serving environments. This allows
you to take 1 server out of service (say planned maintenance) and still
be able to sustain an unexpected outage of one of the remaining servers
w/o interruption of the service.

对于 3 台服务器的集成,如果一台服务器停止轮换并且一台服务器意外中断,那么还有一台服务器应确保不会中断服务.那为什么需要5台服务器呢?或者不仅仅是正在考虑的服务中断?

With a 3-server ensemble, if one server is taken out of rotation and one server has an unexpected outage, then there is still one remaining server that should ensure no interruption of service. Then why the need for 5 servers? Or is it more than just interruption of service that is being considered?

更新:

感谢@sbridges 指出它与维持法定人数有关.ZK 定义法定人数的方式是 ceil(N/2),其中 N 是集合中的原始数字(而不仅仅是当前可用的集合).

Thanks to @sbridges for pointing out that it has to do with maintaining a quorum. And the way that ZK defines a quorum is ceil(N/2) where N is the original number in the ensemble (and not just the currently available set).

现在,谷歌搜索 ZK quorum 在 HBase 书籍 ZK 章节:

Now, a google search for ZK quorum finds this in the HBase book chapter on ZK:

在 ZooKeeper 中,支持偶数个对等点,但通常是未使用,因为均匀大小的合奏按比例需要更多对等体形成比奇数大小的集合所需的法定人数.为了例如,具有 4 个对等节点的集成需要 3 个节点才能形成法定人数,而一个 5 人的合奏也需要 3 人才能形成法定人数.因此,一个合奏5 允许 2 个对等点失败并仍然保持法定人数,因此更多容错比 4 的集成,后者只允许 1 个下行节点.

In ZooKeeper, an even number of peers is supported, but it is normally not used because an even sized ensemble requires, proportionally, more peers to form a quorum than an odd sized ensemble requires. For example, an ensemble with 4 peers requires 3 to form a quorum, while an ensemble with 5 also requires 3 to form a quorum. Thus, an ensemble of 5 allows 2 peers to fail and still maintain quorum, and thus is more fault tolerant than the ensemble of 4, which allows only 1 down peer.

Edward J. Yoon 的博客中对维基百科的这种释义:

And this paraphrasing of Wikipedia in Edward J. Yoon's blog:

通常情况下,这是预计会出现在那里的大多数人,尽管许多机构的法定人数可能较低或较高.

Ordinarily, this is a majority of the people expected to be there, although many bodies may have a lower or higher quorum.

推荐答案

Zookeeper 要求您的服务器达到法定人数,其中法定人数为 ceil(N/2).对于 3 台服务器的集成,这意味着必须随时启动 2 台服务器,对于 5 台服务器的集成,则需要随时启动 3 台服务器.

Zookeeper requires that you have a quorum of servers up, where quorum is ceil(N/2). For a 3 server ensemble, that means 2 servers must be up at any time, for a 5 server ensemble, 3 servers need to be up at any time.

这篇关于ZooKeeper 可靠性 - 三节点对五节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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