#!/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挂了后重启