Database Reference
In-Depth Information
Zookeeper configurations
Let's assume you have installed Zookeeper on all three Zookeeper nodes; now we will walk
you through the configurations so that you have a better understanding of them.
An excerpt from zoo.cfg , in our case, is located at <zookeep-
er_installation_dir>/ zookeeper-3.4.5/conf/ . The Zookeeper configur-
ations are as follows:
dataDir=/usr/local/zookeeper/tmp : This is the path where Zookeeper
stores its snapshots; these snapshots are actually the state log where the current
cluster state is maintained for the purpose of coordination. In the event of a failure,
these snapshots are used to restore the cluster to the last stable state. This directory
also contains a file containing a single entry called myID . This value starts from 1
and is different for each Zookeeper node, so we will keep it as follows:
zkp-1.mydomain.net - value of myId =1
zkp-2.mydomain.net - value of myId =2
zkp-3.mydomain.net - value of myId =3
Whenever you want to start from scratch, or when you upscale or downscale Storm
or Zookeeper clusters, it is recommended that you clean up this local.dir file
so that stale data is cleared.
clientPort=2182 : This configuration specifies the port on which the clients
build connections with Zookeeper:
server.1=zkp-1.mydomain.net:2888:3888
server.2=zkp-2. mydomain.net:2888:3888
server.3=zkp-3. mydomain.net:2888:3888
These three rows in the preceding code actually specify the IP or the names of the
servers that form a part of the Zookeeper cluster. In this configuration, we have
created the three-node Zookeeper cluster.
maxClientCnxns=30l : This number specifies the maximum number of con-
nections a single client can make with this Zookeeper node. Here is how the calcu-
lation will go in our case:
Search WWH ::




Custom Search