#!/bin/sh
. /etc/profile
. ~/.bash_profile


date=`date`
cd /usr/local/zookeeper
echo "$date star to monitor zookeeper" >> ./monitor.log
pid=`jps | grep 'QuorumPeerMain'`
if [ -z "$pid" ];then
    echo "find the zookeeper down" >> ./monitor.log
    cd bin
    ./zkServer.sh start
fi

 

 

同样配置cron定时任务监听zookeeper挂了后重启

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐