Hitachi

Hitachi Advanced Database Setup and Operation Guide


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:

(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:

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:

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:

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.

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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. 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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. 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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. Specify standby to make this node a slave node.

  12. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. Specify standby to make this node a slave node.

  12. 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

  1. Specify user name adbmanager for the HADB administrator (OS user).

  2. Specify HADB, which is the value specified for the alias operand in the servers file of HA Monitor.

  3. 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

  1. For the source statement, specify the absolute path for the file for environment variable definitions for commands (/HADB/scripts/multinode.env).

  2. Specify the command for starting the monitoring of the slave node.

  3. Specify the command for ending the monitoring of the slave node.

  4. 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

  1. 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

  1. 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

  1. 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.

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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. Specify the absolute path for the user command to be used by the multi-node function.

  6. Because host reset will not be used, specify nouse.

  7. 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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. Specify the absolute path for the user command to be used by the multi-node function.

  6. Because host reset will not be used, specify nouse.

  7. 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

  1. 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.

  2. Specify a value of 30 or less for the patrol operand.

  3. 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.

  4. 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.

  5. Specify the absolute path for the user command to be used by the multi-node function.

  6. Because host reset will not be used, specify nouse.

  7. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. Specify standby to make this node a slave node.

  13. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. Specify standby to make this node a slave node.

  13. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. Specify standby to make this node a slave node.

  13. 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

  1. Specify the absolute path for the server directory.

  2. 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)

  3. Specify the absolute paths of the LVs where the file systems are set up that will store the directories in 2.

  4. Specify the absolute paths for the mount points at which to mount the file systems for the directories in 2.

  5. Specify options for the mount command to be used for mounting the file systems for the directories in 2.

  6. Specify the absolute path for the server startup command to be used by the multi-node function.

  7. Specify the absolute path for the server termination command to be used by the multi-node function.

  8. Specify the absolute path for the server-monitoring command to be used by the multi-node function.

  9. For the VGs that contain the file systems of the directories in 2, specify use.

  10. For the file systems of the directories in 2, specify use.

  11. 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.

  12. Specify standby to make this node a slave node.

  13. 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

  1. 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).