From fa829708f2a2afc3546182866f81e83819ffeff9 Mon Sep 17 00:00:00 2001 From: Tomas Barton Date: Wed, 15 Apr 2015 07:58:41 +0200 Subject: [PATCH] updated documentation for #18 workaround --- README.md | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0b4191d..bbc42ff 100644 --- a/README.md +++ b/README.md @@ -17,16 +17,31 @@ A puppet receipt for [Apache Zookeeper](http://zookeeper.apache.org/). ZooKeeper class { 'zookeeper': } ``` -### Quorum +## Cluster setup -For setting up a quorum of ZooKeeper you should list all nodes in the quorum: +When running ZooKeeper in the distributed mode each node must have unique ID (`1-255`). The easiest way how to setup multiple ZooKeepers, is by using Hiera. + +`hiera/host/zk1.example.com.yaml`: +```yaml +zookeeper::id: '1' +``` +`hiera/host/zk2.example.com.yaml`: +```yaml +zookeeper::id: '2' +``` +`hiera/host/zk3.example.com.yaml`: +```yaml +zookeeper::id: '3' +``` +A ZooKeeper quorum should consist of odd number of nodes (usually `3` or `5`). +For defining a quorum it is enough to list all IP addresses of all its members. ```puppet class { 'zookeeper': servers => ['192.168.1.1', '192.168.1.2', '192.168.1.3'] } ``` -Currently first ZooKeeper will have `ID = 1`. This would produce following configuration: +Currently, first ZooKeeper in the array above, will be assigned `ID = 1`. This would produce following configuration: ``` server.1=192.168.1.1:2888:3888 server.2=192.168.1.2:2888:3888