The way I did it was to write a wrapper script for heartbeat.  At boot, 
both systems are named scalix.domain.tld.  When Heartbeat starts, it's 
actually called by a wrapper script, which does something like:

hostname -s scalix1.domain.tld # Sets the hostname to a unique string
/etc/init.d/heartbeat start
hostname s scalix.domain.tld  # Sets it back to what Scalix requires 
it to be

You'll need to set all of the appropriate entries up in /etc/hosts as 
well of course.
Then I set the haresources as per normal:
scalix1.domain.tld      192.168.1.10    scalix scalix-postgres 
scalix-tomcat
EOF

/etc/init.d/heartbeat-wrapper:
#!/bin/bash
#
#       /etc/rc.d/init.d/heartbeat-wrapper
#
# Copyright (c) 2008 Rubin Bennett
# rbTechnologies, LLC <[email protected]>
#
# Starts the heartbeat daemon on a Heartbeat cluster for servers running 
Scalix groupware
# The Scalix message store is *very* hostname sensitive, and so in order 
to get an HA pair
# to run Scalix
# This wrapper changes the hostname to allow heartbeat to start # then 
changes it back.
#
# chkconfig: - 65 35
# description: Wrapper srcipt for Heartbeat # processname: heartbeat # 
Source function library.
. /etc/init.d/functions

TMPHOSTNAME=scalix1.alliedprinting.com
ORIGHOSTNAME=`hostname`

test -x /etc/init.d/heartbeat || exit 0

RETVAL=0
prog="Heartbeat Failover Service"

start() {
        echo $"Starting $prog: "
        echo "Changing hostname to $TMPHOSTNAME"
        hostname $TMPHOSTNAME
        echo "Starting heartbeat"
        /etc/init.d/heartbeat start
        echo "Changing hostname back to $ORIGHOSTNAME"
        hostname $ORIGHOSTNAME
        RETVAL=$?
        echo
}

stop() {
        echo $"Stopping $prog: "
        echo "Changing hostname to $TMPHOSTNAME"
        hostname $TMPHOSTNAME
        echo "Stopping heartbeat"
        /etc/init.d/heartbeat stop
        echo "Changing hostname back to $ORIGHOSTNAME"
        hostname $ORIGHOSTNAME
        RETVAL=$?
        echo
}

#
#       See how we were called.
#
case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  reload|restart)
        stop
        start
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {condrestart|start|stop|restart|reload|status}"
        exit 1
esac

exit $RETVAL
EOF

/etc/ha.d/ha.cf
logfile /var/log/ha-log
logfacility local0
bcast eth1
auto_failback off
node scalix1.domain.tld
node scalix2.domain.tld
EOF

Rubin

Rubin Bennett
rbTechnologies, LLC
80 Carleton Boulevard
East Montpelier, VT 05651

(802)223-4448
http://thatitguy.com

"Think for yourselves and let others enjoy the privilege to do so too."
  Voltaire, Essay on Tolerance
  French author, humanist, rationalist, & satirist (1694 - 1778)

From: Chris May [mailto:[email protected]] 
Sent: Wednesday, February 03, 2010 11:19 AM
To: Rubin Bennett
Subject: Re: [Linux-HA] Silly question (maybe) about hostnames and 
heartbeat

I am running Scalix 11.4.5 and would love to setup a HA failover could 
you let me know how you setup the haresources and ha.cf in heartbeat for 
Scalix. It would be highly appreciated. 

Thanks 

Chris May  
Sr. Linux Admin 
Stonemor Partners 
215.826.2944 
[email protected] 


_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to