1.解压到指定目录
[root@master package]# tar -zxvf zookeeper-3.4.9.tar.gz
2.修改Zookeeper的默认配置文件
2.1 先复制zoo.cfg配置
首先进入conf目录下,然后先复制 zoo_sample.cfg 并重命名为zoo.cfg。
[root@master zookeeper-3.4.9]# cd conf
[root@master conf]# ls
configuration.xsl log4j.properties zoo_sample.cfg
[root@master conf]# cp zoo_sample.cfg zoo.cfg
2.2 配置zoo.cfg
[root@master conf]# vim zoo.cfg
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
dataDir=/root/package/zookeeper-3.4.9/data
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
#maxClientCnxns=60
#
# Be sure to read the maintenance section of the
# administrator guide before turning on autopurge.
#
# http://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_maintenance
#
# The number of snapshots to retain in dataDir
#autopurge.snapRetainCount=3
# Purge task interval in hours
# Set to "0" to disable auto purge feature
#