17.3.4 Setting up an HA Monitor environment
Set up an HA Monitor environment in the active system and the standby system. For details about how to set up an HA Monitor environment, see System Configuration in the manual HA Monitor for Linux(R) (x86).
This subsection provides notes on setting up an HA Monitor environment.
- Organization of this subsection
(1) Setting environment variables
Set the following HADB administrator environment variable:
-
PATH
Add the following path so that HA Monitor commands can be executed:
/opt/hitachi/HAmon/bin
(2) Specifying settings in the sysdef file
Among the operands that you need to specify for HA Monitor's sysdef file, the values to specify are predetermined for the following operands:
-
address
Specifies the order of priority for resetting hosts. The smaller the specification value, the higher the priority of resetting that host. Specify different values for the individual hosts. The value for the active system must be smaller than the value for the standby system.
-
monbegin_restart
Specify nouse.
-
termcmd_at_abort
Specify nouse.
-
fence_reset
When using host reset, either omit this operand or specify the default value (use).
When using SCSI reservation for shared disk, specify nouse.
-
fence_scsi
When using host reset, either omit this operand or specify the default value (nouse).
When using SCSI reservation for shared disk, specify use.
-
fence_lan
Either omit this operand or specify the default value (nouse).
For details about the above operands, see HA Monitor environment settings (sysdef) in the manual HA Monitor for Linux(R) (x86).
(3) Specifying the servers file
Among the operands that you need to specify for HA Monitor's servers file, the values to specify are predetermined for the following operands:
-
name
Specify the absolute path for the server directory.
Note that you cannot specify a character string that includes spaces for the name operand as a path name. Therefore, in a cold standby configuration, we recommend that you use as the server directory a directory whose path name does not include spaces.
-
acttype
Specify monitor because the cold standby configuration is run in HA Monitor's monitor mode.
-
termcommand
Specify the absolute path for the server termination command that describes the settings for HADB.
Create the server termination command based on the appropriate template. For details about how to create a server termination command, see (c) Creating a server termination command in (4) Creating environment variable definitions for commands, and creating commands, and Creating a server termination command in the manual HA Monitor for Linux(R) (x86).
-
initial
Specify online for the active system and standby for the standby system.
-
disk
Specify the absolute path for VGs that include the following file systems:
-
File system that stores the DB directory
-
File system that stores temporary work files
-
File system that stores synonym dictionary files (not needed if you will not be conducting synonym searches)
-
File system where the audit trail directory will be created (not needed if the audit trail facility will not be used)
In the case of Figure 17‒1: Example of a system configuration using the cold standby configuration, specify /dev/vg_hadb01, /dev/vg_hadb02, /dev/vg_hadb03, and /dev/vg_hadb04.
-
-
fs_name
Specify the absolute path for logical volumes that correspond to the following file systems:
-
File system that stores the DB directory
-
File system that stores temporary work files
-
File system that stores synonym dictionary files (not needed if you will not be conducting synonym searches)
-
File system where the audit trail directory will be created (not needed if the audit trail facility will not be used)
In the case of Figure 17‒1: Example of a system configuration using the cold standby configuration, specify /dev/vg_hadb01/hadb_db, /dev/vg_hadb02/hadb_workarea, /dev/vg_hadb03/hadb_syndict, and /dev/vg_hadb04/hadb_audit.
-
-
fs_mount_dir
Specify the directory path in which the following file systems are mounted. This path must be the same on both the active system and the standby system.
-
File system that stores the DB directory
-
File system that stores temporary work files
-
File system that stores synonym dictionary files (not needed if you will not be conducting synonym searches)
-
File system where the audit trail directory will be created (not needed if the audit trail facility will not be used)
-
-
fs_mount_opt
Specify mount options for mounting the following file systems:
-
File system that stores the DB directory
-
File system that stores temporary work files
-
File system that stores synonym dictionary files (not needed if you will not be conducting synonym searches)
-
File system where the audit trail directory will be created (not needed if the audit trail facility will not be used)
-
-
lan_updown
Specify use because the LAN status settings files are used.
Configure an alias IP address in the LAN status settings files. For details, see Specifying LAN status settings files in the manual HA Monitor for Linux(R) (x86).
-
patrolcommand
Specify the absolute path for the server-monitoring command that describes the settings for HADB.
Create the server-monitoring command based on the appropriate template. For details about how to create a server-monitoring command, see (d) Creating a server-monitoring command in (4) Creating environment variable definitions for commands, and creating commands, and Creating a server monitoring command in the manual HA Monitor for Linux(R) (x86).
-
servexec_retry
Specify 2.
-
waitserv_exec
Specify yes.
-
ip_neck
Specify use.
-
uoc_neck
Specify nouse.
-
vg_neck
Specify use for the VG that contains the file system for the DB directory and the file system where the audit trail directory will be created.
Specify nouse for any other VG.
-
fs_neck
Specify use for the file system that contains the DB directory and the file system where the audit trail directory will be created.
Specify nouse for any other file system.
-
actcommand
Specify the absolute path for the server startup command that describes the settings for HADB.
Create the server startup command based on the appropriate template. For details about how to create a server startup command, see (b) Creating a server startup command in (4) Creating environment variable definitions for commands, and creating commands, and Creating a server start command in the manual HA Monitor for Linux(R) (x86).
-
scsi_device
In this operand, specify the absolute paths of the device names that are to be subject to SCSI reservation.
When using host reset, you do not need to specify this operand.
Specify this operand when you are using SCSI reservation for shared disk and the shared disk meets any of the following conditions:
-
The shared disk is in a single-path configuration.
-
The shared disk is in a VMware ESXi virtual environment (excluding situations where DMMP is used).
-
The shared disk is in a redundant configuration realized using multipath software (HDLM).
When specifying this operand, specify the device names of the following file systems and disks by absolute path:
-
File systems subject to host switchover processing
In Figure 17‒1: Example of a system configuration using the cold standby configuration, FS001 to FS004 are file systems subject to host switchover processing.
-
Disks for DB area files
In Figure 17‒1: Example of a system configuration using the cold standby configuration, LU001 to LU005 and WRK001 are disks for DB area files.
If you do not intend to perform synonym searches, you do not need to specify the device name of the file system where the synonym dictionary files are stored. If you do not intend to use the audit trail facility, you do not need to specify the device name of the file system where the audit trail directory will be created.
- Important
-
Do not specify the device name of one of the following file systems in this operand.
-
Host's local file system
In Figure 17‒1: Example of a system configuration using the cold standby configuration, LOC001 and LOC002 are the host's local file systems.
-
Shared file system
In Figure 17‒1: Example of a system configuration using the cold standby configuration, FS005 is the shared file system.
-
When specifying this operand, see Determining the operand value needed for SCSI reservation for shared disk in the manual HA Monitor for Linux(R) (x86).
-
-
dmmp_device
In this operand, specify the absolute paths of the logical DMMP devices that are to be subject to SCSI reservation.
When using host reset, you do not need to specify this operand.
Specify this operand when you are using SCSI reservation for shared disk, and the shared disk is in a redundant configuration based on multipath software (DMMP).
When specifying this operand, specify the device names of the following file systems and disks by absolute path:
-
File systems subject to host switchover processing
In Figure 17‒1: Example of a system configuration using the cold standby configuration, FS001 to FS004 are file systems subject to host switchover processing.
-
Disks for DB area files
In Figure 17‒1: Example of a system configuration using the cold standby configuration, LU001 to LU005 and WRK001 are disks for DB area files.
If you do not intend to perform synonym searches, you do not need to specify the device name of the file system where the synonym dictionary files are stored. If you do not intend to use the audit trail facility, you do not need to specify the device name of the file system where the audit trail directory will be created.
- Important
-
Do not specify the device name of one of the following file systems in this operand.
-
Host's local file system
In Figure 17‒1: Example of a system configuration using the cold standby configuration, LOC001 and LOC002 are the host's local file systems.
-
Shared file system
In Figure 17‒1: Example of a system configuration using the cold standby configuration, FS005 is the shared file system.
-
When specifying this operand, see Determining the operand value needed for SCSI reservation for shared disk in the manual HA Monitor for Linux(R) (x86).
-
For details about the preceding operands specified in the servers file, see Server environment definition (servers) in the manual HA Monitor for Linux(R) (x86).
(4) Creating environment variable definitions for commands, and creating commands
To link to HA Monitor, create environment variable definitions for commands, and create the following commands:
-
Server startup command
-
Server termination command
-
Server-monitoring command
Templates for environment variable definitions for commands, as well as the above commands, are located under $ADBDIR/sample/scripts. Create the commands based on the templates.
(a) Creating environment variable definitions for commands
$ADBDIR/sample/scripts/coldstandby.env is the template. Copy this template and correct the following locations:
-
Environment variable ADBMGR
Specify the user name of the HADB administrator (OS user).
(b) Creating a server startup command
$ADBDIR/sample/scripts/coldstandby_act.sh is the template. Copy this template and correct the following location:
-
source statement
Specify for the argument of the source statement the absolute path for the file that specifies the environment variable definitions for commands.
(c) Creating a server termination command
$ADBDIR/sample/scripts/coldstandby_term.sh is the template. Copy this template and correct the following location:
-
source statement
Specify for the argument of the source statement the absolute path for the file that specifies the environment variable definitions for commands.
(d) Creating a server-monitoring command
$ADBDIR/sample/scripts/coldstandby_patrol.sh is the template. Copy this template and correct the following location:
-
source statement
Specify for the argument of the source statement the absolute path for the file that specifies the environment variable definitions for commands.
(5) File specification examples (when using host reset)
This subsection provides specification examples for the following files. The following are specification examples when you are using host reset.
-
sysdef file
-
servers file
-
File for environment variable definitions for commands (/HADB/scripts/coldstandby.env in this example)
-
Server startup command file (/HADB/scripts/coldstandby_act.sh in this example)
-
Server termination command file (/HADB/scripts/coldstandby_term.sh in this example)
-
Server-monitoring command file (/HADB/scripts/coldstandby_patrol.sh in this example)
The specification examples explained here assume the system configuration shown in Figure 17‒1: Example of a system configuration using the cold standby configuration.
(a) sysdef file specification examples
- ■ Specification example of the sysdef file for server machine hadb01 (active system)
-
environment name hadb01, address 1, ...1 patrol 60, lan path11, ...2 lanport HAmon1; ...3 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, termcmd_at_abort nouse;
Explanation
-
Specifies the order of priority for resetting hosts. Because this host is the active system, its reset priority needs to be the highest, so 1 is specified.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path11, which corresponds to IP address 172.16.0.11.
-
Specify the service name of the LAN that is used for HA Monitor's monitoring path. Specify service name HAmon1, which corresponds to port number 7777.
-
- ■ Specification example of the sysdef file for server machine hadb02 (standby system)
-
environment name hadb02, address 2, ...1 patrol 60, lan path21, ...2 lanport HAmon1; ...3 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, termcmd_at_abort nouse;
Explanation
-
Specifies the order of priority for resetting hosts. This host is the standby system, so specify 2.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path21, which corresponds to IP address 172.16.0.12.
-
Specify the service name of the LAN that is used for HA Monitor's monitoring path. Specify service name HAmon1, which corresponds to port number 7777.
-
(b) servers file specification examples
The examples described here assume that you are using ext4 as the file system. If you are using a file system other than ext4, the OS mount command options will differ from those in the examples shown here.
- ■ Specification example of the servers file for server machine hadb01 (active system)
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 initial online; ...11
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify online to make this system the active system.
-
- ■ Specification example of the servers file for server machine hadb02 (standby system)
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 initial standby; ...11
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify standby to make this system the standby system.
-
(c) Specification example of a file for environment variable definitions for commands
In this example, environment variable definitions for commands are stored in /HADB/scripts/coldstandby.env. Specify the same settings for the active system and the standby system.
- ■ Specification example of the file for environment variable definitions for commands
-
# The environment variables for HADB export ADBMGR=adbmanager ...1 export ADBDIR=/HADB/server ...2 export ADBINFODIR=/HADB/adbinfo ...3
Explanation
-
Specify user name adbmanager for the HADB administrator (OS user).
-
Specify the absolute path for the server directory.
-
Specify the absolute path for the directory for storing troubleshooting-information files.
-
(d) Specification example of the server startup command file
In this example, the server startup command is stored in /HADB/scripts/coldstandby_act.sh. Specify the same settings for the active system and the standby system.
- ■ Specification example of the server startup command file
-
#!/bin/sh # Sample of the actcommand for HADB SU=/bin/su ECHO=/bin/echo # Setting environment variables for HADB source /HADB/scripts/coldstandby.env ...1 # Execute adbstart command $SU - $ADBMGR -c "$ECHO y|$ADBDIR/bin/adbstart" # always 0 return exit 0
Explanation
-
For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/coldstandby.env).
-
(e) Specification example of the server termination command file
In this example, the server termination command is stored in /HADB/scripts/coldstandby_term.sh. Specify the same settings for the active system and the standby system.
- ■ Specification example of the server termination command file
-
#!/bin/sh # Sample of the termcommand for HADB STS_ACTIVE="ACTIVE" STS_STOP="STOP" STS_STARTING="STARTING" STS_STOPPING="STOPPING" STS_ABORT="ABORT" STS_QUIESCE="QUIESCE" STS_OFFLINE="OFFLINE" STS_CHGMODE="CHGMODE" STS_STOPWAIT="STOPWAIT" STS_COREDUMP="COREDUMP" STS_FORCE="FORCE" STS_MAINTNCE="MAINTNCE" AWK=/bin/awk ECHO=/bin/echo PS=/bin/ps KILL=/bin/kill GREP=/bin/grep SU=/bin/su READLINK=/bin/readlink # Setting environment variables for HADB source /HADB/scripts/coldstandby.env ...1 # Resolve the path for adbsrvd ADBSRVD=`$READLINK -e $ADBDIR/bin/adbsrvd` if [ $? -ne 0 ] then exit 0 fi # Execute adbstop command GET_STS=`$SU - $ADBMGR -c "$ADBDIR/bin/adbls -d srv 2>/dev/null" | $GREP -v SVID | $AWK '{ if ($1 ~ /[0-9]+/) { print $2 } else { print $1 } }'` case "$1" in "-e" ) # Normal stop operations of active system. # (when the monend command is executed.) if [ "$GET_STS" = "$STS_ACTIVE" -o "$GET_STS" = "$STS_STARTING" -o \ "$GET_STS" = "$STS_STOPPING" -o "$GET_STS" = "$STS_QUIESCE" -o \ "$GET_STS" = "$STS_OFFLINE" -o "$GET_STS" = "$STS_CHGMODE" -o \ "$GET_STS" = "$STS_STOPWAIT" -o "$GET_STS" = "$STS_MAINTNCE" ] then $SU - $ADBMGR -c "$ECHO y|$ADBDIR/bin/adbstop --force" STOPRES=$? if [ $STOPRES -ne 0 -a $STOPRES -ne 4 ] then ADB_ID=`$SU - $ADBMGR -c "$PS x" | $GREP $ADBSRVD | $GREP -v $GREP | $AWK '{print $1}'` if [ "$ADB_ID" != "" ] then $SU - $ADBMGR -c "$KILL $ADB_ID" fi fi fi ;; "-w" ) # Plan stop operations of active system. # (when the monswap command is executed.) if [ "$GET_STS" = "$STS_ACTIVE" -o "$GET_STS" = "$STS_STARTING" -o \ "$GET_STS" = "$STS_STOPPING" -o "$GET_STS" = "$STS_QUIESCE" -o \ "$GET_STS" = "$STS_OFFLINE" -o "$GET_STS" = "$STS_CHGMODE" -o \ "$GET_STS" = "$STS_STOPWAIT" -o "$GET_STS" = "$STS_MAINTNCE" ] then $SU - $ADBMGR -c "$ECHO y|$ADBDIR/bin/adbstop --force" STOPRES=$? if [ $STOPRES -ne 0 -a $STOPRES -ne 4 ] then ADB_ID=`$SU - $ADBMGR -c "$PS x" | $GREP $ADBSRVD | $GREP -v $GREP | $AWK '{print $1}'` if [ "$ADB_ID" != "" ] then $SU - $ADBMGR -c "$KILL $ADB_ID" fi fi fi ;; "-c" ) # Retry operations of active system. # (Before the act_command is resterted.) $SU - $ADBMGR -c "adbinfoget -l -o $ADBINFODIR" ;; esac # stop HADB if [ "$GET_STS" = "$STS_STARTING" ] then ADB_ID=`$SU - $ADBMGR -c "$PS x" | $GREP $ADBSRVD | $GREP -v $GREP | $AWK '{print $1}'` $SU - $ADBMGR -c "$KILL $ADB_ID" exit 0 fi # Wait for end of HADB while [ "$GET_STS" = "$STS_ACTIVE" -o "$GET_STS" = "$STS_STARTING" -o \ "$GET_STS" = "$STS_STOPPING" -o "$GET_STS" = "$STS_QUIESCE" -o \ "$GET_STS" = "$STS_OFFLINE" -o "$GET_STS" = "$STS_CHGMODE" -o \ "$GET_STS" = "$STS_STOPWAIT" -o "$GET_STS" = "$STS_COREDUMP" -o \ "$GET_STS" = "$STS_MAINTNCE" ] do GET_STS=`$SU - $ADBMGR -c "$ADBDIR/bin/adbls -d srv 2>/dev/null" | $GREP -v SVID | $AWK '{ if ($1 ~ /[0-9]+/) { print $2 } else { print $1 } }'` sleep 1 done exit 0
Explanation
-
For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/coldstandby.env).
-
(f) Specification example of the server-monitoring command file
In this example, the server-monitoring command is stored in /HADB/scripts/coldstandby_patrol.sh. Specify the same settings for the active system and the standby system.
- ■ Specification example of the server-monitoring command file
-
#!/bin/sh # Sample of the patrolcommand for HADB AWK=/bin/awk GREP=/bin/grep PS=/bin/ps PGREP=/usr/bin/pgrep PKILL=/usr/bin/pkill SU=/bin/su READLINK=/bin/readlink # Setting environment variables for HADB source /HADB/scripts/coldstandby.env ...1 # Resolve the path for adbsrvd ADBSRVD=`$READLINK -e $ADBDIR/bin/adbsrvd` if [ $? -ne 0 ] then exit 0 fi # Get adbsrvd process id CHKPID=`$SU - $ADBMGR -c "$PS x" | $GREP $ADBSRVD | $GREP -v $GREP | $AWK '{print $1}'` if [ "$CHKPID" = "" ] then exit 0 fi # Execute adbmonitor command for active system $SU - $ADBMGR -c "$ADBDIR/bin/adbmonitor -n" & PID=$! # Trap SIGTERM and terminate adbmonitor trap "$PKILL -P $PID" 15 ## Wait process terminated CPID="" CHKPID=`$PS aux | $AWK -v PID=$PID '{ if ($2 == PID) { print $2 } }'` while [ "$CHKPID" != "" ] do ## Get adbmonitor process id if [ "$CPID" = "" ] then CPID=`$PGREP -P $PID` fi ## Wait if [ "$CPID" != "" ] then CHKCPID=`$PS aux | $AWK -v CPID=$CPID '{ if ($2 == CPID) { print $2 } }'` while [ "$CHKCPID" != "" ] do sleep 1 CHKCPID=`$PS aux | $AWK -v CPID=$CPID '{ if ($2 == CPID) { print $2 } }'` done fi sleep 1 CHKPID=`$PS aux | $AWK -v PID=$PID '{ if ($2 == PID) { print $2 } }'` done exit 0
Explanation
-
For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/coldstandby.env).
-
(6) File specification examples (when using SCSI reservation for shared disk)
This subsection provides specification examples for the following files. The following are specification examples when you are using SCSI reservation for shared disk.
-
sysdef file
-
servers file
-
File for environment variable definitions for commands (/HADB/scripts/coldstandby.env in this example)
-
Server startup command file (/HADB/scripts/coldstandby_act.sh in this example)
-
Server termination command file (/HADB/scripts/coldstandby_term.sh in this example)
-
Server-monitoring command file (/HADB/scripts/coldstandby_patrol.sh in this example)
The specification examples explained here assume the system configuration shown in Figure 17‒1: Example of a system configuration using the cold standby configuration.
(a) sysdef file specification examples
- ■ Specification example of the sysdef file for server machine hadb01 (active system)
-
environment name hadb01, address 1, ...1 patrol 60, lan path11, ...2 lanport HAmon1; ...3 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, termcmd_at_abort nouse, fence_reset nouse, ...4 fence_scsi use, ...5 fence_lan nouse;
Explanation
-
Specifies the order of priority for resetting hosts. Because this host is the active system, its reset priority needs to be the highest, so 1 is specified.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path11, which corresponds to IP address 172.16.0.11.
-
Specify the service name of the LAN that is used for HA Monitor's monitoring path. Specify service name HAmon1, which corresponds to port number 7777.
-
Because host reset will not be used, specify nouse.
-
Because SCSI reservation for shared disk will be used, specify use.
-
- ■ Specification example of the sysdef file for server machine hadb02 (standby system)
-
environment name hadb02, address 2, ...1 patrol 60, lan path21, ...2 lanport HAmon1; ...3 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, termcmd_at_abort nouse, fence_reset nouse, ...4 fence_scsi use, ...5 fence_lan nouse;
Explanation
-
Specifies the order of priority for resetting hosts. This host is the standby system, so specify 2.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path21, which corresponds to IP address 172.16.0.12.
-
Specify the service name of the LAN that is used for HA Monitor's monitoring path. Specify service name HAmon1, which corresponds to port number 7777.
-
Because host reset will not be used, specify nouse.
-
Because SCSI reservation for shared disk will be used, specify use.
-
(b) servers file specification examples
The following describes specification examples of a servers file in the following cases:
-
The shared disk is in a single-path configuration
-
A redundant configuration is used with multipath software (DMMP).
The examples described here assume that you are using ext4 as the file system. If you are using a file system other than ext4, the OS mount command options will differ from those in the examples shown here.
- ■ Specification example of the servers file in a single-path configuration
-
▪ Specification example of the servers file for server machine hadb01 (active system)
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 scsi_device /dev/disk/by-id/wwn-0x60060e8010205850051104c500000005: ...11 /dev/disk/by-id/wwn-0x60060e8010205850051104c500000006: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000007: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000008: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000f: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000e: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000010: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000011: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000013: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000d, initial online; ...12
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify the absolute paths for the disks that contain file systems subject to host switchover processing and the absolute paths for the disks that contain the DB areas. Specify the absolute paths in the same order for the active system and the standby system.
-
Specify online to make this system the active system.
▪ Specification example of the servers file for server machine hadb02 (standby system)
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 scsi_device /dev/disk/by-id/wwn-0x60060e8010205850051104c500000005: ...11 /dev/disk/by-id/wwn-0x60060e8010205850051104c500000006: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000007: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000008: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000f: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000e: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000010: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000011: /dev/disk/by-id/wwn-0x60060e8010205850051104c500000013: /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000d, initial standby; ...12
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify the absolute paths for the disks that contain file systems subject to host switchover processing and the absolute paths for the disks that contain the DB areas. Specify the absolute paths in the same order for the active system and the standby system.
-
Specify standby to make this system the standby system.
-
- ■ Specification example of the servers file in a redundant configuration using multipath software (DMMP)
-
▪ Specification example of the servers file for server machine hadb01 (active system)
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 dmmp_device /dev/mapper/mpath1: ...11 /dev/mapper/mpath2: /dev/mapper/mpath3: /dev/mapper/mpath4: /dev/mapper/mpath11: /dev/mapper/mpath12: /dev/mapper/mpath13: /dev/mapper/mpath14: /dev/mapper/mpath15: /dev/mapper/mpath16, initial online; ...12
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify the absolute paths for the disks that contain file systems subject to host switchover processing and the absolute paths for the disks that contain the DB areas. Specify the absolute paths in the same order for the active system and the standby system.
-
Specify online to make this system the active system.
▪ Specification example of the servers file for server machine hadb02 (standby system)
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb01: ...2 /dev/vg_hadb02: /dev/vg_hadb03: /dev/vg_hadb04, lan_updown use, fs_name /dev/vg_hadb01/hadb_db: ...3 /dev/vg_hadb02/hadb_workarea: /dev/vg_hadb03/hadb_syndict: /dev/vg_hadb04/hadb_audit, fs_mount_dir /HADB/db: ...4 /mnt/workarea: /mnt/syndict: /mnt/audit, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev": "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/coldstandby_act.sh", ...6 termcommand "/HADB/scripts/coldstandby_term.sh", ...7 patrolcommand "/HADB/scripts/coldstandby_patrol.sh", ...8 servexec_retry 2, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:nouse:nouse:use, ...9 fs_neck use:nouse:nouse:use, ...10 dmmp_device /dev/mapper/mpath1: ...11 /dev/mapper/mpath2: /dev/mapper/mpath3: /dev/mapper/mpath4: /dev/mapper/mpath11: /dev/mapper/mpath12: /dev/mapper/mpath13: /dev/mapper/mpath14: /dev/mapper/mpath15: /dev/mapper/mpath16, initial standby; ...12
Explanation
-
Specify the absolute path for the server directory.
-
Specify the absolute paths of the VGs that contain the file systems in which the following directories will be created:
-
DB directory
-
Directory that stores temporary work files
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
Audit trail directory (this directory is created in order to use the audit trail facility)
-
-
Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.
-
Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.
-
Specify options for the mount command to be used for mounting the file systems for the directories in 2.
-
Specify the absolute path for the server startup command to be used in the cold standby configuration.
-
Specify the absolute path for the server termination command to be used in the cold standby configuration.
-
Specify the absolute path for the server-monitoring command to be used in the cold standby configuration.
-
Specify as follows:
-
Specify use for the VG that contains the file system where the DB directory will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the VG that contains the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the VG that contains the file system where the audit trail directory will be created.
-
-
Specify as follows:
-
Specify use for the file system where the DB directory will be created.
-
Specify nouse for the file system where the directory that stores temporary work files will be created.
-
Specify nouse for the file system where the directory that stores synonym dictionary files will be created.
-
Specify use for the file system where the audit trail directory will be created.
-
-
Specify the absolute paths for the disks that contain file systems subject to host switchover processing and the absolute paths for the disks that contain the DB areas. Specify the absolute paths in the same order for the active system and the standby system.
-
Specify standby to make this system the standby system.
-
(c) Specification example of a file for environment variable definitions for commands
For a specification example of a file for environment variable definitions for commands, see (c) Specification example of a file for environment variable definitions for commands in (5) File specification examples (when using host reset).
(d) Specification example of the server startup command file
For a specification example of the server startup command file, see (d) Specification example of the server startup command file in (5) File specification examples (when using host reset).
(e) Specification example of the server termination command file
For a specification example of the server stop command file, see (e) Specification example of the server termination command file in (5) File specification examples (when using host reset).
(f) Specification example of the server-monitoring command file
For a specification example of the server-monitoring command file, see (f) Specification example of the server-monitoring command file in (5) File specification examples (when using host reset).
(7) HA Monitor startup setting
Set up HA Monitor to start automatically when the operating system starts. For details about how to configure this setting, see Automating the operation from system start through server start in the manual HA Monitor for Linux(R) (x86).