You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by chaitanya_r <ch...@yahoo.com> on 2014/04/03 20:45:16 UTC

What should be the majority in an ensemble for Zookeeper

I am trying to understand Zookeeper using this book -  Zookeeper By Flavio
Junqueira, Benjamin Reed <http://shop.oreilly.com/product/0636920028901.do> 
, it is mentioned that we need to select a majority of servers for quorum as
stated here:

"Say that we use four servers for an ensemble. A majority of servers is
comprised of three servers. However, this system will only tolerate a single
crash, because a double crash makes the system lose majority. Consequently,
with four servers, we can only tolerate a single crash, but quorums now are
larger, which implies that we need more acknowledgments for each request.
The bottom line is that we should always shoot for an odd number of
servers."

Please help me in understanding this.

How do we select the majority of servers for a given ensemble?

Why does this statement say quorums now are larger and why do we need more
acknowledgments for each request?



--
View this message in context: http://zookeeper-user.578899.n2.nabble.com/What-should-be-the-majority-in-an-ensemble-for-Zookeeper-tp7579721.html
Sent from the zookeeper-user mailing list archive at Nabble.com.

Re: What should be the majority in an ensemble for Zookeeper

Posted by Ivan Kelly <iv...@apache.org>.
On Thu, Apr 03, 2014 at 11:45:16AM -0700, chaitanya_r wrote:
> "Say that we use four servers for an ensemble. A majority of servers is
> comprised of three servers. However, this system will only tolerate a single
> crash, because a double crash makes the system lose majority. Consequently,
> with four servers, we can only tolerate a single crash, but quorums now are
> larger, which implies that we need more acknowledgments for each request.
> The bottom line is that we should always shoot for an odd number of
> servers."
>
> How do we select the majority of servers for a given ensemble?
A majority is half the servers plus one. It can be any subset of the
servers in the ensemble. In the case of 4 servers, a majority is any 3
((4/2) + 1) servers. If there were 20 servers in the ensemble, the
majority is 11 ((10/2) + 1). If there are 3 servers, the majority is 2
((3/2) + 1).

The point this paragraph is making is that having an even number of
servers in an ensemble is pointless. You don't increase fault
tolerance, but the number of machines you must communicate with to
agree on an update is higher.

For example, with an ensemble of 3, you have to communicate with 2
machines, and can tolerate 1 failure. With an ensemble of 4, you have
to communicate with _3_ machines, but can still only tolerate 1
failure. With an ensemble of 5, you have to communicate with only 3,
but now you can tolerate 2 failures.

-Ivan

Re: What should be the majority in an ensemble for Zookeeper

Posted by Maciej Smoleński <je...@gmail.com>.
I think the author wants to compare 3-servers system with 4-servers 
system.
In a 3-servers system the quorum consists of 2 servers and system 
tolerates 1-server crash.
In a 4-servers system the quorum consists of 3 servers and system 
tolerates also 1-server crash.
In general system works by sending messages among the quorum of servers.
It means that 3-servers system is better - as it tolerates the same 
number of crashes, but quorum there is smaller. In consequence in 
3-servers system will be less messages in the network - servers will 
wait for less acknowledgments to collect - the latency and throughput 
should be better.

Dnia 4 kwiecień 2014 15:40:18 chaitanya_r pisze:
> Can someone please help me in understanding this basic thing.
>
>
>
> --
> View this message in context: http://zookeeper-user.578899.n2.nabble.com/What-should-be-the-majority-in-an-ensemble-for-Zookeeper-tp7579721p7579728.html
> Sent from the zookeeper-user mailing list archive at Nabble.com.

Re: What should be the majority in an ensemble for Zookeeper

Posted by chaitanya_r <ch...@yahoo.com>.
Can someone please help me in understanding this basic thing.



--
View this message in context: http://zookeeper-user.578899.n2.nabble.com/What-should-be-the-majority-in-an-ensemble-for-Zookeeper-tp7579721p7579728.html
Sent from the zookeeper-user mailing list archive at Nabble.com.

RE: What should be the majority in an ensemble for Zookeeper

Posted by FPJ <fp...@yahoo.com>.
I think there is quite a bit of confusion here. You don't select a majority,
the system does it for you. The only thing you need to select is the total
number of servers, and the text you're quoting is just trying to convince
you to use an odd number instead of an even number of servers.

Use 3 servers (total) if you want to tolerate one faulty server, 5 if you
want to tolerate 2 faulty servers, 7 if you want to tolerate 3 and so on.

Hope it is a bit better now.

-Flavio

> -----Original Message-----
> From: chaitanya_r [mailto:chaitanya_spring@yahoo.com]
> Sent: 03 April 2014 19:45
> To: zookeeper-user@hadoop.apache.org
> Subject: What should be the majority in an ensemble for Zookeeper
> 
> I am trying to understand Zookeeper using this book -  Zookeeper By Flavio
> Junqueira, Benjamin Reed
> <http://shop.oreilly.com/product/0636920028901.do>
> , it is mentioned that we need to select a majority of servers for quorum
as
> stated here:
> 
> "Say that we use four servers for an ensemble. A majority of servers is
> comprised of three servers. However, this system will only tolerate a
single
> crash, because a double crash makes the system lose majority.
> Consequently, with four servers, we can only tolerate a single crash, but
> quorums now are larger, which implies that we need more
> acknowledgments for each request.
> The bottom line is that we should always shoot for an odd number of
> servers."
> 
> Please help me in understanding this.
> 
> How do we select the majority of servers for a given ensemble?
> 
> Why does this statement say quorums now are larger and why do we need
> more acknowledgments for each request?
> 
> 
> 
> --
> View this message in context: http://zookeeper-
> user.578899.n2.nabble.com/What-should-be-the-majority-in-an-ensemble-
> for-Zookeeper-tp7579721.html
> Sent from the zookeeper-user mailing list archive at Nabble.com.