Skip to content

Install ZooKeeper Cluster



ZooKeeper is a distributed coordination service that is widely used in distributed systems. It is an open-source project that provides a centralized infrastructure and a naming registry for distributed applications. In this tutorial, we will explore how to install ZooKeeper in distributed mode.


Before installing ZooKeeper in distributed mode, you will need the following:

  • Multiple servers (minimum of 3) running a Unix-like operating system
  • Java installed on all servers
  • A ZooKeeper distribution package

Installing ZooKeeper in Distributed Mode

Follow the steps below to install ZooKeeper in distributed mode:

Step 1: Download and Extract ZooKeeper

Download the latest version of ZooKeeper from the official website and extract it to a directory on each server.

Step 2: Configure ZooKeeper

Create a configuration file named zoo.cfg in the conf directory of each server. The zoo.cfg file should contain the following configuration settings:


In the above configuration, replace ip_address1, ip_address2, and ip_address3 with the IP addresses of the three ZooKeeper servers. The tickTime configuration sets the length of a single tick in milliseconds. The dataDir configuration sets the directory where ZooKeeper will store its data. The clientPort configuration sets the port on which ZooKeeper will listen for client connections. The initLimit and syncLimit configurations set the number of ticks that ZooKeeper will wait before timing out. The server configuration sets the ID, IP address, and port number for each server.

Step 3: Start ZooKeeper

Start ZooKeeper on each server by running the following command:

bin/ start

Verify that ZooKeeper is running by running the following command:

bin/ -server ip_address1:2181

Replace ip_address1 with the IP address of one of the ZooKeeper servers. You should see the ZooKeeper command prompt if ZooKeeper is running correctly.


In this tutorial, we have covered how to install ZooKeeper in distributed mode. By following these steps, you can set up a distributed ZooKeeper cluster that can be used to manage coordination between distributed applications.

Leave your message