zookeeper单机部署的配置及简单健康检查

来源:互联网 发布:java获取方法执行时间 编辑:程序博客网 时间:2024/05/21 09:00
单机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.
# do not use /tmp for storage, /tmp here is just 
# example sakes.
dataDir=/data/zookeeperdata
# the port at which the clients will connect
clientPort=2181
# the maximum number of client connections.
# increase this if you need to handle more clients
maxClientCnxns=10
crontab定时检测配置-------------
*/2 * * * * sh /root/script/startZK.sh
startZK.sh---------------------
if test $(pgrep -f zookeeper|wc -l) -eq 0
then
echo "zookeeper 未启动"
echo "zookeeper 启动中..."
cd /data/zookeeper/bin
./zkServer.sh start
echo "zookeeper 启动完成"
else
echo "zookeeper 已启动"
fi

0 0
原创粉丝点击