Managing Serviceguard NFS for Linux, March 2009
external_script.template in Red Hat and at /opt/cmcluster/conf/examples/
external_script.template in SLES. Copy and rename the external_script.template
to the package directory with the following command: # cp
/usr/local/cmcluster/conf/examples/external_script.template \
/usr/local/cmcluster/pkg01/external_script.sh
Add the additional external script into the package configuration file. For Example:
external_script /usr/local/cmcluster/pkg01/external_script.sh
Modify the external script in the adoptive node only. Specify the cmmodpkg command with the
package control option (-d) in the function start_command. As below:
function start_command
{
sg_log 5 "start_command"
cmmodpkg –d –n `hostname` pkg02 &
return $?
}
Also, add the cmmodpkg command with package control option (-e ) in the function
stop_command for re-enabling the package (pkg02) when the package (pkg01) is halted. For
example:
function stop_command
{
sg_log 5 "stop_command"
cmmodpkg –e –n `hostname` pkg02 &
return $?
}
This package control function can prevent an adoptive node from becoming overloaded when
multiple packages fail over. If an adoptive node becomes overloaded, it can fail. In this example,
if a host is an adoptive node for both pkg01 and pkg02, disabling of pkg02, in the external
script for pkg01, would prevent the host that is running pkg01 from adopting pkg02, and once
the package pkg01 is halted in the node the pkg02 is enabled by using the command cmmodpkg
–e in the function stop_command. The ampersand (&) causes the cmmodpkg command to run
in the background.
The cmmodpkg command in the background allows the control script to complete and finish
bringing up the package. There is a small window of time, during which if one package has
begun to fail over but the cmmodpkg command has not executed, the other package can fail over
and the host will adopt it. In other words, if two packages fail over at approximately the same
time, a host may adopt both packages, even though the package control option is specified. If
you omit the cmmodpkg -d command from the NFS control script, host sage can adopt both
pkg01 and pkg02 if their primary nodes fail.
NOTE: The above changes in the external script must be done only on the adoptive node and
NOT on the external script in the primary node. If there are more than 2 packages the user may
repeat the cmmodpkg command as many times required with other package names. User may
consider making FAILBACK_POLICY as AUTOMATIC to free the adoptive node as early as
possible so that adoptive node is ready to accept pkg02 in case it fails.
Package Configuration File for pkg02
This section shows the package configuration file (pkg02.conf) for the package pkg01 in this
sample configuration. The comments are not shown.
package_name pkg02
package_type failover
failover_policy configured_node
failback_policy manual
node_name basil
node_name sage
46 Sample Configurations