25.8.4 Agent definition
Define the action details of the agents shown in Table 25-20.
Table 25-20 Agent action definition items and file names
Agent action | HiRDB type | Script file name |
---|
Bringing a resource online | HiRDB/Single Server | /opt/VRTSvcs/bin/HiRDB_S/online |
HiRDB/Parallel Server | /opt/VRTSvcs/bin/HiRDB_P/online |
Taking a resource offline | HiRDB/Single Server | /opt/VRTSvcs/bin/HiRDB_S/offline |
HiRDB/Parallel Server | /opt/VRTSvcs/bin/HiRDB_P/offline |
Monitoring a resource | HiRDB/Single Server | /opt/VRTSvcs/bin/HiRDB_S/monitor |
HiRDB/Parallel Server | /opt/VRTSvcs/bin/HiRDB_P/monitor |
- Organization of this subsection
- (1) Online script
- (2) Offline script
- (3) Monitor script
(1) Online script
An online script explains the details of the processing to be performed when an agent brings a resource online. The following processing is required:
- Setting of the environment variables necessary for executing $PDDIR/bin/pdstart
- HiRDB startup
- Dummy file creation
- Dummy file mode change
(a) HiRDB/Single Server
The following is an example of an online script for a HiRDB/Single Server:
#!/bin/sh
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/VRTSvcs/bin:"$2"/bin
export PATH
PDDIR="$2"
PDCONFPATH="$3"
LD_LIBRARY_PATH="$4"
export PDDIR PDCONFPATH LD_LIBRARY_PATH
$PDDIR/bin/pdstart
/bin/touch "$5"
/bin/chmod 0400 "$5" |
(b) HiRDB/Parallel Server
The following is an example of an online script for a HiRDB/Parallel Server:
#!/bin/sh
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/VRTSvcs/bin:"$2"/bin
export PATH
PDDIR="$2"
PDCONFPATH="$3"
LD_LIBRARY_PATH="$4"
export PDDIR PDCONFPATH LD_LIBRARY_PATH
$PDDIR/bin/pdstart -q
/bin/touch "$5"
/bin/chmod 0400 "$5" |
- Note
- The pdstart -q command starts the units in a HiRDB/Parallel Server during use of the system switchover facility.
(2) Offline script
An offline script explains the details of the processing to be performed when an agent takes a resource offline. The following processing is required:
- Setting of the environment variables necessary for executing $PDDIR/bin/pdstop
- HiRDB termination
- Dummy file deletion
(a) HiRDB/Single Server
Following is an example of an offline script for a HiRDB/Single Server:
#!/bin/sh
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/VRTSvcs/bin:"$2"/bin
export PATH
PDDIR="$2"
PDCONFPATH="$3"
LD_LIBRARY_PATH="$4"
export PDDIR PDCONFPATH LD_LIBRARY_PATH
$PDDIR/bin/pdstop -f -q
/bin/rm -f "$5" |
- Note
- Specify the pdstop -f -q command to terminate HiRDB forcibly. Executing this command may cause an error shutdown in the RDAREAs on the shared disk. If this happens, use the database recovery utility to recover the RDAREAs on the shared disk.
- The offline script is executed during system switchover. At such a time, HiRDB is terminated forcibly so that the systems can be switched immediately and the standby system can restart HiRDB in order to resume operations.
(b) HiRDB/Parallel Server
The following is an example of an offline script for a HiRDB/Parallel Server follows.
#!/bin/sh
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/VRTSvcs/bin:"$2"/bin
export PATH
PDDIR="$2"
PDCONFPATH="$3"
LD_LIBRARY_PATH="$4"
export PDDIR PDCONFPATH LD_LIBRARY_PATH
$PDDIR/bin/pdstop -z -q
/bin/rm -f "$5" |
- Note
- Specify the pdstop -z -q command to terminate HiRDB forcibly. Executing this command may cause an error shutdown in the RDAREAs on the shared disk. If this happens, use the database recovery utility to recover the RDAREAs on the shared disk.
- The offline script is executed during system switchover. At such a time, HiRDB is terminated forcibly so that the systems can be switched immediately and the standby system can restart HiRDB in order to resume operations.
(3) Monitor script
A monitor script explains the details of the processing to be performed when an agent monitors a resource (for checking whether or not a resource is online). The following processing is required:
- Check of whether or not a dummy file exists
- Return value setting
The following is an example of a monitor script:
#!/bin/sh
if /bin/test -f "$5"
then
exit 110
else
exit 100
fi |
The values of the environment variables and dummy file path names, which will be needed in each script, can be transferred during script execution. For the arguments and return values to be transferred to each script, see the VERITAS Cluster Server manual.