For details on how to configure cluster applications on the guest OS, see "Chapter 6 Building Cluster Applications."
If using the I/O fencing function, when configuring cluster applications, you must set up the I/O fencing function for the cluster application where the Gds resources or the Fsystem resources are registered.
This section explains how to set up the I/O fencing function for all cluster applications to which Gds resources or Fsystem resources are registered.
Perform the following three settings to set up the I/O fencing function:
Creating Cmdline resources and setting up Online and Offline scripts
Setting up userApplication scripts (PreOnline, OfflineDone, and Fault scripts)
Setting up the function to advertise the route information from the switching destination node
In the Cmdline resource settings, add the Start script, the Stop script, and the Check script in the following format:
<Start script>
/opt/SMAW/bin/hvsgpr -c
<Stop script>
/opt/SMAW/bin/hvsgpr -u
<Check script>
/opt/SMAW/bin/hvsgpr -m
To create Cmdline resources, see, "6.7.3.1 Setting Up Cmdline Resources."
In the attribute settings of the Cmdline resources, set the AutoRecover attribute to disabled ("0"). Do not change the default settings for other attributes.
In the cluster application settings, add the PreOnline and OfflineDone scripts in the following format.
<PreOnline script>
/opt/SMAW/bin/hvsgpr -r
<OfflineDone script>
/opt/SMAW/bin/hvsgpr -o
Select "(PreOnlineScript=)" of "Machines+Basics."
Consistency check ...
Machines+Basics (app1:consistent)
1) HELP
2) -
3) SAVE+EXIT
4) REMOVE+EXIT
5) AdditionalMachine
6) AdditionalConsole
7) Machines[0]=vm21RMS
8) Machines[1]=vm22RMS
9) (PreCheckScript=)
10) (PreOnlineScript=)
11) (PostOnlineScript=)
12) (PreOfflineScript=)
13) (OfflineDoneScript=)
14) (FaultScript=)
15) (AutoStartUp=yes)
16) (AutoSwitchOver=HostFailure|ResourceFailure|ShutDown)
17) (PreserveState=no)
18) (PersistentFault=0)
19) (ShutdownPriority=)
20) (OnlinePriority=)
21) (StandbyTransitions=ClearFaultRequest|StartUp|SwitchRequest)
22) (LicenseToKill=no)
23) (AutoBreak=yes)
24) (AutoBreakMaintMode=no)
25) (HaltFlag=yes)
26) (PartialCluster=0)
27) (ScriptTimeout=)
Choose the setting to process:10
Select "FREECHOICE" and enter the full path of the PreOnline script.
1) HELP 2) RETURN 3) NONE 4) FREECHOICE Enter the command line to start prior to the application becoming ONLINE:4 >> /opt/SMAW/bin/hvsgpr -r
Select "(OfflineDoneScript=)" of "Machines+Basics."
Consistency check ...
Machines+Basics (app1:consistent)
1) HELP
2) -
3) SAVE+EXIT
4) REMOVE+EXIT
5) AdditionalMachine
6) AdditionalConsole
7) Machines[0]=vm21RMS
8) Machines[1]=vm22RMS
9) (PreCheckScript=)
10) (PreOnlineScript='/opt/SMAW/bin/hvsgpr~-r')
11) (PostOnlineScript=)
12) (PreOfflineScript=)
13) (OfflineDoneScript=)
14) (FaultScript=)
15) (AutoStartUp=yes)
16) (AutoSwitchOver=HostFailure|ResourceFailure|ShutDown)
17) (PreserveState=no)
18) (PersistentFault=0)
19) (ShutdownPriority=)
20) (OnlinePriority=)
21) (StandbyTransitions=ClearFaultRequest|StartUp|SwitchRequest)
22) (LicenseToKill=no)
23) (AutoBreak=yes)
24) (AutoBreakMaintMode=no)
25) (HaltFlag=yes)
26) (PartialCluster=0)
27) (ScriptTimeout=)
Choose the setting to process:13
Select "FREECHOICE" and enter the full path of the OfflineDone script.
1) HELP 2) RETURN 3) NONE 4) FREECHOICE Enter the command line to start prior to the application becoming ONLINE:4 >> /opt/SMAW/bin/hvsgpr -o
In the attribute settings of the cluster application, if the HaltFlag attribute is set to enabled ("1"), add the Fault script in the following format.
<Fault script>
/opt/SMAW/bin/hvsgpr -f
Select "(FaultScript=)" of "Machines+Basics."
Consistency check ...
Machines+Basics (app1:consistent)
1) HELP
2) -
3) SAVE+EXIT
4) REMOVE+EXIT
5) AdditionalMachine
6) AdditionalConsole
7) Machines[0]=vm21RMS
8) Machines[1]=vm22RMS
9) (PreCheckScript=)
10) (PreOnlineScript='/opt/SMAW/bin/hvsgpr~-r')
11) (PostOnlineScript=)
12) (PreOfflineScript=)
13) (OfflineDoneScript='/opt/SMAW/bin/hvsgpr~-o')
14) (FaultScript=)
15) (AutoStartUp=yes)
16) (AutoSwitchOver=HostFailure|ResourceFailure|ShutDown)
17) (PreserveState=no)
18) (PersistentFault=0)
19) (ShutdownPriority=)
20) (OnlinePriority=)
21) (StandbyTransitions=ClearFaultRequest|StartUp|SwitchRequest)
22) (LicenseToKill=no)
23) (AutoBreak=yes)
24) (AutoBreakMaintMode=no)
25) (HaltFlag=yes)
26) (PartialCluster=0)
27) (ScriptTimeout=)
Choose the setting to process:14
Select "FREECHOICE" and enter the full path of the Fault script.
1) HELP 2) RETURN 3) NONE 4) FREECHOICE Enter the command line to start prior to the application becoming ONLINE:4 >> /opt/SMAW/bin/hvsgpr -f
It is recommended to enable this function when:
The Gls resource or the takeover network resource is registered to userApplication.
The IPv4 address is used as the takeover IP address.
To enable this function, add the following one line at the end of /opt/SMAW/SMAWRrms/bin/hvenv.local file in each node:
export HV_VM_ENABLE_IP_ADVERTISE=1
Note
In any one of the following cases, the function is not enabled even it is set.
Using IPv6 address as the takeover IP address
Not registering Gls resource or the takeover network resource to userApplication
Information
If this function is enabled, the ARP packet is sent from the switching destination node in a 60-second cycle for a specified time.
When specifying any command other than hvsgpr command in PreOnline script, OfflineDone script, and Fault script at the same time, specify the command as any one of the following examples shows:
Separate the command by double-ampersand (&&).
Example
/opt/SMAW/bin/hvsgpr -r && /var/tmp/command
Separate the command by semicolon (;).
Example
/opt/SMAW/bin/hvsgpr -o ; /var/tmp/command
Create the script that runs more than one commands, and then specify that command.
Example
#!/bin/sh /opt/SMAW/bin/hvsgpr -r ret1=$? /var/tmp/command ret2=$? if [ $ret1 = 0 ]; then exit $ret2 fi exit $ret1
The table below shows how the command can be specified in each script and the notes on specifying the command.
Separate the command by double-ampersand (&&). | Separate the command by semicolon (;). | Create the script that runs more than one commands, and then specify that command. | |
---|---|---|---|
PreOnline script | Y (*1) | - | Y (*2) |
OfflineDone script | - | Y | Y |
Fault script | - | Y | Y |
Y: Allowed -: Not allowed
(*1) Specify hvsgpr command as the first executed command.
The second or later command is not executed if hvsgpr command has ended abnormally.
(*2) When hvsgpr command has ended abnormally, the script's exit code must be the same with hvsgpr's exit code.