Environment : Amazon AWS , Red Hat linux VM with 1 CPU 1 GB RAM
ZOOKEEPER Version : 3.4.11
Step 1 : Download your Apache Zookeeper from one of the mirrors available in official ZOOKEEPER SITE
Step 2 : Copy the downloaded ( zookeeper-3.4.11.tar.gz ) file to the AWS / Google cloud servers using SCP/Winscp
( Example: scp -i "XXXXXX.pem" zookeeper-3.4.11.tar.gz ec2-user@ec2-xx-xx-xx-xx.us-east-2.compute.amazonaws.com:/home/ec2-user/. )
Step 3 : Or download the zookeeper directly on the servers using one of the available mirrors using WGET
( Example : sudo wget "http://mirror.cogentco.com/pub/apache/zookeeper/ " -O zoo.tar.gz )
Step 4 : Untar the zookeeper & create 'myid' file in the data directory which contains just zookeeper id ( example : 1 )
Step 5 : Need to create zoo.cfg file from zoo_sample.cfg and modify the following things
Step 6 : Add / modify following properties. Please mention your zookeeper port by default ( 2181 ) using clientPort attribute
Then add your cluster information if you plan to have 3 cluster servers add like below. All the servers info mention like below they communicate using internal IP repeat the same configuration for different servers but for if your adding this config change for server.1 make the internal ip as 0.0.0.0
clientPort=2181
server.1=0.0.0.0:2888:3888
server.2=:2888:3888
server.3=:2888:3888
These settings are for internal zookeeper communication who ever starts first will be the Leader in the cluster and rest are followers they will just sync up the data.
Whenever Leader fails one of the follower will become the leader
Step 7 : To start the zookeeper servers use following command in each server
./zookeeper-3.4.11/bin/zkServer.sh start
Step 8 : To check the status ./zookeeper-3.4.11/bin/zkServer.sh status . It will give information about whether the server is Leader or Follower
Important : Enable the TCP:2181 outbound ports on the cloud servers
I had setup the zookeeper cluster in AWS and Google Cloud. If you find any difficulties in setting please comment i will help you with issues
ZOOKEEPER Version : 3.4.11
Step 1 : Download your Apache Zookeeper from one of the mirrors available in official ZOOKEEPER SITE
Step 2 : Copy the downloaded ( zookeeper-3.4.11.tar.gz ) file to the AWS / Google cloud servers using SCP/Winscp
( Example: scp -i "XXXXXX.pem" zookeeper-3.4.11.tar.gz ec2-user@ec2-xx-xx-xx-xx.us-east-2.compute.amazonaws.com:/home/ec2-user/. )
Step 3 : Or download the zookeeper directly on the servers using one of the available mirrors using WGET
( Example : sudo wget "http://mirror.cogentco.com/pub/apache/zookeeper/ " -O zoo.tar.gz )
Step 4 : Untar the zookeeper & create 'myid' file in the data directory which contains just zookeeper id ( example : 1 )
Step 5 : Need to create zoo.cfg file from zoo_sample.cfg and modify the following things
Step 6 : Add / modify following properties. Please mention your zookeeper port by default ( 2181 ) using clientPort attribute
Then add your cluster information if you plan to have 3 cluster servers add like below. All the servers info mention like below they communicate using internal IP repeat the same configuration for different servers but for if your adding this config change for server.1 make the internal ip as 0.0.0.0
clientPort=2181
server.1=0.0.0.0:2888:3888
server.2=
server.3=
These settings are for internal zookeeper communication who ever starts first will be the Leader in the cluster and rest are followers they will just sync up the data.
Whenever Leader fails one of the follower will become the leader
Step 7 : To start the zookeeper servers use following command in each server
./zookeeper-3.4.11/bin/zkServer.sh start
Step 8 : To check the status ./zookeeper-3.4.11/bin/zkServer.sh status . It will give information about whether the server is Leader or Follower
Important : Enable the TCP:2181 outbound ports on the cloud servers
I had setup the zookeeper cluster in AWS and Google Cloud. If you find any difficulties in setting please comment i will help you with issues
Comments