美文网首页
CentOS安装zookeeper

CentOS安装zookeeper

作者: 你家门口的两朵云 | 来源:发表于2021-09-07 16:16 被阅读0次
一.解压配置

1.在/usr/local/新建zookeeper

mkdir /usr/local/zookeeper
cd /usr/local/zookeeper

2.将zk压缩包上传至这里
解压

tar zxvf apache-zookeeper-3.5.9-bin.tar.gz

3.进入解压文件夹apache-zookeeper-3.5.9-bin的conf目录修改配置文件
从zoo_sample.cfg复制一份重命名zoo.cfg即可;

[root@vm0 conf]# ls -a
.  ..  configuration.xsl  log4j.properties  zoo.cfg  zoo_sample.cfg

#文件内容为:
# The number of milliseconds of each tick
tickTime=2000
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between 
syncLimit=5
# example sakes.
dataDir=/tmp/zookeeper
# the port at which the clients will connect
clientPort=2181


image.png
二.运行zk

在bin目录下

[root@vm bin]# ./zkServer.sh start
ZooKeeper JMX enabled by default
Using config: /usr/local/zookeeper/apache-zookeeper-3.5.9-bin/bin/../conf/zoo.cfg
Starting zookeeper ... STARTED

1. 启动ZK服务:
./zkServer.sh start
2. 查看ZK服务状态:
./zkServer.sh status
3. 停止ZK服务:
./zkServer.sh stop
4. 重启ZK服务:
./zkServer.sh restart

相关文章

网友评论

      本文标题:CentOS安装zookeeper

      本文链接:https://www.haomeiwen.com/subject/ysdpwltx.html