1:下载安装文件
zookeeper-3.4.9.tar.gz
2:解压到以下目录
/usr/local/services/zookeeper/zookeeper-3.4.9
3:进入conf目录,复制zoo_sample.cfg一份zoo.cfg,修改配置文件
tickTime=2000 initLimit=10 syncLimit=5 dataDir=/usr/local/services/zookeeper/zookeeper-3.4.9/data dataLogDir=/usr/local/services/zookeeper/zookeeper-3.4.9/logs clientPort=2181
4:修改/etc/profile文件
export ZOOKEEPER_HOME=/usr/local/services/zookeeper/zookeeper-3.4.9/ export PATH=$ZOOKEEPER_HOME/bin:$PATH export PATH
5:让配置文件生效
# source /etc/profile
6:启动服务
/zookeeper-3.4.9/bin# zkServer.sh start
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
7:查看状态
/zookeeper-3.4.9/bin# zkServer.sh status
8:重启
/zookeeper-3.4.9/bin# zkServer.sh status
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Mode: standalone
root@hd-master:/usr/local/services/zookeeper/zookeeper-3.4.9/bin# zkServer.sh restart
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Stopping zookeeper ... STOPPED
ZooKeeper JMX enabled by default
Using config: /usr/local/services/zookeeper/zookeeper-3.4.9/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED
来源:https://www.cnblogs.com/yshyee/p/6550101.html