Hi,
 
We are deploying Linux HA on VMs. The problem is that we cannot use a serial 
cable as a heartbeat communication link, and we have to totally depend on the 
network. In case of network having connectivity issue, we will lose heartbeat 
communication and brain split will happen.
 
To prevent this from happening, I decide to put a script called pinggate into 
/etc/ha.d/haresources before the other resources:
------------------------------------------------------------------------
# cat pinggate
#!/bin/sh
gateway=10.0.0.1
case $1 in
        start)          if ! ping $gateway -c3; then
                                if  ps -ef | grep -v grep | grep heartbeat; then
                                        echo "shuting down heartbeat..."
                                        ps -ef|grep heartbeat |grep -v grep 
|awk '{print $2}' |xargs kill {};
                                fi
                        fi
                        ps -ef| grep -v grep |grep heartbeat || echo "hearbeat 
is stopped."
                        ;;
        stop)           true ;;
esac
exit 0;
---------------------------------------------------------------------------
 
what it does is when hb is lost, the slave will check if it can ping the 
gateway before it starts other resources. If ping gateway fails, it will kill 
heartbeat. Therefore, we make sure that brain split would not happen.
 
Please let me know if you see any problem in my logic.
 
By the way, does ipfail do the same thing? if I enable ipfail, will the slave 
check pinging a gateway before starting up resources?


Thanks.
 
Hai Tao
 


                                          
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to