There are two ways to install Zookeeper:
You can either use the apt-get method to install it like this:
$ sudo apt-get install zookeeperd
And if you want to install a particular version or stable versions, then follow the below steps:
To install Zookeeper, first download Zookeeper from this link:
Then go to the directory where this file is downloaded and extract the Zookeeper files:
$ cd Downloads
$ tar -xvf zookeeper-3.4.12.tar.gz
Now you must configure Zookeeper. To do this, go the Zookeeper directory and create a new directory name data.
Now you have to create a configuration file.
$ cd conf
$ nano zoo.cfg
and copy the follow entries in that file:
tickTime = 2000
dataDir = /path/to/zookeeper/data
clientPort = 2181
initLimit = 5
syncLimit = 2
NOTE: In the above entries, replace path/to/zookeeper with the path to the zookeeper directory.
Save and exit.
That’s it. Now to start zookeeper, go to the bin directory and run: