High Availability and Failover with Centos 6.3
My aim is to setup a high-availability and failover setup for a webserver. I am a total newbie on this so I had quite a bit to read on this. I also followed a few tutorials/howtos on the web but without 100% success.
Here is my setup:
I have two machines with internal IPs, let's say: node01 192.168.10.82 and node02: 192.168.10.83
node01 also has a virtual IP 192.168.10.81, which is supposed to move between node01 and node02 in case of failover.
I have one external IP let's say: 96.xxx.xxx.xxx NAT'ed to 192.168.10.81
Both nodes have
Centos 6.3 minimal install
Here are the ha config files:
# cat /etc/ha.d/authkeys
2 sha1 test-ha
# cat /etc/ha.d/ha.cf
# cat /etc/ha.d/haresources
node01 192.168.10.81 httpd
If I shutdown heartbeat on node01, httpd automatically switches to node02.
However, if I shutdown just httpd on node01, the switch doesn't happen.
What I want to achieve is this:
If httpd fails, or mysqld fails, I want the virtual IP automatically switching to node01.
How can I achieve this?