linux zookeeper 自启动服务
来源:互联网 发布:淘宝卖女装的店铺头像 编辑:程序博客网 时间:2024/05/23 19:10
项目中用到zookeeper,运维部门要重启机器,要项目组的人现场维护,哥表示懒得到现场,直接将zookeeper做成服务。
首先配置你的zookeeper.
下载,解压( 我的放在/usr/zookeeper下),配置zoo.cfg
zoo.cfg配置如下:
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5
# the directory where the snapshot is stored.
dataDir=/usr/zookeeper
# the port at which the clients will connect
clientPort=2181
在/usr/zookeeper下创建目录logs,mkdir /usr/zookeeper/logs
cp /usr/zookeeper/zookeeper-3.3.6/bin/zkServer.sh /etc/rc.d/init.d/zookeeper
cp /usr/zookeeper/zookeeper-3.3.6/bin/zkEnv.sh /etc/rc.d/init.d/zkEnv
编辑/etc/rc.d/init.d/zookeeper,修改如下:
#1.注释掉
# Only follow symlinks if readlink supports it
#if readlink -f "$0" > /dev/null 2>&1
#then
# ZOOBIN=`readlink -f "$0"`
#else
# ZOOBIN="$0"
#fi
#2.ZOOBINLINK指向/etc/rc.d/init.d/zookeeper
ZOOBINLINK=/etc/rc.d/init.d/zookeeper
#3.指向/usr/zookeeper/zookeeper-3.3.6/bin
ZOOBIN=/usr/zookeeper/zookeeper-3.3.6/bin
ZOOBINDIR=$ZOOBIN
#去掉后缀sh
. "$ZOOENVDIR"/zkEnv
修改/etc/rc.d/init.d/zkEnv
if [ "x$ZOOCFGDIR" = "x" ]
then
if [ -d "/etc/zookeeper" ]
then
ZOOCFGDIR="/etc/zookeeper"
else
#ZOOCFGDIR="$ZOOBINDIR/../conf"
ZOOCFGDIR="$ZOOBIN/../conf"
fi
fi
if [ "x${ZOO_LOG_DIR}" = "x" ]
then
#ZOO_LOG_DIR="."
ZOO_LOG_DIR="$ZOOBIN/../logs"
fi
配置启动级别
ln -s /etc/init.d/zookeeper /etc/rc3.d/K30zookeeper
ln -s /etc/init.d/zookeeper /etc/rc3.d/S70zookeeper
ln -s /etc/init.d/zookeeper /etc/rc5.d/K30zookeeper
ln -s /etc/init.d/zookeeper /etc/rc5.d/S70zookeeper
为所有用户添加执行权限
chmod -f 777 /etc/init.d/zookeeper
chmod -f 777 /etc/rc3.d/S70zookeeper
验证:
service zookeeper start
service zookeeper stop
service zookeeper status
- linux zookeeper 自启动服务
- linux安装zookeeper,并添加到服务开机自启动
- Linux下Zookeeper自启动
- Linux服务自启动
- linux服务自启动
- zookeeper注册服务,开机自启动
- 设置zookeeper开机自启动/服务化
- Linux下Zookeeper设置开启自启动
- 设置Linux自启动服务
- Linux 添加自启动服务
- 设置Linux自启动服务
- linux自启动服务设置
- Linux设置服务自启动
- linux 服务自启动设置
- Linux开机自启动服务
- Linux 添加自启动服务
- Linux服务自启动设置
- Linux服务开机自启动
- html5中web存储方式:
- android源码地址
- C++ 编写模板程序
- jacob操作word参考资料1
- asp.net调用前台js调用后台代码分享
- linux zookeeper 自启动服务
- Impala重点问题列表
- Java基础之随机打乱一个顺序数组
- linux下的文件查找——type whereis which find locate
- Ext.data.Store add/insert 执行后,绑定Grid 的序号不增加
- 用Scanner读取txt文件内容
- Linux系统检测工具(部分)
- google 公开一次性时间加密器算法:
- 论语3:八佾篇