keepalived vrrp_script脚本不执行解决办法
各种找度娘不如好好看一遍日志系列
systemctl stop nginx
掉nginx以后,keepalived检测的脚本未正常执行,导致出现nginx服务异常,而keepalived主服务器(master)服务正常运行,导致vip无法进行正常漂移。
处理办法(其他情况还是可以找下度娘)
keepalived日志位置
- /var/log/messages;
- 打开日志观察:
tail -f /var/log/messages
; - 重启keepalived ,
systemctl restart keepalived.service
;
定位问题并调整
- 定位问题并调整keepalived.conf配置 【track_script 与 { 之间需要有空格】;
- 重启keepalived ,
systemctl restart keepalived.service
,恢复正常;