25.7.6 Example of grouped MC/ServiceGuard and HiRDB configuration

This section provides and explains an example of a grouped MC/ServiceGuard and HiRDB configuration. Figure 25-49 shows the system configuration. In this case, HiRDB uses a HiRDB/Single Server.

Figure 25-49 Example of grouped MC/ServiceGuard and HiRDB configuration

[Figure]

Organization of this subsection
(1) Package control script
(2) Shell script
(3) HiRDB system definitions

(1) Package control script

Definitions related to system configuration

VGCHANGE="vgchange -a e"
VG[0]=vg10
LV[0]=/dev/vg10/lvol11; FS[0]=/hirdb
IP[0]=192.168.30.51
SUBNET[0]=192.168.30.0

MC/ServiceGuard service registration (definitions for monitoring HiRDB startup and termination)

SERVICE_NAME[0]=hirdb

#Service = specifies the process to be monitored [required]
#MC/ServiceGuard starts and monitors for process termination.
SERVICE_CMD[0]=/etc/cmcluster/hirdb_pkg/monitor.sh         1
SERVICE_RESTART[0]="-R"

#Service startup preprocessing: Start HiRDB here.
function customer_defined_run_cmds
{
/etc/cmcluster/hirdb_pkg/run.sh                            2
test_return 51
}

#Service stop preprocessing: Stop HiRDB here.
function customer_defined_halt_cmds
{
/etc/cmcluster/hirdb_pkg/halt.sh                           3
test_return 52
}

Explanation
  1. Specifies the shell script for generating a dummy script.
  2. Specifies the shell script for starting HiRDB.
  3. Specifies the shell script for terminating HiRDB.

(2) Shell script

Shell script for generating a dummy script (monitor.sh)

!/bin/ksh
trap exit SIGTERM
while true
do
  sleep 5
done
exit

Shell script for starting HiRDB (run.sh)

#!/bin/sh
PDDIR=/home/test
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
/home/test/bin/pdstart > /dev/null 2>&1

Shell script for terminating HiRDB (halt.sh)

#!/bin/sh
export PDDIR=/home/test
export PDCONFPATH=${PDDIR}/conf
export SHLIB_PATH=${PDDIR}/lib
export PATH=${PATH}:${PDDIR}/bin
/home/test/bin/pdstop -f -q> /dev/null 2>&1

(3) HiRDB system definitions

System common definitions

set pd_mode_conf = MANUAL1
set pd_ha_ipaddr_inherit = Y
set pd_ha   = use
pdunit -x pkghost -u puid -d /home/test
pdstart -t SDS -s sds -x pkghost

Note
Specify the host name that corresponds to the repositionable IP address for accessing the package.

Unit information definition

set pd_hostname = vr2001