centos7安装zookeeper

一、下载并解压

下载地址

1
2
3
4
5
mkdir /usr/local/zookeeper
cd /usr/local/zookeeper
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz
tar -zxvf apache-zookeeper-3.7.0-bin.tar.gz
mv apache-zookeeper-3.7.0-bin apache-zookeeper-3.7.0

二、修改配置文件

1
2
3
cd apache-zookeeper-3.7.0/conf
cp zoo_sample.cfg zoo.cfg
vi zoo.cfg

结尾加上admin.serverPort=8090并保存(端口默认8080,不改也行)

三、环境变量

1
vi /etc/profile

在末尾添加以下后保存,如果path有值了,就加冒号在末尾追加

1
2
export ZOOKEEPER_HOME=/usr/local/zookeeper/apache-zookeeper-3.7.0
export PATH=$PATH:$ZOOKEEPER_HOME/bin

追加示例:

1
export PATH=$PATH:$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin

刷新配置文件

1
source /etc/profile

四、启动

1
zkServer.sh start

centos7安装zookeeper
https://blog.ctftools.com/2021/11/newpost-25/
作者
Dr3@m
发布于
2021年11月9日
许可协议