從ZooKeeper FAQ:動物園管理員可靠性 - 3與五個節點
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臺服務器?或者它不僅僅是正在考慮的服務中斷?
更新:
感謝@sbridges的指出它與保持法定人數做。這ZK規定的法定人數的方式是ceil(N/2)
其中N
是在合奏(而不僅僅是當前可用集)的原號。現在
,一個谷歌搜索ZK法定人數認爲這在HBase的書chapter on ZK:
在動物園管理員,支持偶數的同齡人,但它通常是 不使用,因爲即使規模合奏要求,按比例,更多 同行形成的法定人數超過奇數大小的合奏需求。對於 例如,具有4對等體的集合需要3以形成仲裁,而 用5合奏也需要3以形成一個仲裁。因此,5合奏 允許2名同行失敗並仍然保持仲裁,因此是更 故障比4的總體,只允許1向下對等寬容。
和Edward J.尹的blog這個意譯維基百科:
通常情況下,這是一個多數派在那裏, 雖然許多機構可能有更低或更高的法定人數的人。
會是什麼「計劃的維護」的例子嗎? – user1870400