Engineering Leadership


Zookeeper provides cluster management for Hadoop.

In this post, I’m going to install Zookeeper in Pseudo mode, so please use these instructions for setting up a developer’s workstation, not for a production cluster.


The zookeeper package should already be installed, but we’ll double check.

sudo apt-get install zookeeper

Next, we’ll install the Zookeeper Server.

sudo apt-get install zookeeper-server

The following files are now installed:
/etc/zookeeper/conf/zoo.cfg: Zookeeper configuration file

sudo service zookeeper-server stop
sudo service zookeeper-server start

If you have installed Zookeeper before installing HBase, you will see the following error message:

Using config: /etc/zookeeper/conf/zoo.cfg
ZooKeeper data directory is missing at /var/lib/zookeeper fix the path or run initialize
invoke-rc.d: initscript zookeeper-server, action "start" failed.

You need to initialize Zookeeper when it’s installed before HBase.

sudo service zookeeper-server init

Now you can start Zookeeper.

sudo service zookeeper-server start

Additional Reading

3 thoughts on “Install Zookeeper for Cloudera Hadoop (CHD4) in Pseudo mode on Ubuntu 12.04 LTS

    1. akbarsahmed says:

      Double check that JAVA_HOME is set for the account that zookeeper is being run as.

      echo $JAVA_HOME

      Also, check your Java version:

      java -version

  1. Sushant says:

    Hi Akbar,
    I appreciate your efforts in providing such a valuable tutorial. JAVA_HOME has been set and I have java-6-oracle installed. But it seems sun java is req

    While installing zookeeper, I am facing following error:
    Setting up hbase-master (0.94.2+218-1.cdh4.2.1.p0.8~precise-cdh4.2.1) …
    Starting Hadoop HBase master daemon: +======================================================================+
    | Error: JAVA_HOME is not set and Java could not be found |
    | Please download the latest Sun JDK from the Sun Java web site |
    | > http://java.sun.com/javase/downloads/ < |
    | |
    | HBase requires Java 1.6 or later. |
    | NOTE: This script will find Sun Java whether you install using the |
    | binary or the RPM based installer. |
    invoke-rc.d: initscript hbase-master, action "start" failed.
    dpkg: error processing hbase-master (–configure):

    Pl. help.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: