16.3.4 Setting up an HA Monitor environment
Set up an HA Monitor environment on all nodes. 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 nodes. The smaller the specification value, the higher the priority of resetting that node. Specify different values for the individual nodes as follows:
-
The master node needs to be the highest priority, so specify the smallest value of all the nodes.
-
Specify a different value for each slave node. The higher the reset priority of the slave node, the smaller the value you must specify. Specify higher node reset priorities for slave nodes you want to prioritize when switching over the master node.
-
-
monbegin_restart
Specify nouse.
-
multistandby
Specify use because HA Monitor's multi-standby function is used as the multi-node function.
-
usrcommand
Specify the absolute path for the user command that describes the settings for HADB.
Create the user command based on the appropriate template. For details about how to create a user command, see (b) Creating a user command in (4) Creating environment variable definitions for commands, and creating commands, and Creating user commands in the manual HA Monitor for Linux(R) (x86).
-
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, if the multi-node function is being used, we recommend that you use as the server directory a directory whose path name does not include spaces.
-
acttype
Specify monitor because the multi-node function runs 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 (d) 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 master node, and specify standby for a slave node.
-
disk
Specify the absolute path for the VG that includes the file system for the system directory and the file system that stores the synonym dictionary files. In the case of Figure 16‒1: Example of a system configuration using the multi-node function, specify /dev/vg_hadb and /dev/vg_hadb02.
If you do not intend to conduct synonym searches, you do not need to specify the absolute path of the VG that contains the file system where the synonym dictionary files are stored.
-
fs_name
Specify the absolute path for the logical volume that corresponds to the file system for the system directory and the file system that stores the synonym dictionary files. In the case of Figure 16‒1: Example of a system configuration using the multi-node function, specify /dev/vg_hadb/sys_hadb and /dev/vg_hadb02/hadb_syndict.
If you do not intend to conduct synonym searches, you do not need to specify the absolute path of the logical volume that corresponds to the file system where the synonym dictionary files are stored.
-
fs_mount_dir
Specify the path of the system directory ($DBDIR/ADBSYS) and the path of the directory where the file system that stores the synonym dictionary files is to be mounted.
As the path of the directory where the file system that stores the synonym dictionary files is to be mounted, specify the same path on each node.
If you do not intend to conduct synonym searches, you do not need to specify the path of the directory where the file system that stores the synonym dictionary files is to be mounted.
-
fs_mount_opt
Specify the mount option for mounting the system directory file system and the file system that stores the synonym dictionary files.
If you do not intend to conduct synonym searches, you do not need to specify the mount option for mounting the file system that stores the synonym dictionary files.
-
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 (e) 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 0.
-
waitserv_exec
Specify yes.
-
ip_neck
Specify use.
-
uoc_neck
Specify nouse.
-
vg_neck
Specify use.
If you will be performing synonym searches, also specify use for the file system that stores synonym dictionary files.
-
fs_neck
Specify use.
If you will be performing synonym searches, also specify use for the file system that stores synonym dictionary files.
-
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 (c) 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).
-
standbypri
Specify the node priority for the node to be made the master node in the case of a switchover. The smaller the specification value, the higher the priority. The higher the priority of the slave node, the smaller the value you must specify.
Specify a different value for each slave node.
Specify this operand in each slave node's HA Monitor (when standby is specified for the initial operand).
-
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 inherited at node switchover
In Figure 16‒1: Example of a system configuration using the multi-node function, FS001 and FS002 are file systems inherited at node switchover.
-
Disks for DB area files (excluding disks for work table DB areas)
In Figure 16‒1: Example of a system configuration using the multi-node function, LU001 to LU005 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.
- Important
-
Do not specify the device names of the following file systems and disks in this operand:
-
Node-local file system
In Figure 16‒1: Example of a system configuration using the multi-node function, LOC001 to LOC003 are node-local file systems.
-
Disk where work table DB area is stored
In Figure 16‒1: Example of a system configuration using the multi-node function, WRK001 to WRK003 are disks where work table DB areas are stored.
-
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 inherited at node switchover
In Figure 16‒1: Example of a system configuration using the multi-node function, FS001 and FS002 are file systems inherited at node switchover.
-
DB area file disks that are accessible from all nodes
In Figure 16‒1: Example of a system configuration using the multi-node function, LU001 to LU005 are DB area file disks that are accessible from all nodes.
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.
- Important
-
Do not specify the device names of the following file systems and disks in this operand:
-
Node-local file system
In Figure 16‒1: Example of a system configuration using the multi-node function, LOC001 to LOC003 are node-local file systems.
-
Disk where work table DB area is stored
In Figure 16‒1: Example of a system configuration using the multi-node function, WRK001 to WRK003 are disks where work table DB areas are stored.
-
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:
-
User command
-
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/multinode.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).
-
Environment variable ADBALIAS
Specify the value specified for the alias operand in the servers file of HA Monitor.
(b) Creating a user command
$ADBDIR/sample/scripts/multinode_user.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 startup command
$ADBDIR/sample/scripts/multinode_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.
(d) Creating a server termination command
The template for the server termination command differs according to whether you are using host reset or SCSI reservation for shared disk. When using host reset, the template is $ADBDIR/sample/scripts/multinode_term.sh. When using SCSI reservation for shared disk, the template is $ADBDIR/sample/scripts/multinode_term_scsi.sh.
Copy the applicable template and amend the following part of the file:
-
source statement
Specify for the argument of the source statement the absolute path for the file that specifies the environment variable definitions for commands.
(e) Creating a server-monitoring command
$ADBDIR/sample/scripts/multinode_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/multinode.env in this example)
-
User command file (/HADB/scripts/multinode_user.sh in this example)
-
Server startup command file (/HADB/scripts/multinode_act.sh in this example)
-
Server termination command file (/HADB/scripts/multinode_term.sh in this example)
-
Server-monitoring command file (/HADB/scripts/multinode_patrol.sh in this example)
The specification examples explained here assume the system configuration shown in Figure 16‒1: Example of a system configuration using the multi-node function.
(a) sysdef file specification examples
- ■ Specification example of the sysdef file for master node hadb01
-
environment name hadb01, address 1, ...1 patrol 30, ...2 lan path11, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 termcmd_at_abort nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node is the master node, its reset priority needs to be the highest, so 1 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
- ■ Specification example of the sysdef file for slave node hadb02
-
environment name hadb02, address 2, ...1 patrol 30, ...2 lan path21, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 termcmd_at_abort nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node needs to be the next highest priority after the master node, 2 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
- ■ Specification example of the sysdef file for slave node hadb03
-
environment name hadb03, address 3, ...1 patrol 30, ...2 lan path31, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 term_at_abort nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node needs to be the next highest priority after the slave node hadb02, 3 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path31, which corresponds to IP address 172.16.0.13.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
(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 master node hadb01
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use: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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify online to make this node the master node.
-
- ■ Specification example of the servers file for slave node hadb02
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 initial standby, ...11 standbypri 1; ...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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the highest priority, 1 is specified.
-
- ■ Specification example of the servers file for slave node hadb03
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 initial standby, ...11 standbypri 2; ...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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the next highest priority after the node hadb02, 2 is specified.
-
(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/multinode.env. Use the same specification content for all nodes.
- ■ Specification example of the file for environment variable definitions for commands
-
# The environment variables for HADB export ADBMGR=adbmanager ...1 export ADBALIAS=HADB ...2 export ADBDIR=/HADB/server ...3
Explanation
-
Specify user name adbmanager for the HADB administrator (OS user).
-
Specify HADB, which is the value specified for the alias operand in the servers file of HA Monitor.
-
Specify the absolute path for the server directory.
-
(d) Specification example of the user command file
In this example, the user command is stored in /HADB/scripts/multinode_user.sh. Use the same specification content for all nodes.
- ■ Specification example of the user command file
-
#!/bin/sh # Sample of the usrcommand for HADB # Setting environment variables for HADB source /HADB/scripts/multinode.env ...1 ############################################################################### # Main ############################################################################### KIND_ONLINE="online" KIND_STANDBY="standby" SERV_START="-s" SERV_END="-e" SERV_PLANEND="-p" SERV_ABORT="-a" SERV_ABORT_NS="-o" SERV_FAULT="-f" SERV_HOSTDOWN="-h" SERV_PLANSWAP="-w" STATUS_START="start" STATUS_END="end" STATUS_SBYEND="sbyend" patrol_sby_exe() { $ADBDIR/bin/patrol_sby_exe ...2 } patrol_sby_term() { $ADBDIR/bin/patrol_sby_term ...3 } stop_sby() { $ADBDIR/bin/stop_sby ...4 } # Processing of the server if [ "$2" = "$ADBALIAS" ] then if [ "$4" = "$KIND_ONLINE" ] then case "$5" in "$SERV_START" ) ;; "$SERV_END" ) ;; "$SERV_PLANEND" ) ;; "$SERV_ABORT" ) ;; "$SERV_ABORT_NS" ) ;; "$SERV_PLANSWAP" ) ;; esac else case "$5" in "$SERV_START" ) [ "$6" = "$STATUS_START" ] && patrol_sby_exe & ;; "$SERV_END" ) [ "$6" = "$STATUS_START" -o "$6" = "$STATUS_SBYEND" ] && stop_sby ;; "$SERV_PLANEND" ) [ "$6" = "$STATUS_START" ] && patrol_sby_term ;; "$SERV_ABORT" ) [ "$6" = "$STATUS_START" ] && patrol_sby_term [ "$6" = "$STATUS_SBYEND" ] && stop_sby ;; "$SERV_FAULT" ) [ "$6" = "$STATUS_START" ] && stop_sby ;; "$SERV_HOSTDOWN" ) [ "$6" = "$STATUS_START" ] && patrol_sby_term ;; "$SERV_PLANSWAP" ) [ "$6" = "$STATUS_START" ] && patrol_sby_term ;; esac fi fi exit 0
Explanation
-
For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/multinode.env).
-
Specify the command for starting the monitoring of the slave node.
-
Specify the command for ending the monitoring of the slave node.
-
Specify the command for terminating the slave node.
-
(e) Specification example of the server startup command file
In this example, the server startup command is stored in /HADB/scripts/multinode_act.sh. Use the same specification content for all nodes.
- ■ Specification example of the server startup command file
-
#!/bin/sh # Sample of the actcommand for HADB SU=/bin/su # Setting environment variables for HADB source /HADB/scripts/multinode.env ...1 # Execute adbchgnodetype command $SU - $ADBMGR -c "$ADBDIR/bin/adbchgnodetype --master -n $ADBALIAS" CHGNODERES=$? if [ "$CHGNODERES" = "0" -o "$CHGNODERES" = "4" ] then exit 0 else exit $CHGNODERES fi
Explanation
-
For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/multinode.env).
-
(f) Specification example of the server termination command file
In this example, the server termination command is stored in /HADB/scripts/multinode_term.sh. Use the same specification content for all nodes.
- ■ 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 GREP=/bin/grep SU=/bin/su # Setting environment variables for HADB source /HADB/scripts/multinode.env ...1 # Execute adbstop command while : 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 } }'` case "$1" in "-e" ) # Normal stop operations of master node. # (when the monend command is executed.) if [ "$GET_STS" = "$STS_ACTIVE" -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 "$ADBDIR/bin/adbstop --cancel" STOPRES=$? if [ "$STOPRES" = "0" -o "$STOPRES" = "4" ] then break fi elif [ "$GET_STS" = "$STS_STARTING" ] then break else break fi ;; "-w" ) # Plan stop operations of master node. # (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 "$ADBDIR/bin/adbstop --cancel --node" STOPRES=$? if [ "$STOPRES" = "0" -o "$STOPRES" = "4" ] then break fi else break fi ;; "-c" ) break ;; esac done # 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/multinode.env).
-
(g) Specification example of the server-monitoring command file
In this example, the server-monitoring command is stored in /HADB/scripts/multinode_patrol.sh. Use the same specification content for all nodes.
- ■ 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 # Setting environment variables for HADB source /HADB/scripts/multinode.env ...1 # Execute adbmonitor command for master node $SU - $ADBMGR -c "$ADBDIR/bin/adbmonitor -n" & ## Get su command process id 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/multinode.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/multinode.env in this example)
-
User command file (/HADB/scripts/multinode_user.sh in this example)
-
Server startup command file (/HADB/scripts/multinode_act.sh in this example)
-
Server termination command file (/HADB/scripts/multinode_term_scsi.sh in this example)
-
Server-monitoring command file (/HADB/scripts/multinode_patrol.sh in this example)
The specification examples explained here assume the system configuration shown in Figure 16‒1: Example of a system configuration using the multi-node function.
(a) sysdef file specification examples
- ■ Specification example of the sysdef file for master node hadb01
-
environment name hadb01, address 1, ...1 patrol 30, ...2 lan path11, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 termcmd_at_abort nouse, fence_reset nouse, ...6 fence_scsi use, ...7 fence_lan nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node is the master node, its reset priority needs to be the highest, so 1 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
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 slave node hadb02
-
environment name hadb02, address 2, ...1 patrol 30, ...2 lan path21, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 termcmd_at_abort nouse, fence_reset nouse, ...6 fence_scsi use, ...7 fence_lan nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node needs to be the next highest priority after the master node, 2 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
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 slave node hadb03
-
environment name hadb03, address 3, ...1 patrol 30, ...2 lan path31, ...3 lanport HAmon1; ...4 function pathpatrol 240, connect_retry 5:200, monbegin_restart nouse, multistandby use, usrcommand /HADB/scripts/multinode_user.sh, ...5 termcmd_at_abort nouse, fence_reset nouse, ...6 fence_scsi use, ...7 fence_lan nouse;
Explanation
-
Specifies the order of priority for resetting this node. Because this node needs to be the next highest priority after the slave node hadb02, 3 is specified.
-
Specify a value of 30 or less for the patrol operand.
-
Specify the host name of the LAN that is used for HA Monitor's monitoring path. Specify host name path31, which corresponds to IP address 172.16.0.13.
-
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.
-
Specify the absolute path for the user command to be used by the multi-node function.
-
Because host reset will not be used, specify nouse.
-
Because SCSI reservation for shared disk will be used, specify use.
-
(b) Specification example of a servers file (when using a single-path configuration)
The following describes examples of specifying a servers file in a single-path configuration.
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 master node hadb01
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 scsi_device /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b53e0a: ...11 /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b6c44d: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f, 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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify online to make this node the master node.
-
- ■ Specification example of the servers file for slave node hadb02
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 scsi_device /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b53e0a: ...11 /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b6c44d: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f, initial standby, ...12 standbypri 1; ...13
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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the highest priority, 1 is specified.
-
- ■ Specification example of the servers file for slave node hadb03
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 scsi_device /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b53e0a: ...11 /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b6c44d: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3: /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f, initial standby, ...12 standbypri 2; ...13
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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the next highest priority after the node hadb02, 2 is specified.
-
(c) Specification example of a servers file (when using a redundant configuration realized by multipath software)
The following describes examples of specifying a servers file in a redundant configuration realized by multipath software.
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 master node hadb01
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 dmmp_device /dev/mapper/mpath1: ...11 /dev/mapper/mpath2: /dev/mapper/mpath11: /dev/mapper/mpath12: /dev/mapper/mpath13: /dev/mapper/mpath14: /dev/mapper/mpath15, 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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify online to make this node the master node.
-
- ■ Specification example of the servers file for slave node hadb02
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 dmmp_device /dev/mapper/mpath1: ...11 /dev/mapper/mpath2: /dev/mapper/mpath11: /dev/mapper/mpath12: /dev/mapper/mpath13: /dev/mapper/mpath14: /dev/mapper/mpath15, initial standby, ...12 standbypri 1; ...13
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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the highest priority, 1 is specified.
-
- ■ Specification example of the servers file for slave node hadb03
-
server name /HADB/server, ...1 alias HADB, acttype monitor, disk /dev/vg_hadb: ...2 /dev/vg_hadb02, lan_updown use, fs_name /dev/vg_hadb/sys_hadb: ...3 /dev/vg_hadb02/hadb_syndict, fs_mount_dir /HADB/db/ADBSYS: ...4 /mnt/syndict, fs_mount_opt "-t ext4 -o defaults,noatime,_netdev": ...5 "-t ext4 -o defaults,noatime,_netdev", actcommand "/HADB/scripts/multinode_act.sh", ...6 termcommand "/HADB/scripts/multinode_term_scsi.sh", ...7 patrolcommand "/HADB/scripts/multinode_patrol.sh", ...8 servexec_retry 0, waitserv_exec yes, ip_neck use, uoc_neck nouse, vg_neck use:use, ...9 fs_neck use:use, ...10 dmmp_device /dev/mapper/mpath1: ...11 /dev/mapper/mpath2: /dev/mapper/mpath11: /dev/mapper/mpath12: /dev/mapper/mpath13: /dev/mapper/mpath14: /dev/mapper/mpath15, initial standby, ...12 standbypri 2; ...13
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:
-
System directory
-
The directory storing synonym dictionary files (a directory created in order to perform synonym searches)
-
-
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 by the multi-node function.
-
Specify the absolute path for the server termination command to be used by the multi-node function.
-
Specify the absolute path for the server-monitoring command to be used by the multi-node function.
-
For the VGs that contain the file systems of the directories in 2, specify use.
-
For the file systems of the directories in 2, specify use.
-
Specify the absolute paths of the disks that store the following files and file systems:
-
File system where the system directory is created
-
File system where the directory that stores synonym dictionary files is created
-
DB area files (excluding work table DB area files)
Specify the absolute paths in the same order on all nodes.
-
-
Specify standby to make this node a slave node.
-
Specify the node priority for the node to be made the master node in the case of a switchover. Because this node needs to be the next highest priority after the node hadb02, 2 is specified.
-
(d) 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).
(e) Specification example of the user command file
For an example of specifying a user command file, see (d) Specification example of the user command file in (5) File specification examples (when using host reset).
(f) Specification example of the server startup command file
For a specification example of the server startup command file, see (e) Specification example of the server startup command file in (5) File specification examples (when using host reset).
(g) Specification example of the server termination command file
In this example, the server termination command is stored in /HADB/scripts/multinode_term_scsi.sh. Use the same specification content for all nodes.
- ■ 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 GREP=/bin/grep SU=/bin/su # Setting environment variables for HADB source /HADB/scripts/multinode.env ...1 # Execute adbstop command while : 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 } }'` case "$1" in "-e" ) # Normal stop operations of master node. # (when the monend command is executed.) if [ "$GET_STS" = "$STS_ACTIVE" -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 "$ADBDIR/bin/adbstop --cancel" STOPRES=$? if [ "$STOPRES" = "0" -o "$STOPRES" = "4" ] then break fi elif [ "$GET_STS" = "$STS_STARTING" ] then break else break fi ;; "-w" ) # Plan stop operations of master node. # (When the monswap command is executed or a monitoring path failure occurs.) 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" = "0" -o "$STOPRES" = "4" ] then break fi else break fi ;; "-c" ) break ;; esac done # 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/multinode.env).
-
(h) Specification example of the server-monitoring command file
For a specification example of the server-monitoring command file, see (g) 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).