标签:local list $nf amp start lock star 提示 cluster
计划任务
crontab -e
*/1 * * * * sudo sh /root/redis/redis_cluster/7003-cron.sh
脚本
#!/bin/sh
redis=`netstat -an | grep ":7003" | awk ‘$1 == "tcp" && $NF == "LISTEN" {print $0}‘ | wc -l`
if [ $redis -eq 0 ];then
#端口被占用执行如下
sudo /root/redis/redis_cluster/start_all.sh.sh
else
#端口被占用提示如下
echo "运行正常!"
fi
启动脚本
cd /root/redis/redis_cluster/7000
/usr/local/bin/redis-server redis.conf
cd /root/redis/redis_cluster/7001
/usr/local/bin/redis-server redis.conf
cd /root/redis/redis_cluster/7005
/usr/local/bin/redis-server redis.conf
标签:local list $nf amp start lock star 提示 cluster
原文地址:https://blog.51cto.com/13555423/2573005