Skip to content

Instantly share code, notes, and snippets.

@tmusabbir
Last active December 26, 2015 11:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmusabbir/7147628 to your computer and use it in GitHub Desktop.
Save tmusabbir/7147628 to your computer and use it in GitHub Desktop.
Install Replicated ZooKeeper in CentOS
Install Replicated ZooKeeper in CentOS
[root@ip-10-0-0-101 conf]# ls -l
total 12
-rw-r--r-- 1 501 games 535 Sep 30 2012 configuration.xsl
-rw-r--r-- 1 501 games 2161 Sep 30 2012 log4j.properties
-rw-r--r-- 1 501 games 808 Sep 30 2012 zoo_sample.cfg
[root@ip-10-0-0-101 conf]# mv zoo_sample.cfg zoo.cfg
[root@ip-10-0-0-101 download]# tar -zxvf zookeeper-3.4.5.tar.gz
127.0.0.1 localhost localhost.localdomain
10.0.0.101 ip-10-0-0-101
10.0.0.102 ip-10-0-0-102
10.0.0.103 ip-10-0-0-103
[root@ip-10-0-0-101 zookeeper]# vim myid
[root@ip-10-0-0-101 zookeeper]# tail myid
1
[root@ip-10-0-0-101 zookeeper]#
[root@ip-10-0-0-101 download]# mv zookeeper-3.4.5 zookeeper
[root@ip-10-0-0-101 download]# mv zookeeper-3.4.5 /etc/.
[root@ip-10-0-0-111 zookeeper]# bin/zkCli.sh -server 10.0.0.112
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/var/zookeeper
clientPort=2181
server.1=10.0.0.101:2888:3888
server.2=10.0.0.102:2888:3888
server.3=10.0.0.103:2888:3888
WatchedEvent state:SyncConnected type:None path:null
[zk: 10.0.0.102:2181(CONNECTED) 0] ls /
[zookeeper]
[zk: 10.0.0.102:2181(CONNECTED) 1] create /test null
Created /test
[zk: 10.0.0.102:2181(CONNECTED) 2] ls /
[test, zookeeper]
[zk: 10.0.0.102:2181(CONNECTED) 3] delete /test
[zk: 10.0.0.102:2181(CONNECTED) 4] ls /
[zookeeper]
[zk: 10.0.0.102:2181(CONNECTED) 5]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment