Is the issue here that I am just using the wrong scripts to check on the machine itself if the master is working fine,
Sim.
For example when we had a issue where the system was swapping all the time. The load was 25 instead of the normal 5 and there was no way to ssh into the machine. Ping was working. Keepalived kept running and the virtual IP adress was not taken over by the other slave.
Você já tentou escrever seu próprio script para verificar a média de carga, algo assim:
#!/bin/bash
LOAD=$(/command/to/get/the/load/average)
if [ $LOAD -ge 25 ]; then
exit 1
else
exit 0
fi
use-o como track_script
:
vrrp_script check_load {
script "/path/to/check_load.sh"
interval 2
weight 2
}
vrrp_instance VI_1 {
state BACKUP
nopreempt
...
authentication {
auth_type PASS
auth_pass Neifeaw7
}
virtual_ipaddress {
192.168.6.8
}
track_script {
check_load
}
}
Mas espere, o que acontece se o IP virtual for comutado com muita frequência?