how to install apache zookeeper in Linux

Hi Techrunnr Readers, this document deals with how to install apache zookeeper in linux.

Apache ZooKeeper is a software project of the Apache Software Foundation. It is essentially a centralized service for distributed systems to a hierarchical key-value store, which is used to provide a distributed configuration service, synchronization service, and naming registry for large distributed systems.

Prerequisites

* Linux machine with java installed, if not install follow here.

Installation

Step 1: Once you configured java in your Linux machine, download the latest zookeeper from the official site.

cd /opt/

 

wget http://mirrors.fibergrid.in/apache/zookeeper/zookeeper-3.4.10/zookeeper-3.4.10.tar.gz

 

Step 2: Extract the package

 tar -xvzf zookeeper-3.4.10.tar.gz

 

 

Step 3: Create the data folder

cd zookeeper-3.4.10

mkdir data

 

Step 4: Configure zookeeper as follows,

 

cd /opt/zookeeper-3.4.10/conf

 

cp zoo-sample.cfg zoo.cfg

 

Make zoo.cf looks like this

 

vi zoo.cf



tickTime = 2000

dataDir=/opt/zookeeper-3.4.10/data

clientPort = 2181

initLimit = 5

syncLimit = 2

 

 

step 5: Now zookeeper setup is ready. Now you can start zookeeper.


cd /opt/zookeep-3.4.10/bin

sh zkServer.sh start

 

OutPut

ZooKeeper JMX enabled by default

Using config: /opt/zookeeper-3.4.10/bin/../conf/zoo.cfg

Starting zookeeper ... STARTED

Step 6: Start CLI using the following command

 

sh bin/zkCli.sh

 

Step 7: Stop ZooKeeper Server

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

 

 bin/zkServer.sh stop

© 2018, Techrunnr. All rights reserved.

#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

Leave a Reply

Please wait...

Subscribe to our newsletter

Want to be notified when our article is published? Enter your email address and name below to be the first to know.