zookeeper 官网:https://zookeeper.apache.org/
下载地址: https://zookeeper.apache.org/releases.html
前置准备
Zookeeper运行在JVM之上,需要先安装JDK。
# 1 获取jdk
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" https://download.oracle.com/otn/java/jdk/8u333-b02/2dee051a5d0647d5be72a7c0abff270e/jdk-8u333-linux-x64.tar.gz?AuthParam=1656489129_f8448cd782f54a57fa99267412d73bbe
# 2 配置环境变量
vi ~/.bash_profile
JAVA_HOME=/home/liuhui/service/jdk1.8.0_333
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
wget --no-check-certificate https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz
单机安装
# 备份配置文件
cd /zookeeper_安装目录/config
cp zoo_sample.cfg zoo.cfg
# 修改配置文件
dataDir=/home/liuhui/service/zookeeper_single/data/zookeeper # 指定数据文件目录