本文共 287 字,大约阅读时间需要 1 分钟。
#!/bin/sh
while true do ping -c 2 -w 3 10.0.0.7 &>/dev/null if [ $? -eq 0 -a `ip add|grep 10.0.0.17|wc -l` -eq 1 ] then echo "ha is split brain.warning."mail -s 异常告警-keepalived xxxxxx@qq.com else echo "ha is ok" fi sleep 5 done#可以ping通主,备节点有VIP就认为裂脑
#10.0.0.7keeplived 主节点 10.0.0.17 VIP转载地址:http://hhepb.baihongyu.com/