查看/var/log/messages keepalived相關日誌,查看提示,是否沒有權限,script_security not enabled
1、確認腳本可以手動執行,是否有執行權限
2、keepalived配置文件是否省略了global_defs {},本地測試省去這段腳本不會執行,
加上後雖然還提示SECURITY VIOLATION - scripts are being executed but script_security not enabled.
但是腳本執行了,查看/var/log/messages 可看到 VRRP_Script(chk_mysql) succeeded
參考:
https://github.com/acassen/keepalived/issues/901