Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
heartbeat cluster with custom failover script??
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
vad3r
Guru
Guru


Joined: 02 May 2004
Posts: 461
Location: Munich, Germany

PostPosted: Tue Aug 03, 2004 6:59 pm    Post subject: heartbeat cluster with custom failover script?? Reply with quote

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
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Fri Jan 21, 2005 12:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Mon Feb 07, 2005 11:58 am    Post subject: Reply with quote

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
View user's profile Send private message
richard.scott
Veteran
Veteran


Joined: 19 May 2003
Posts: 1497
Location: Oxfordshire, UK

PostPosted: Mon Feb 07, 2005 3:33 pm    Post subject: Reply with quote

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 :oops:

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
View user's profile Send private message
adelante
Tux's lil' helper
Tux's lil' helper


Joined: 19 Apr 2003
Posts: 133
Location: South Africa - Johannesburg

PostPosted: Mon Feb 07, 2005 8:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum