文章目录
1下载安装zookeeper
1.1、下载zookeeper
网址 https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/
wget https://archive.apache.org/dist/zookeeper/zookeeper-3.4.11/zookeeper-3.4.11.tar.gz
1.2、解压
1.3、移动到指定位置并改名为zookeeper
2、开机启动zookeeper
2.1复制如下脚本
#!/bin/bash
#chkconfig:2345 20 90
#description:zookeeper
#processname:zookeeper
ZK_PATH=/usr/local/zookeeper
export JAVA_HOME=/usr/local/java/jdk1.8.0_171
case $1 in
start) sh $ZK_PATH/bin/zkServer.sh start;;
stop) sh $ZK_PATH/bin/zkServer.sh stop;;
status) sh $ZK_PATH/bin/zkServer.sh status;;
restart) sh $ZK_PATH/bin/zkServer.sh restart;;
*) echo "require start|stop|status|restart" ;;
esac
2.2 把脚本注册为Service
2.3 增加权限
3、配置zookeeper
3.1、初始化zookeeper配置文件
拷贝/usr/local/zookeeper/conf/zoo_sample.cfg
到同一个目录下改个名字叫zoo.cfg