下载zookeeper,http://archive.apache.org/dist/zookeeper/
解压到: /opt/zookeeper-3.4.6下载
把conf下的
zoo_sample.cfg
copy一份后重命名为:zoo.cfg
.文件中内容如下: syncLimit=5 initLimit=10 tickTime=2000 clientPort=2181 dataDir=/opt/zookeeper-3.4.6/data dataLogDir=/opt/zookeeper-3.4.6/logs
新建zookeeper-3.4.6下的data,log目录,然后
chmod u+x /opt/zookeeper-3.4.6/bin/*
新建shell脚本
startZookeeper.sh
在/opt/shell
文件夹下,chmod u+x /opt/shell/startZookeeper.sh
内容:
#!/bin/sh #to start zookeeper #set environment export ZOOKEEPER_INSTALL=/opt/zookeeper-3.4.6 export PATH=$PATH:$ZOOKEEPER_INSTALL/bin PID_FILE=$ZOOKEEPER_INSTALL/data/zookeeper_server.pid FLAG=$1 if [ "$FLAG" = "os_start" ] && [ -f "$PID_FILE" ] then rm $PID_FILE fi #start zookeeper $ZOOKEEPER_INSTALL/bin/zkServer.sh start
设置zookeeper开机启动
vim /etc/rc.local 在最后一行添加如下两句话 #start zookeeper /opt/shell/startZookeeper.sh
Linux_Ubuntu_安装zookeeper
文章作者:孙昊(Hulk)
发布时间:2016-03-15, 00:00:00
最后更新:2025-03-31, 06:09:50
原始链接:https://www.crazy-coder.cn/2016/03/15/zhong-jian-jian/linux-ubuntu-install-zookeeper/
许可协议: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。