View previous topic :: View next topic |
Author |
Message |
vad3r Guru
Joined: 02 May 2004 Posts: 461 Location: Munich, Germany
|
Posted: Tue Aug 03, 2004 6:59 pm Post subject: heartbeat cluster with custom failover script?? |
|
|
Hi all,
i was wondering if it's possible to intigrate a custom script to be executed when a failover takes place.
I try to find a solution for the "Split Brain" problem.
As the cluster runs on HP blade servers i can't use a stonith card. HP told me i can power off one node via the ILO-API by writing a shell script. So i have to get this "Shut down" script to be called by heartbeat on a Failover.
I really hope someone here can help me out
thanks
daniel |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Fri Jan 21, 2005 12:39 pm Post subject: |
|
|
I know its been a while since you posted this message.
Have you seen the ucarp package? Have a look at http://www.ucarp.org/
It is a daemon that can be on 2+ servers as an active/passive fail over.
When you start ucarp it has en election with other servers in the cluster and picks one of the to become the Master Node.
At a set timeslot, the slave nodes check the master node to check it responds. If it fails the remaining slave nodes have another election to select the next master node.
Each time a a node becomes a master or a slave you can run a script for each of the two modes. You can do anything you like in this script as its a bash script.
I'm using this along with daemontools to make sure the daemon doesn't fail. |
|
Back to top |
|
|
adelante Tux's lil' helper
Joined: 19 Apr 2003 Posts: 133 Location: South Africa - Johannesburg
|
Posted: Mon Feb 07, 2005 11:58 am Post subject: |
|
|
My question is..
if you have Comp1 and Comp2
Comp1 being the master
and
Comp2 being the slave
now Comp1 goes down, and obviously Comp2 takes the virtual ip address.
Now once Comp1 comes back up, will it notify Comp2 that its back up and that it must release the virtual ip back to Comp1? if so, how does it do this? |
|
Back to top |
|
|
richard.scott Veteran
Joined: 19 May 2003 Posts: 1497 Location: Oxfordshire, UK
|
Posted: Mon Feb 07, 2005 3:33 pm Post subject: |
|
|
Yes it should do,
It's all part of the VRRP protocol spec.
The slaves broadcast on a multicast address (like a network broadcast) to see if the master is there, if its not then all the slaves have an election and one takes over as master.
The same goes in reverse when the master comes back on line, the slaves get notification from the master and they swap roles.
ok, so that was a very simple answer
A better solution (in my opinion) is Keepalive Daemon which is part of the Linux Virtual Server project.
The keepalived also acts as a load balancer too
You'll need a gentoo-sources kernel as it has the lvs patches. There are bugs with versions prior to 1.1.9 so you'll have to tweak your ebuilds to install the latest version i.e.
Code: |
# cd /usr/portage/sys-cluster/keepalived
# cp keepalived-1.1.7.ebuild keepalived-1.1.9.ebuild
# ebuild keepalived-1.1.9.ebuild digest |
Once you've done that, the latest version available should be 1.1.9, however if you emerge sync you'll blow this new 1.1.9 ebuild away as it will be deleted in the update.
Let me know how you get on.
Rich. |
|
Back to top |
|
|
adelante Tux's lil' helper
Joined: 19 Apr 2003 Posts: 133 Location: South Africa - Johannesburg
|
Posted: Mon Feb 07, 2005 8:56 pm Post subject: |
|
|
thanks for the reply.
I think ucarp will be better suited for my needs because of the fact that i will be able to call a bash scripts which is mega plus.
I dont really need a load balancing server, just some redundancy when it comes to my firewall / routing servers. |
|
Back to top |
|
|
|