| United States-English |
|
|
|
![]() |
Managing Serviceguard NFS for Linux > Chapter 3 Sample ConfigurationsConfiguring One Adoptive Node to Support Failover of Multiple Packages |
|
This configuration has two packages, each owned by a different server. The adoptive node for both packages is the same host. This sample configuration uses the package control option, which prevents the adoptive node from adopting another package if it has already adopted one. Figure 3-3 illustrates this configuration. Figure 3-4 shows the same configuration after one primary server has failed. Figure 3-4 shows this sample configuration after host basil has failed. Host sage has adopted pkg02.
This section shows the cluster configuration file (cluster.conf) for this configuration example. The comments are not shown.
Configuration files of two legacy packages are described in this section. These samples are applicable to Red Hat environment. For SLES user can replace all occurrences of “/usr/local” with “/opt”. This section shows the package configuration file (pkg01.conf) for the package pkg01 in this sample configuration. The comments are not shown.
This section shows the package control script (pkg01.cntl) for the package pkg01 in this sample configuration. Only the user-configured part of the script is shown; the executable part of the script and most of the comments have been omitted.
To prevent a shared adoptive node from adopting both packages together, disable the package by specifying the cmmodpkg command with the package control option (-d) in the customer_defined_run_cmds. For example:
Also, add cmmodpkg command with package control option (-e ) in the customer_defined_halt_cmds for enabling the package pkg02 when the package pkg01 is halted. For example:
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 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 the command cmmodpkg –e in the customer_defined_halt_cmds. 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.
This section shows the NFS Toolkit configuration file (hanfs.conf) for the package pkg01 on this sample configuration:
This section shows the package configuration file (pkg02.conf) for the package pkg02 in this sample configuration. The comments are not shown.
This section shows shows the package control script (pkg02.cntl) for the package pkg02 in this sample configuration. Only the user-configured part of the script is shown; the executable part of the script and most of the comments have been omitted.
To prevent a shared adoptive node from adopting both packages together, disable the package by specifying the cmmodpkg command with the package control option (-d) in the customer_defined_run_cmds. For example:
Also, add cmmodpkg command with package control option (-e ) in the customer_defined_halt_cmds for re-enabling the package pkg02 when the package pkg01 is halted. For example:
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 pkg01 would prevent the host that is running pkg02 from adopting pkg01. Once the package pkg02 is halted in the node the pkg01 is enabled by the command cmmodpkg –e in the customer_defined_halt_cmds. 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.
Configuration files of two Modular packages are described in this section. These samples are applicable to Red Hat environment. For SLES user can replace all occurrences of “/usr/local” with “/opt”. This section shows the package configuration file (pkg01.conf) for the package pkg01 in this sample configuration. The comments are not shown.
If you want to prevent a shared adoptive node from adopting both packages together, specify the cmmodpkg command with the package control option (-d) in the external script. The external script template is provided at /usr/local/cmcluster/conf/examples/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:
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:
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.
This section shows the package configuration file (pkg02.conf) for the package pkg01 in this sample configuration. The comments are not shown.
To prevent a shared adoptive node from adopting both packages together, specify the cmmodpkg command with the package control option (-d) in the external script. The external script template is provided at /usr/local/cmcluster/conf/examples/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/pkg02/external_script.sh Add the additional external script into the package configuration file. For example: external_script /usr/local/cmcluster/pkg02/external_script.sh Modify the external script in the adoptive node. Specify the cmmodpkg command with the package control option (-d) in the function start_command. As below:
Also, add cmmodpkg command with package control option (-e ) in the function stop_command for re-enabling the package pkg0 when the package pkg02 is halted. For example:
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 pkg01, would prevent the host that is running pkg02 from adopting pkg01, and once the package pkg02 is halted in the node the pkg01 is enabled by 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 the cmmodpkg -d command is omitted from the NFS control script the host sage can adopt both pkg01 and pkg02, if their primary nodes fail.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||