服务器:阿里云
zookeeper:3.4.11
================================================================================================
1,安装jdk1.8(不做叙述)
2,安装zookeeper
步骤:
1,在zookeeper官网下载zookeeper
2,上传到linux服务器上
3,解压zookeeper
4,把zookeeper文件夹转移到/usr/local下(一般安装文件都会移动到这个目录)
5,添加环境变量(包括了jdk的环境变量和zookeeper的)
export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL
export JAVA_HOME=/usr/local/jdk8
export ZOOKEEPER_HOME=/usr/local/zookeeper
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$JAVA_HOME/bin:$ZOOKEEPER_HOME/bin:$PATH
6,进入zookeeper的目录,进入conf下找到zoo_sample.cfg,复制该文件名为zoo.cfg
7,进入zoo.cfg,修改dataDir=/tmp/zookeeper
改为
dataDir=/usr/local/zookeeper/dataDir
dataLogDir=/usr/local/zookeeper/dataLogDir
8,进入对应的目录下新建7步骤的两个文件夹
9,进入bin目录,找到zkServer.sh
输入命令 zkServer.sh start 启动zookeeper
zkServer.sh stop 停止zookeeper
zkServer.sh restart 重启zookeeper
原文地址:https://www.cnblogs.com/huangtao1927/p/8907276.html