You can create an action shell script that is executed when the local cluster detects a loss of heartbeat with the partner cluster. The script is executed with root permissions, so the file must have root ownership and execution permissions.
If you have configured the Notification_actioncmd property, the action command is executed with arguments that provide information about the event in the following command line:
# custom-action-command-path -c local-cluster-name -r remote-cluster-name -e 1 \ -n node-name -t time |
Specifies a path to the action command you have created
Specifies the name of the local cluster
Specifies the name of the remote partner cluster
Specifies that HBLOST=1, meaning that a heartbeat-loss event has occurred
Specifies name of the cluster node that sent the heartbeat-loss event notification
Specifies the time of the heartbeat-loss event as the number of milliseconds since January 1, 1970, 00:00:00 GMT
You can use this script to perform an automatic takeover on the secondary cluster. However, such an automated action is risky. If the heartbeat loss notification is caused by a total loss of all heartbeat connectivity on both the primary and secondary clusters, such an automated action could lead to a situation where two primary clusters exist.
This example shows the event information that is provided in the command-line being parsed in a notification action shell script.
#!/bin/sh set -- `getopt abo: $*` if [ $? != 0] then echo $USAGE exit 2 fi for i in $* do case $i in -p) PARTNER_CLUSTER=$1; shift;; -e) HB_EVENT=$2; shift;; -c) LOCAL_CLUSTER=$3; shift;; -n) EVENT_NODE=$4; shift;; esac done |