Implement high-availability solutions with HP Instant Capacity - easily and effectively

33
Scripts for failover when the entire complex goes down
These scripts correspond to the Automated (Serviceguard) complete outage member failover and
group manager failover.”
Here, the rights from the entire complex is seized by the Group Manager and is available for activation on complex 2.
The addition of the seized rights to appropriate members can be similar to the activation script shown in the previous
subsection.
Gicap_start () {
#!/usr/bin/sh
HOSTNAME=`/usr/bin/hostname`
case $HOSTNAME in
node1) OTHER_HOST=node2;;
node2) OTHER_HOST=node1;;
esac
STATUS=`cmviewcl -f line -n $OTHER_HOST | grep ^status= | cut -f 2 -d=`
if [[ $OTHER_HOST = "node1" ]]
then
FULL_NAME="OA1.aa.bb.ccc"
else
FULL_NAME="OA2.aa.bb.ccc"
fi
if [[ $STATUS != "up" ]]
then
# Specify the GM hostname corresponding to relocatable IP
# address used in the GM package
remsh ap1.aa.bb.ccc -l root -n "/usr/sbin/icapmanage -x $FULL_NAME"
fi
return 0;
}