赞
踩
https://downloads.apache.org/zookeeper/
这里下载的是:apache-zookeeper-3.8.0-bin.tar.gz 版本
在home目录下新建/zookeeper目录
cd /home/
mkdir zookeeper
将下载的压缩包上传到/home/zookeeper目录下
tar -zxvf apache-zookeeper-3.8.0-bin.tar.gz
在 /zookeeper目录下创建一个文件夹 zookeeperData 用来存放zookeeper 的数据文件
cd /home/zookeeper/
mkdir zookeeperData
#进入 /home/zookeeper/apache-zookeeper-3.8.0-bin/conf 目录
cd /home/zookeeper/apache-zookeeper-3.8.0-bin/conf
# 复制 zoo_sample.cfg 文件,并重命名为zoo.cfg 否则zookeeper不会生效
cp zoo_sample.cfg zoo.cfg
修改 dataDir 属性等于 /tmp/zookeeper 如下第13行所示
# 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 is stored.
# do not use /tmp for storage, /tmp here is just
# example sakes.
# 主要是这里<需要修改成zookeeper的数据文件目录>
dataDir=/home/zookeeper/zookeeperData
# 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
#autopurge.purgeInterval=1
修改后保存退出
cd /home/zookeeper/apache-zookeeper-3.8.0-bin/bin
./zkServer.sh start
./zkServer.sh stop
./zkServer.sh status
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。