How To Install Apache ZooKeeper on CentOS 7

Install Apache ZooKeeper on CentOS 7

In this tutorial we will show you how to install Apache ZooKeeper on CentOS 7 server. For those of you who didn’t know,Zookeeper is brief is a distributed state manager that may be employed by many clusters to keep state across its clusters. Like HBase can utilize Zookeeper to keep state across its own set of clusters without having to have cluster country within it.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step install Apache ZooKeeper on CentOS 7 server.

Install Apache ZooKeeper

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Installing Java.

At the time of writing this tutorial, the latest Java JDK version was JDK 8u45. First, let us download the latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell:

After extracting archive file use alternatives command to install it. alternatives command is available in chkconfig package:

At this point JAVA 8 (JDK 8u45) has been successfully installed on your system. We also recommend to setup javac and jar commands path using alternatives:

Checking Installed java version:

We can easily set the environment variables using the export command as shown below:

Setup JAVA_HOME Variable:

Setup JRE_HOME Variable:

Setup PATH Variable:

Step 3. Install Apache ZooKeeper.

First, install ZooKeeper framework on your machine, visit the following link and download the latest version of ZooKeeper:

Next, Open the configuration file named conf/zoo.cfg and all the following parameters to set as starting point:

Then, start ZooKeeper server:

After executing this command, you will get a response as follows:

Next step, Start CLI type the following command:

After typing the above command, you will be connected to the ZooKeeper server and you should get the following response:

After connecting the server and performing all the operations, you can stop the zookeeper server by using the following command:

Congratulation’s! You have successfully installed Apache ZooKeeper on CentOS 7. Thanks for using this tutorial for installing Apache ZooKeeper on CentOS 7 systems. For additional help or useful information, we recommend you to check the official Apache ZooKeeper web site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!