Results 1 to 6 of 6
Hello,
I would like to configure Heartbeat 2 in order to allowing the execution of a specific script at the statuts changing. In other words, I would like to execute ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-26-2009 #1Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
Heartbeat - Execute a script at status switching
Hello,
I would like to configure Heartbeat 2 in order to allowing the execution of a specific script at the statuts changing. In other words, I would like to execute /etc/ha.d/script_backup.sh when Heartbeat status becoming Backup and /etc/ha.d/script_master.sh when Heartbeat status becoming Master.
As instance, Carp (and Ucarp) work by default thanks this. I don't know exactly Heartbeat configuration system, but I think it is more focus on resources failover (where resources can be a service, an IP address, a daemon, etc.).
Just for information, I use Conntrack (and Conntrackd) with Heartbeat... Not with Keepalive.
Thanks for any help
S.
- 02-26-2009 #2Linux Newbie
- Join Date
- Feb 2009
- Posts
- 101
do you install heartbeat-ldirectord package?
if you want to change master server and startup some resource example service, ip, daemon, so you have to use ldirectord servcies. it's easy for use.
vi /etc/ha.d/ldirector.cf
## servername #### startup your ip address ### startup your daemon
master.station.com IPaddr::61.1.1.1/24/eth1:0 httpd
- 02-26-2009 #3Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
Thank you signmem. Actually resources switching work well on my two firewalls. I can for example share an IP thanks Heartbeat's resource switching.
But I would like to execute a script when Heartbeat become Master, and an other script when Heartbeat become Slave. I believe it's possible using Heartbeat options but I don't know which...
- 02-26-2009 #4Linux Newbie
- Join Date
- Feb 2009
- Posts
- 101
try to write one script your self.
example.
using dead loop script.
monitor your flooping ip link. if change, so runing script.
else, write script into /etc/rc.d/init.d <-- try to because one service ...
- 02-27-2009 #5Just Joined!
- Join Date
- Feb 2009
- Posts
- 4
Thank for your replay. But I do not understand, sorry. Anyway I'm continuing to search.
- 02-28-2009 #6Linux Newbie
- Join Date
- Feb 2009
- Posts
- 101
do you setup flooping ip ? like this
vi /etc/ha.d/ldirector.cf
## servername #### startup your ip address ### startup your daemon
master.station.com IPaddr::61.1.1.1/24/eth1:0 httpd
then if your computer become master... ip -> 61.1.1.1/24 would link up.
use this script:
#!/bin/bash
while [ 3 -eq 4 ]
do
ip=`ifconfig eth1:0 | grep Mask | awk '{print $2}' | awk -F: '{print $2}'`
if [ $ip != "61.1.1.1" ]
then
post your scripts here.
fi.
done


Reply With Quote
