Set Up a Zookeeper Cluster
Zookeeper v3.6.13 Cluster Setup
Zookeeper is a coordination service that allows for easy management of common services like naming, configuration management, synchronization and group services.
When installed with Incorta, there must be a Zookeeper instance on each Incorta node. Use the following steps to configure Zookeeper with Incorta.
The following steps anticipate that the Zookeeper cluster is set up with the following information:
- On each Incorta node, navigate to the Incorta Incorta installation’s Zookeeper folder.
- Create a folder named data and navigate to that folder.
- Under data, create a file named myid.
The myid file must contain a numeric value that uniquely identifies the Zookeeper node.
\$ echo 12345 > myid
- Navigate to the Zookeeper conf directory and locate the zoo.cfg configuration file.
- Edit the zoo.cfg file to match the following:
tickTime=5000 dataDir=<PATH TO THE DATA DIRECTORY CREATED EARLIER> clientPort=2181 initLimiit=5 syncLimt=2 server.12345=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888 server.4=zoo4:2888:3888
Use the following properties and valid values:
- tickTime: The basic time unit in milliseconds used by ZooKeeper. It is used to do heartbeats and the minimum session timeout will be twice the tickTime. In this example, the timeout for initLimit is 5 ticks at 2000 milliseconds a tick, or 10 seconds.
- dataDir: The location to store the in-memory database snapshots.
- clientPort: The port to listen for client connections.
- initLimit: Timeouts ZooKeeper uses to limit the length of time the ZooKeeper servers have to connect to a leader.
- syncLimit: Limits how far out of date a server can be from a leader.
- server.X: The entries of the form server.X(X stands for the server ID which the numeric value that identifies a Zookeeper node, saved earlier in the myidfile) list the servers that make up the ZooKeeper service. When the server starts up, it knows which server it is by looking for the file myid in the data directory. That file contains the server number. Regarding the two port numbers after each server name: 2888and 3888. Peers use the former port to connect to other peers (i.e. 2888). The other port number (i.e. 3888) is for leader election.
If your Zookeeper cluster is setup as follows:
|Server ID||Node IP||Client Port||P2P Port||Leader Election Port|
With this configuration, the Incorta system tenant configuration key com.incorta.zk must have the following value:
Start Zookeeper with the command:
Connect Zookeeper’s cluster with the command:
bin/zkCli.sh -server 126.96.36.199:2181,188.8.131.52:2181,184.108.40.206:2181,220.127.116.11:2181
When you identify servers by name, these names need to be resolvable from each Zookeeper node. Ping the other servers by their names to make sure their names are resolvable.
You must configure each machine hosting a Zookeeper node to allow inbound/outbound connections between all Zookeeper nodes for the client, P2P, and Leader election ports (ports 2181, 2888 and 3888). Other process must not use for each Zookeeper node are not used by any other process.
When a Zookeeper node is started, a directory named name version-2 is automatically created in the configured data directory. When this does not occur the node has not started.
A file named
zookeeper.out exists on top of the Zookeeper folder. This file contains useful logs in when debugging Zookeeper starting issues.
Use the Linux command
echo srvr | nc localhost 2181 for the role of the tested node, whether it’s a leader or a follower node. The message “This ZooKeeper instance is not currently serving requests” message indicates that this node started but is not functioning.