原文链接
在root账户下创建zookeeper安装目录:
mkdir /home/zookeeper
进入zookeeper目录:
cd /home/zookeeper
通过wget命令下载zookeeper安装包:
wget https://mirrors.bfsu.edu.cn/apache/zookeeper/zookeeper-3.7.0/apache-zookeeper-3.7.0-bin.tar.gz
解决方式:
按照错误信息中提示的内容操作,命令后加 --no-check-certificate
完整命令:
wget https://dlcdn.apache.org/zookeeper/zookeeper-3.7.1/apache-zookeeper-3.7.1-bin.tar.gz --no-check-certificate
解压zookeeper安装包:
tar -xvzf apache-zookeeper-3.7.1-bin.tar.gz
tar -xvzf apache-zookeeper-3.7.1-bin.tar.gz
cd apache-zookeeper-3.7.1-bin/conf/
修改zoo_sample.cfg 为zoo.cfg:
mv zoo_sample.cfg zoo.cfg
编辑zoo.cfg配置文件:
①新建zookeeper数据存放目录:
mkdir /home/zookeeper/apache-zookeeper-3.7.1-bin/MyZkData
修改zookeeper的数据存放目录
vi zoo.cfg
tickTime=2000
initLimit=10
syncLimit=5
dataDir=/home/zookeeper/apache-zookeeper-3.7.1-bin/MyZkData
clientPort=2181
启动zookeeper服务端:
cd /home/zookeeper/apache-zookeeper-3.7.1-bin/bin
执行
./zkServer.sh start
安装成功
关闭防火墙:
systemctl stop firewalld
systemctl stop firewalld
systemctl status firewalld
连接zookeeper
./zkCli.sh