下载地址:http://mirror.bit.edu.cn/apache/zookeeper/zookeeper-3.5.5/apache-zookeeper-3.5.5-bin.tar.gz
解压:sudo tar -zxf apache-zookeeper-3.5.5-bin.tar.gz -C /usr/local/
修改配置文件:
cd /usr/local/apache-zookeeper-3.5.5-bin/conf/
cp zoo_sample.cfg zoo.cfg
vim zoo.cfg
打开配置zoo.cfg中修改端口,防止被占用 很容易就和tomcat的端口占用
admin.serverPort=(未被占用的端口)
添加环境变量: vim ~/.bashrc
exportZOOKEEPER_HOME=/usr/local/apache-zookeeper-3.5.5-bin
exportPATH=$ZOOKEEPER_HOME/bin:$PATH
source ~/.bashrc
启动
zkServer.sh start
验证
zkServer.sh status
注意检查是否关闭防火墙
systemctl status firewalld.service 查看防火墙
systemctl stop firewalld.service#关闭防火墙
systemctldisablefirewalld.service#禁止启动防火墙
如果不知道怎么找到错误.请查看logs中的日志
网友评论