Ubuntu下安装zookeeper

半城伤御伤魂 提交于 2020-02-28 16:45:30

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

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!