阅读本文需要先阅读安装Zookeeper<准备>
新建目录
mkdir /usr/local/zookeeper
解压
cd zookeeper压缩包所在目录
tar -xvf zookeeper-3.4.12.tar.gz -C /usr/local/zookeeper
新建目录
mkdir /usr/local/zookeeper/zookeeper-3.4.12/data
配置文件准备
cp /usr/local/zookeeper/zookeeper-3.4.12/conf/zoo_sample.cfg /usr/local/zookeeper/zookeeper-3.4.12/conf/zoo.cfg
编辑(根据key修改value)
vim /usr/local/zookeeper/zookeeper-3.4.12/conf/zoo.cfg
# 数据保存目录 dataDir=/usr/local/zookeeper/zookeeper-3.4.12/data
进入bin目录
cd /usr/local/zookeeper/zookeeper-3.4.12/bin
启动
./zkServer.sh start
关闭
./zkServer.sh stop
查看状态
./zkServer.sh status
原文地址:https://www.cnblogs.com/huangyi-427/p/9310137.html
时间: 2024-10-07 23:37:33