RE: ZooKeeper ensemble. Size and Impact ?

2015-07-14 Thread Rakesh R

ZooKeeper 3.5.1-alpha version will be released soon.
Hopefully by this(July) month, release candidate vote is progressing.

-Rakesh

-Original Message-
From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com] 
Sent: 14 July 2015 10:15
To: Rakesh; user@zookeeper.apache.org
Cc: Alexander Shraer
Subject: RE: ZooKeeper ensemble. Size and Impact ?

Thanks to all of you guys. I will try it out.

By any chance does anyone know when would the final/stable version of 3.5.0 be 
available. Because I can see it's in 3.5.0-alpha.

Thanks,
Srini
-Original Message-
From: Rakesh [mailto:rakeshr.apa...@gmail.com]
Sent: Tuesday, July 14, 2015 10:12 AM
To: user@zookeeper.apache.org; Srinivasan Veerapandian
Cc: Alexander Shraer
Subject: Re: ZooKeeper ensemble. Size and Impact ?

Thank you Alex for the info.

Hi Srini, I think Observer would be fine for your case. Probably you can try it 
out.

-Rakesh

On 13 Jul 2015 21:41, Alexander Shraer shra...@gmail.com wrote:

 In 3.4 releases you can't connect an observer to a standalone 
 zookeeper server, but in 3.5.0 if you set standaloneEnabled=false your 
 server will run in a distributed
 mode even if its the only one and
 you'll be able to have observers or reconfigure adding more servers 
 later if needed.

 On Mon, Jul 13, 2015 at 5:34 AM, Rakesh R rake...@huawei.com wrote: 

  
   Is it so that only ensemble would be down but other functions 
   would
  be up and running like data-sync ... ? 
  Say, if a ZooKeeper server lost connection with the quorum. It will 
  shutdown all the services and try to join the quorum by starting 
  internal election algo. There is a special type of read-only
  server, on connection lost, it will automatically transition to r-o 
  mode and serve only the requests from r-o client. Please visit 
  http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html for more 
  details about r-o feature.
  
   My need to run only 2 ZKS as I'm ok with have +1 copy of the data. 
  Is there a way to run a dummy ZKS in any of the instance ? 
  There is a typical 'Observer' server mode which will act as an 
  observer and only syncup data with the Leader server, but I'm not 
  really sure whether it will work along with Standalone server. I 
  haven't tried yet, probably you can do a try 
  http://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperObservers.html
  
  To begin with, you can run both as Participant and later if you want 
  to change servers you can use reconfig feature, 
  http://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html
  In 1+1 deployment, tolerated failure is 0 and you should ensure both 
  servers are up  running for the availability of ZooKeeper service.
  I could see one advantage of this approach is, you have a backup 'dataDir'.
  Administrator can use this if one is lost. 
  
  
  -Rakesh
  -Original Message-
  From: Srinivasan Veerapandian
  [mailto:srinivasan.veerapand...@ericsson.com
  ]
  Sent: 13 July 2015 15:01
  To: user@zookeeper.apache.org
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  Rakesh  Garry,
  
  
  
  Thanks for the information and details.  From both of your responses 
  I can see that, more failures will cause drop of quorum automatically.
  
  Is it so that only ensemble would be down but other functions would 
  be up and running like data-sync ... ? Sorry If this is very basic question.
  
  
  
  I see a note below note, does this means we can form ensemble with 
  leaderServes turned ON.
  
  Turning on leader selection is highly recommended when you have more 
  than three ZooKeeper servers in an ensemble.
  http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html
  
  My need to run only 2 ZKS as I'm ok with have +1 copy of the data. 
  Is there a way to run a dummy ZKS in any of the instance ?
  
  
  
  Thanks,
  
  Srini
  
  -Original Message-
  From: Rakesh R [mailto:rake...@huawei.com]
  Sent: Monday, July 13, 2015 1:43 PM
  To: user@zookeeper.apache.org; Srinivasan Veerapandian
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  
  
  Hi Srini,
  
  
  
  ZooKeeper service will be available if 'quorum' number of servers 
  are running(simple majority voting factors).
  
  
  
  I could see, one of the reason to get a majority vote is to avoid 
  split-brain problem. In a network failure we don't want the two 
  parts of the system to continue as usual. We need only one part to 
  continue and the other to understand that it is out of the cluster and keep 
  quiet.
  
  
  
  The main reason for suggesting odd number is, with even there won't 
  get much benefit to the tolerated failures in terms of majority.
  With 3 and 4 servers, we could see the majority is 2 and 3. But in 
  both the cases, the tolerated number of failure is 1.
  
  
  
  Quorum = Leader + Followers,
  
  (2n+1) nodes can tolerate failure of 'n' nodes. 
  
  
  
  For example,
  
  n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority

RE: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Rakesh R

 Is it so that only ensemble would be down but other functions would be up 
 and running like data-sync ... ? 
Say, if a ZooKeeper server lost connection with the quorum. It will shutdown 
all the services and try to join the quorum by starting internal election algo. 
There is a special type of read-only server, on connection lost, it will 
automatically transition to r-o mode and serve only the requests from r-o 
client. Please visit http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html 
for more details about r-o feature.

 My need to run only 2 ZKS as I'm ok with have +1 copy of the data. Is 
 there a way to run a dummy ZKS in any of the instance ?
There is a typical 'Observer' server mode which will act as an observer and 
only syncup data with the Leader server, but I'm not really sure whether it 
will work along with Standalone server. I haven't tried yet, probably you can 
do a try http://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperObservers.html

To begin with, you can run both as Participant and later if you want to change 
servers you can use reconfig feature, 
http://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html
In 1+1 deployment, tolerated failure is 0 and you should ensure both servers 
are up  running for the availability of ZooKeeper service. I could see one 
advantage of this approach is, you have a backup 'dataDir'. Administrator can 
use this if one is lost.


-Rakesh
-Original Message-
From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com] 
Sent: 13 July 2015 15:01
To: user@zookeeper.apache.org
Subject: RE: ZooKeeper ensemble. Size and Impact ?

Rakesh  Garry,



Thanks for the information and details.  From both of your responses I can see 
that, more failures will cause drop of quorum automatically.

Is it so that only ensemble would be down but other functions would be up and 
running like data-sync ... ? Sorry If this is very basic question.



I see a note below note, does this means we can form ensemble with  
leaderServes turned ON.

Turning on leader selection is highly recommended when you have more than three 
ZooKeeper servers in an ensemble. 
http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html

My need to run only 2 ZKS as I'm ok with have +1 copy of the data. Is there a 
way to run a dummy ZKS in any of the instance ?



Thanks,

Srini

-Original Message-
From: Rakesh R [mailto:rake...@huawei.com]
Sent: Monday, July 13, 2015 1:43 PM
To: user@zookeeper.apache.org; Srinivasan Veerapandian
Subject: RE: ZooKeeper ensemble. Size and Impact ?



Hi Srini,



ZooKeeper service will be available if 'quorum' number of servers are 
running(simple majority voting factors).



I could see, one of the reason to get a majority vote is to avoid split-brain 
problem. In a network failure we don't want the two parts of the system to 
continue as usual. We need only one part to continue and the other to 
understand that it is out of the cluster and keep quiet.



The main reason for suggesting odd number is, with even there won't get much 
benefit to the tolerated failures in terms of majority. With 3 and 4 servers, 
we could see the majority is 2 and 3. But in both the cases, the tolerated 
number of failure is 1.



Quorum = Leader + Followers,

(2n+1) nodes can tolerate failure of 'n' nodes.



For example,

n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority.

 - 2 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 0, if 0 failure will drop quorum automatically.



n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.

 - 4 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.



n=2, (2*2+1) - 5 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.

 - 6 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.



n=3, (2*3+1) - 7 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.

 - 8 servers = majority is 5. So it needs min 5 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.





-Rakesh



-Original Message-

From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com]

Sent: 13 July 2015 11:48

To: user@zookeeper.apache.orgmailto:user@zookeeper.apache.org

Subject: ZooKeeper ensemble. Size and Impact ?



Hi,



We know ZK demands odd number of servers to provide reliability.

My requirement on having zookeeper in my application is to know the 
application status from all the clients(Max 100).

And today my application can

RE: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Srinivasan Veerapandian
Rakesh  Garry,



Thanks for the information and details.  From both of your responses I can see 
that, more failures will cause drop of quorum automatically.

Is it so that only ensemble would be down but other functions would be up and 
running like data-sync ... ? Sorry If this is very basic question.



I see a note below note, does this means we can form ensemble with  
leaderServes turned ON.

Turning on leader selection is highly recommended when you have more than three 
ZooKeeper servers in an ensemble. 
http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html

My need to run only 2 ZKS as I'm ok with have +1 copy of the data. Is there a 
way to run a dummy ZKS in any of the instance ?



Thanks,

Srini

-Original Message-
From: Rakesh R [mailto:rake...@huawei.com]
Sent: Monday, July 13, 2015 1:43 PM
To: user@zookeeper.apache.org; Srinivasan Veerapandian
Subject: RE: ZooKeeper ensemble. Size and Impact ?



Hi Srini,



ZooKeeper service will be available if 'quorum' number of servers are 
running(simple majority voting factors).



I could see, one of the reason to get a majority vote is to avoid split-brain 
problem. In a network failure we don't want the two parts of the system to 
continue as usual. We need only one part to continue and the other to 
understand that it is out of the cluster and keep quiet.



The main reason for suggesting odd number is, with even there won't get much 
benefit to the tolerated failures in terms of majority. With 3 and 4 servers, 
we could see the majority is 2 and 3. But in both the cases, the tolerated 
number of failure is 1.



Quorum = Leader + Followers,

(2n+1) nodes can tolerate failure of 'n' nodes.



For example,

n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority.

 - 2 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 0, if 0 failure will drop quorum automatically.



n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.

 - 4 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.



n=2, (2*2+1) - 5 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.

 - 6 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.



n=3, (2*3+1) - 7 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.

 - 8 servers = majority is 5. So it needs min 5 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.





-Rakesh



-Original Message-

From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com]

Sent: 13 July 2015 11:48

To: user@zookeeper.apache.orgmailto:user@zookeeper.apache.org

Subject: ZooKeeper ensemble. Size and Impact ?



Hi,



We know ZK demands odd number of servers to provide reliability.

My requirement on having zookeeper in my application is to know the 
application status from all the clients(Max 100).

And today my application can support deployment 1+1(=2) to N+1(=100) Given this 
I would like to go with 2 ZK servers in two different instances because adding 
one more server for this purpose would be demand one more instance itself in my 
1+1 deployment model.



Questions:





1.   What would happen to ensemble formed ? Would the service goes down 
automatically ?



2.   What would be the impact if number ZK server instances are even (E.g. 
2)



How do I size a Zoo Keeper ensemble (cluster)?

https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ



Designing a Zoo Keeper Deployment

http://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html





Thanks,

Srini




Re: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Rakesh
Thank you Alex for the info.

Hi Srini, I think Observer would be fine for your case. Probably you can try it 
out.

-Rakesh

On 13 Jul 2015 21:41, Alexander Shraer shra...@gmail.com wrote:

 In 3.4 releases you can't connect an observer to a standalone zookeeper 
 server, but in 3.5.0 
 if you set standaloneEnabled=false your server will run in a distributed 
 mode even if its the only one and 
 you'll be able to have observers or reconfigure adding more servers later 
 if needed. 

 On Mon, Jul 13, 2015 at 5:34 AM, Rakesh R rake...@huawei.com wrote: 

  
   Is it so that only ensemble would be down but other functions would 
  be up and running like data-sync ... ? 
  Say, if a ZooKeeper server lost connection with the quorum. It will 
  shutdown all the services and try to join the quorum by starting internal 
  election algo. There is a special type of read-only server, on connection 
  lost, it will automatically transition to r-o mode and serve only the 
  requests from r-o client. Please visit 
  http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html for more 
  details about r-o feature. 
  
   My need to run only 2 ZKS as I'm ok with have +1 copy of the data. 
  Is there a way to run a dummy ZKS in any of the instance ? 
  There is a typical 'Observer' server mode which will act as an observer 
  and only syncup data with the Leader server, but I'm not really sure 
  whether it will work along with Standalone server. I haven't tried yet, 
  probably you can do a try 
  http://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperObservers.html 
  
  To begin with, you can run both as Participant and later if you want to 
  change servers you can use reconfig feature, 
  http://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html 
  In 1+1 deployment, tolerated failure is 0 and you should ensure both 
  servers are up  running for the availability of ZooKeeper service. I could 
  see one advantage of this approach is, you have a backup 'dataDir'. 
  Administrator can use this if one is lost. 
  
  
  -Rakesh 
  -Original Message- 
  From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com 
  ] 
  Sent: 13 July 2015 15:01 
  To: user@zookeeper.apache.org 
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  Rakesh  Garry, 
  
  
  
  Thanks for the information and details.  From both of your responses I can 
  see that, more failures will cause drop of quorum automatically. 
  
  Is it so that only ensemble would be down but other functions would be up 
  and running like data-sync ... ? Sorry If this is very basic question. 
  
  
  
  I see a note below note, does this means we can form ensemble with 
  leaderServes turned ON. 
  
  Turning on leader selection is highly recommended when you have more than 
  three ZooKeeper servers in an ensemble. 
  http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html 
  
  My need to run only 2 ZKS as I'm ok with have +1 copy of the data. Is 
  there a way to run a dummy ZKS in any of the instance ? 
  
  
  
  Thanks, 
  
  Srini 
  
  -Original Message- 
  From: Rakesh R [mailto:rake...@huawei.com] 
  Sent: Monday, July 13, 2015 1:43 PM 
  To: user@zookeeper.apache.org; Srinivasan Veerapandian 
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  
  
  Hi Srini, 
  
  
  
  ZooKeeper service will be available if 'quorum' number of servers are 
  running(simple majority voting factors). 
  
  
  
  I could see, one of the reason to get a majority vote is to avoid 
  split-brain problem. In a network failure we don't want the two parts of 
  the system to continue as usual. We need only one part to continue and the 
  other to understand that it is out of the cluster and keep quiet. 
  
  
  
  The main reason for suggesting odd number is, with even there won't get 
  much benefit to the tolerated failures in terms of majority. With 3 and 4 
  servers, we could see the majority is 2 and 3. But in both the cases, the 
  tolerated number of failure is 1. 
  
  
  
  Quorum = Leader + Followers, 
  
  (2n+1) nodes can tolerate failure of 'n' nodes. 
  
  
  
  For example, 
  
  n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority. 
  
   - 2 servers = majority is 2. So it needs min 2 servers to 
  form quorum. Tolerated failure is 0, if 0 failure will drop quorum 
  automatically. 
  
  
  
  n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers to 
  form quorum. Tolerated failure is 1, if 1 failures will drop quorum 
  automatically. 
  
   - 4 servers = majority is 3. So it needs min 3 servers to 
  form quorum. Tolerated failure is 1, if 1 failures will drop quorum 
  automatically. 
  
  
  
  n=2, (2*2+1) - 5 servers = majority is 3. So it needs min 3 servers to 
  form quorum. Tolerated failure is 2, if 2 failures will drop quorum 
  automatically. 
  
   - 6 servers = majority is 4. So it needs min 4 servers to 
  form quorum. Tolerated

RE: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Srinivasan Veerapandian
Thanks to all of you guys. I will try it out.

By any chance does anyone know when would the final/stable version of 3.5.0 be 
available. Because I can see it's in 3.5.0-alpha.

Thanks,
Srini
-Original Message-
From: Rakesh [mailto:rakeshr.apa...@gmail.com] 
Sent: Tuesday, July 14, 2015 10:12 AM
To: user@zookeeper.apache.org; Srinivasan Veerapandian
Cc: Alexander Shraer
Subject: Re: ZooKeeper ensemble. Size and Impact ?

Thank you Alex for the info.

Hi Srini, I think Observer would be fine for your case. Probably you can try it 
out.

-Rakesh

On 13 Jul 2015 21:41, Alexander Shraer shra...@gmail.com wrote:

 In 3.4 releases you can't connect an observer to a standalone 
 zookeeper server, but in 3.5.0 if you set standaloneEnabled=false your 
 server will run in a distributed
 mode even if its the only one and
 you'll be able to have observers or reconfigure adding more servers 
 later if needed.

 On Mon, Jul 13, 2015 at 5:34 AM, Rakesh R rake...@huawei.com wrote: 

  
   Is it so that only ensemble would be down but other functions 
   would
  be up and running like data-sync ... ? 
  Say, if a ZooKeeper server lost connection with the quorum. It will 
  shutdown all the services and try to join the quorum by starting 
  internal election algo. There is a special type of read-only 
  server, on connection lost, it will automatically transition to r-o 
  mode and serve only the requests from r-o client. Please visit 
  http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html for more 
  details about r-o feature.
  
   My need to run only 2 ZKS as I'm ok with have +1 copy of the data. 
  Is there a way to run a dummy ZKS in any of the instance ? 
  There is a typical 'Observer' server mode which will act as an 
  observer and only syncup data with the Leader server, but I'm not 
  really sure whether it will work along with Standalone server. I 
  haven't tried yet, probably you can do a try 
  http://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperObservers.html
  
  To begin with, you can run both as Participant and later if you want 
  to change servers you can use reconfig feature, 
  http://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html
  In 1+1 deployment, tolerated failure is 0 and you should ensure both 
  servers are up  running for the availability of ZooKeeper service. 
  I could see one advantage of this approach is, you have a backup 'dataDir'.
  Administrator can use this if one is lost. 
  
  
  -Rakesh
  -Original Message-
  From: Srinivasan Veerapandian 
  [mailto:srinivasan.veerapand...@ericsson.com
  ]
  Sent: 13 July 2015 15:01
  To: user@zookeeper.apache.org
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  Rakesh  Garry,
  
  
  
  Thanks for the information and details.  From both of your responses 
  I can see that, more failures will cause drop of quorum automatically.
  
  Is it so that only ensemble would be down but other functions would 
  be up and running like data-sync ... ? Sorry If this is very basic question.
  
  
  
  I see a note below note, does this means we can form ensemble with 
  leaderServes turned ON.
  
  Turning on leader selection is highly recommended when you have more 
  than three ZooKeeper servers in an ensemble.
  http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html
  
  My need to run only 2 ZKS as I'm ok with have +1 copy of the data. 
  Is there a way to run a dummy ZKS in any of the instance ?
  
  
  
  Thanks,
  
  Srini
  
  -Original Message-
  From: Rakesh R [mailto:rake...@huawei.com]
  Sent: Monday, July 13, 2015 1:43 PM
  To: user@zookeeper.apache.org; Srinivasan Veerapandian
  Subject: RE: ZooKeeper ensemble. Size and Impact ? 
  
  
  
  Hi Srini,
  
  
  
  ZooKeeper service will be available if 'quorum' number of servers 
  are running(simple majority voting factors).
  
  
  
  I could see, one of the reason to get a majority vote is to avoid 
  split-brain problem. In a network failure we don't want the two 
  parts of the system to continue as usual. We need only one part to 
  continue and the other to understand that it is out of the cluster and keep 
  quiet.
  
  
  
  The main reason for suggesting odd number is, with even there won't 
  get much benefit to the tolerated failures in terms of majority. 
  With 3 and 4 servers, we could see the majority is 2 and 3. But in 
  both the cases, the tolerated number of failure is 1.
  
  
  
  Quorum = Leader + Followers,
  
  (2n+1) nodes can tolerate failure of 'n' nodes. 
  
  
  
  For example,
  
  n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority. 
  
   - 2 servers = majority is 2. So it needs min 2 servers 
 to  form quorum. Tolerated failure is 0, if 0 failure will drop 
 quorum  automatically.
  
  
  
  n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers 
  to form quorum. Tolerated failure is 1, if 1 failures will drop 
  quorum automatically.
  
   - 4 servers

Re: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Alexander Shraer
In 3.4 releases you can't connect an observer to a standalone zookeeper
server, but in 3.5.0
if you set standaloneEnabled=false your server will run in a distributed
mode even if its the only one and
you'll be able to have observers or reconfigure adding more servers later
if needed.

On Mon, Jul 13, 2015 at 5:34 AM, Rakesh R rake...@huawei.com wrote:


  Is it so that only ensemble would be down but other functions would
 be up and running like data-sync ... ?
 Say, if a ZooKeeper server lost connection with the quorum. It will
 shutdown all the services and try to join the quorum by starting internal
 election algo. There is a special type of read-only server, on connection
 lost, it will automatically transition to r-o mode and serve only the
 requests from r-o client. Please visit
 http://zookeeper.apache.org/doc/trunk/zookeeperAdmin.html for more
 details about r-o feature.

  My need to run only 2 ZKS as I'm ok with have +1 copy of the data.
 Is there a way to run a dummy ZKS in any of the instance ?
 There is a typical 'Observer' server mode which will act as an observer
 and only syncup data with the Leader server, but I'm not really sure
 whether it will work along with Standalone server. I haven't tried yet,
 probably you can do a try
 http://zookeeper.apache.org/doc/r3.5.0-alpha/zookeeperObservers.html

 To begin with, you can run both as Participant and later if you want to
 change servers you can use reconfig feature,
 http://zookeeper.apache.org/doc/trunk/zookeeperReconfig.html
 In 1+1 deployment, tolerated failure is 0 and you should ensure both
 servers are up  running for the availability of ZooKeeper service. I could
 see one advantage of this approach is, you have a backup 'dataDir'.
 Administrator can use this if one is lost.


 -Rakesh
 -Original Message-
 From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com
 ]
 Sent: 13 July 2015 15:01
 To: user@zookeeper.apache.org
 Subject: RE: ZooKeeper ensemble. Size and Impact ?

 Rakesh  Garry,



 Thanks for the information and details.  From both of your responses I can
 see that, more failures will cause drop of quorum automatically.

 Is it so that only ensemble would be down but other functions would be up
 and running like data-sync ... ? Sorry If this is very basic question.



 I see a note below note, does this means we can form ensemble with
 leaderServes turned ON.

 Turning on leader selection is highly recommended when you have more than
 three ZooKeeper servers in an ensemble.
 http://zookeeper.apache.org/doc/r3.3.2/zookeeperAdmin.html

 My need to run only 2 ZKS as I'm ok with have +1 copy of the data. Is
 there a way to run a dummy ZKS in any of the instance ?



 Thanks,

 Srini

 -Original Message-
 From: Rakesh R [mailto:rake...@huawei.com]
 Sent: Monday, July 13, 2015 1:43 PM
 To: user@zookeeper.apache.org; Srinivasan Veerapandian
 Subject: RE: ZooKeeper ensemble. Size and Impact ?



 Hi Srini,



 ZooKeeper service will be available if 'quorum' number of servers are
 running(simple majority voting factors).



 I could see, one of the reason to get a majority vote is to avoid
 split-brain problem. In a network failure we don't want the two parts of
 the system to continue as usual. We need only one part to continue and the
 other to understand that it is out of the cluster and keep quiet.



 The main reason for suggesting odd number is, with even there won't get
 much benefit to the tolerated failures in terms of majority. With 3 and 4
 servers, we could see the majority is 2 and 3. But in both the cases, the
 tolerated number of failure is 1.



 Quorum = Leader + Followers,

 (2n+1) nodes can tolerate failure of 'n' nodes.



 For example,

 n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority.

  - 2 servers = majority is 2. So it needs min 2 servers to
 form quorum. Tolerated failure is 0, if 0 failure will drop quorum
 automatically.



 n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers to
 form quorum. Tolerated failure is 1, if 1 failures will drop quorum
 automatically.

  - 4 servers = majority is 3. So it needs min 3 servers to
 form quorum. Tolerated failure is 1, if 1 failures will drop quorum
 automatically.



 n=2, (2*2+1) - 5 servers = majority is 3. So it needs min 3 servers to
 form quorum. Tolerated failure is 2, if 2 failures will drop quorum
 automatically.

  - 6 servers = majority is 4. So it needs min 4 servers to
 form quorum. Tolerated failure is 2, if 2 failures will drop quorum
 automatically.



 n=3, (2*3+1) - 7 servers = majority is 4. So it needs min 4 servers to
 form quorum. Tolerated failure is 3, if 3 failures will drop quorum
 automatically.

  - 8 servers = majority is 5. So it needs min 5 servers to
 form quorum. Tolerated failure is 3, if 3 failures will drop quorum
 automatically.





 -Rakesh



 -Original Message-

 From: Srinivasan Veerapandian

RE: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Garry Turkington
Hi,

I claim no ZK expertise but did have a similar scenario so I'll share my 
conclusion and then the ZK experts can point out how wrong I am. :)

The odd number of servers requirement is because a ZK consensus can only be 
formed by an *absolute* majority of nodes in the ensemble. With an even number 
of servers fault-tolerance isn't as expected. A cluster of 4 nodes can only 
survive 1 server loss before the ensemble goes down. Which is the same as an 
ensemble of 3. The added server in the group of 4 gives no additional fault 
tolerance in terms of the number of live nodes.

An ensemble of 2 does though seem to be a special case in that it has a 
somewhat unintuitive quality; since it cannot survive the loss of either server 
(1 is *not* an absolute  majority of 2) then it seems that the availability of 
a 2-node ensemble is worse than a single node setup. If either node in the 
2-node ensemble is lost then the ensemble will  go down.

That's why when faced with a similar scenario to your own -- where 3 hosts was 
overkill/not available for the use case -- I went with a single node. 
Fortunately it was not a production  system...

Garry

-Original Message-
From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com] 
Sent: 13 July 2015 07:18
To: user@zookeeper.apache.org
Subject: ZooKeeper ensemble. Size and Impact ?

Hi,

We know ZK demands odd number of servers to provide reliability.
My requirement on having zookeeper in my application is to know the 
application status from all the clients(Max 100).
And today my application can support deployment 1+1(=2) to N+1(=100) Given this 
I would like to go with 2 ZK servers in two different instances because adding 
one more server for this purpose would be demand one more instance itself in my 
1+1 deployment model.

Questions:


1.   What would happen to ensemble formed ? Would the service goes down 
automatically ?

2.   What would be the impact if number ZK server instances are even (E.g. 
2)

How do I size a Zoo Keeper ensemble (cluster)?
https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ

Designing a Zoo Keeper Deployment
http://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html


Thanks,
Srini


-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2014.0.4821 / Virus Database: 4365/10205 - Release Date: 07/11/15


RE: ZooKeeper ensemble. Size and Impact ?

2015-07-13 Thread Rakesh R
Hi Srini,

ZooKeeper service will be available if 'quorum' number of servers are 
running(simple majority voting factors).

I could see, one of the reason to get a majority vote is to avoid split-brain 
problem. In a network failure we don't want the two parts of the system to 
continue as usual. We need only one part to continue and the other to 
understand that it is out of the cluster and keep quiet.

The main reason for suggesting odd number is, with even there won't get much 
benefit to the tolerated failures in terms of majority. With 3 and 4 servers, 
we could see the majority is 2 and 3. But in both the cases, the tolerated 
number of failure is 1.

Quorum = Leader + Followers,
(2n+1) nodes can tolerate failure of 'n' nodes.

For example, 
n=0, (2*0+1) - 1 server = standalone. Here there is no quorum majority.
 - 2 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 0, if 0 failure will drop quorum automatically.

n=1, (2*1+1) - 3 servers = majority is 2. So it needs min 2 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.
 - 4 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 1, if 1 failures will drop quorum automatically.

n=2, (2*2+1) - 5 servers = majority is 3. So it needs min 3 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.
 - 6 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 2, if 2 failures will drop quorum automatically.

n=3, (2*3+1) - 7 servers = majority is 4. So it needs min 4 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.
 - 8 servers = majority is 5. So it needs min 5 servers to form 
quorum. Tolerated failure is 3, if 3 failures will drop quorum automatically.


-Rakesh

-Original Message-
From: Srinivasan Veerapandian [mailto:srinivasan.veerapand...@ericsson.com] 
Sent: 13 July 2015 11:48
To: user@zookeeper.apache.org
Subject: ZooKeeper ensemble. Size and Impact ?

Hi,

We know ZK demands odd number of servers to provide reliability.
My requirement on having zookeeper in my application is to know the 
application status from all the clients(Max 100).
And today my application can support deployment 1+1(=2) to N+1(=100) Given this 
I would like to go with 2 ZK servers in two different instances because adding 
one more server for this purpose would be demand one more instance itself in my 
1+1 deployment model.

Questions:


1.   What would happen to ensemble formed ? Would the service goes down 
automatically ?

2.   What would be the impact if number ZK server instances are even (E.g. 
2)

How do I size a Zoo Keeper ensemble (cluster)?
https://cwiki.apache.org/confluence/display/ZOOKEEPER/FAQ

Designing a Zoo Keeper Deployment
http://zookeeper.apache.org/doc/r3.1.2/zookeeperAdmin.html


Thanks,
Srini