|
High Availability and Failover with Centos 6.3
Hi,
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
heartbeat-3.0.4-1
httpd 2
Here are the ha config files:
# cat /etc/ha.d/authkeys
auth 2
2 sha1 test-ha
# cat /etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 30
initdead 120
bcast eth0
udpport 694
auto_failback on
node node01
node node02
# cat /etc/ha.d/haresources
node01 192.168.10.81 httpd
SO FAR:
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?
Thanks!
|