Pre-requisites

Before starting with Zookeeper standalone installation, make sure that the node have the following pre-requisites:

a)  Supported Platforms: GNU/Linux, Win32, MacOSX, FreeBSD and Sun Solaris. This blog describes the installation steps for Linux.
b)  Sun Java 1.6 or above should already be installed. To install Java, you can refer to the installation steps mentioned in the blog.

Zookeeper Standalone Installation Steps

Follow the steps mentioned below for Zookeeper Standalone Installation:

1. Download the zookeeper tar from here.
2. Move the tar file to any directory like /opt. If you don’t have the permission to access to any system directory, then you can use your home directory for Zookeeper installation (/home/). Assuming the Zookeeper version to be 3.4.6, the command will look like:

mv zookeeper-3.4.6.tar.gz /opt

3. Extract the contents of the tar file.

tar -xzvf zookeeper-3.4.6.tar.gz
cd /opt/zookeeper-3.4.6

4. Configure the Zookeeper environment variables in system file “.bash_profile”:

Open or create .bash_profile in home folder of user:

nano ~/.bash_profile

Enter the following environment variables in this file:    

export ZOOKEEPER_HOME=/opt/zookeeper-3.4.6
export PATH=$PATH:$ZOOKEEPER_HOME/bin

Save the file opened in nano (ctrl+x -> y -> Enter).

Run below command to reflect environment variables in current session.

source ~/.bash_profile

5. Create a zoo.cfg file in conf folder:

nano /opt/zookeeper-3.4.6/conf/zoo.cfg

6. Add following in the file:

tickTime=2000
dataDir=/opt/zookeeperdata
clientPort=2181

tickTime: The time in millisecond used by zookeeper for heartbeats and session management. Minimum session timeout would be double the ticktime.
dataDir: The directory to store zookeeper data. It stores in-memory data snapshots and transaction logs of data updates.
clientPort: The port to be used for client connections.

7. Start zookeeper in standalone mode using:

zkServer.sh start

8. Check for the service “QuorumPeerMain” running for ZooKeeper using jps

ZooSnap

 

 

 

 

 

 

 


Related Blogs
Zookeeper Clustered Mode Installation

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *