zookeeper 官网:https://zookeeper.apache.org/
下载地址: https://zookeeper.apache.org/releases.html

前置准备

Zookeeper运行在JVM之上,需要先安装JDK。

  1. # 1 获取jdk
  2. 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
  3. # 2 配置环境变量
  4. vi ~/.bash_profile
  5. JAVA_HOME=/home/liuhui/service/jdk1.8.0_333
  6. CLASSPATH=$JAVA_HOME/lib/
  7. PATH=$PATH:$JAVA_HOME/bin
  8. export PATH JAVA_HOME CLASSPATH
  1. wget --no-check-certificate https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz

单机安装

  1. # 备份配置文件
  2. cd /zookeeper_安装目录/config
  3. cp zoo_sample.cfg zoo.cfg
  4. # 修改配置文件
  5. dataDir=/home/liuhui/service/zookeeper_single/data/zookeeper # 指定数据文件目录