Apache ZooKeeper Single Server Setup on Ubuntu 14.04
Apache ZooKeeper is a software project of the Apache Software Foundation. It is essentially a distributed hierarchical key-value store, which is used to provide a distributed configuration service, synchronization service, and naming registry for large distributed systems. ZooKeeper was a sub-project of Hadoop but is now a top-level project in its own right.
ZooKeeper's architecture supports high availability through redundant services. The clients can thus ask another ZooKeeper leader if the first fails to answer. ZooKeeper nodes store their data in a hierarchical name space, much like a file system or a tree data structure. Clients can read from and write to the nodes and in this way have a shared configuration service. Updates are totally ordered.
1) A machine with Ubuntu 14.04 LTS operating system
2) Apache Hadoop 2.6.4 pre installed (How to install Hadoop on Ubuntu 14.04)
3) Apache ZooKeeper 3.4.6 software (Download Here)
ZooKeeper 3.4.6 Single Server setup on Ubuntu
Step 1 - Update. Open a terminal (CTRL + ALT + T) and type the following sudo command. It is advisable to run this before installing any package, and necessary to run it to install the latest updates, even if you have not added or removed any Software Sources.
Step 2 - Installing Java 7.
Step 3 - Edit $HOME/.bashrc file by adding the java path.
$HOME/.bashrc file. Add the following lines
Step 4 - Reload your changed $HOME/.bashrc settings
Step 5 - Creating zookeeper directory.
Step 6 - Change the ownership and permissions of the directory /usr/local/zookeeper. Here 'hduser' is an Ubuntu username.
Step 7 - Creating /zookeeper/data directory.
Step 8 - Change the ownership and permissions of the directory /usr/local/zookeeper/data. Here 'hduser' is an Ubuntu username.
Step 9 - Creating /zookeeper/log directory.
Step 10 - Change the ownership and permissions of the directory /usr/local/zookeeper/log. Here 'hduser' is an Ubuntu username.
Step 11 - Change the directory to /home/hduser/Desktop , In my case the downloaded zookeeper-3.4.6.tar.gz file is in /home/hduser/Desktop folder. For you it might be in /downloads folder check it.
Step 12 - Untar the zookeeper-3.4.6.tar.gz file.
Step 13 - Move the contents of zookeeper-3.4.6 folder to /usr/local/zookeeper
Step 14 - Change the directory to /usr/local/zookeeper/conf
Step 15 - Edit zoo.cfg file. If this file doesn't exists it will create one for you and it ll open for you to edit.
Step 16 - Add following lines to zoo.cfg file. Save and close.
Step 17 - Change the directory to /usr/local/zookeeper/bin
Step 18 - Start zookeeper server
Step 19 - Start client
Step 20 - Stop zookeeper server
Please share this blog post and follow me for latest updates on
Previous Post Next Post