1. 程式人生 > >Keepalived常見故障

Keepalived常見故障

keepalived

接到任務:

10.0.0.200 10.0.0.201

這個登錄一下,幫我測試一下 nginx那個keepalived的功能正常不

系統是centos7

keepalived 和 nginx 都可以重啟


測試:

1、pkill nignx後,故障切換一切正常,恢復nginx後也可以搶占回VIP

2、在修改nginx配置文件後,在pkill nginx,發現VIP不會飄到backup


再次排查所遇到的問題:

1.日誌提示:WARNING - script '/etc/keepalived/check_nginx.sh' is not executable for uid:gid 0:0 - disabling.

原因:backup上keepalived監控腳本沒有執行權限

解決:chmod +x /etc/keepalived/check_nginx.sh

2.日誌提示:/etc/keepalived/check_nginx.sh exited due to signal 15

解決:interval 5 #監控腳本的執行時間要大於advert_int(3秒不行就5秒)

advert_int 1 #心跳檢查間隔時間

3.如果是配置文件出錯,那麽在執行監控腳本時會輸出錯誤信息,所以要重定向到空

解決:/usr/local/openresty/nginx/sbin/nginx &>/dev/null


Keepalived常見故障