3.9.3
":
http://zookeeper.apache.org/releases.htmlzkhost1
", "zkhost2
", and "zkhost3
"apache-zookeeper-3.9.3-bin.tar.gz
" in the folder you want to install ZooKeeper:$ tar -xf apache-zookeeper-3.9.3-bin.tar.gz -C /opt/
$ ln -s /opt/apache-zookeeper-3.9.3-bin/ /opt/zookeeper
$ chmod -R 755 /opt/apache-zookeeper-3.9.3-bin/ $ sudo chown -R mtitek:mtitek /opt/apache-zookeeper-3.9.3-bin/
$ sudo chown -R mtitek:mtitek /opt/zookeeper
zkhost1
", "zkhost2
", and "zkhost3
"), do the following:data
": "/opt/zookeeper/data
"$ mkdir /opt/zookeeper/data
data-log
": "/opt/zookeeper/data-log
"$ mkdir /opt/zookeeper/data-log
/opt/zookeeper/logs
"$ mkdir /opt/zookeeper/logs
/opt/zookeeper/conf/zoo_sample.cfg
" to "/opt/zookeeper/conf/zoo.cfg
"$ cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg
zkhost1
"):$ echo "1" > /opt/zookeeper/data/myid
zkhost2
"):$ echo "2" > /opt/zookeeper/data/myid
zkhost3
"):$ echo "3" > /opt/zookeeper/data/myid
conf/zoo.cfg
":dataDir
": dataDir=/opt/zookeeper/data
dataLogDir
": dataLogDir=/opt/zookeeper/data-log
server.1=zkhost1:2888:3888:participant;0.0.0.0:2181 server.2=zkhost2:2888:3888:participant;0.0.0.0:2181 server.3=zkhost3:2888:3888:participant;0.0.0.0:2181
clientPort
" and "clientPortAddress
".conf/zoo.cfg
" file.
They should be part of the ZooKeeper instances configuration (see above).zoo.cfg
" (/opt/zookeeper/conf/zoo.cfg
)# The number of milliseconds of each tick. tickTime=2000 # The number of ticks that the initial synchronization phase can take. initLimit=10 # The number of ticks that can pass between sending a request and getting an acknowledgement. syncLimit=5 # The directory where the snapshot data is stored. dataDir=/opt/zookeeper/data # The directory the transaction log of updates is stored. dataLogDir=/opt/zookeeper/data-log # the port at which the clients will connect: 2181 # the port address at which the clients will connect: 0.0.0.0 server.1=zkhost1:2888:3888:participant;0.0.0.0:2181 server.2=zkhost2:2888:3888:participant;0.0.0.0:2181 server.3=zkhost3:2888:3888:participant;0.0.0.0:2181
$ /opt/zookeeper/bin/zkServer.sh start
$ /opt/zookeeper/bin/zkServer.sh stop