直接下载这个:
使用wget下载:
wget https://downloads.apache.org/zookeeper/stable/apache-zookeeper-3.6.3-bin.tar.gz
tar -zxvf apache-zookeeper-3.6.3-bin.tar.gz
mv apache-zookeeper-3.6.3-bin zookeeper
进入zookeeper目录,创建数据+日志文件
cd zookeeper/ mkdir dataDir mkdir dataLogDir
进入配置目录,修改配置文件
cd conf vi zoo.cfg
按i修改文件地址为:
修改完成,按:wq 保存
修改环境变量
vi /etc/profile #ZOOKEEPER_HOME export ZOOKEEPER_HOME=/usr/local/software/zookeeper export PATH=$ZOOKEEPER_HOME:/bin:$PATH
使环境变量生效:
source /etc/profile
首先切换到zookeeper的bin目录下,执行如下命令:
cd bin ./zkServer.sh start
启动成功
./zkServer.sh status
运行正常
关闭,未运行服务
./zkServer.sh stop