Nonstop Database, HiRDB Version 9 System Operation Guide
We recommend that you read this subsection if you are using MC/ServiceGuard as your cluster software.
To set up an environment for MC/ServiceGuard, see the explanation in this subsection and the documentation for MC/ServiceGuard. For more information about how to set up an MC/ServiceGuard environment, see the documentation for MC/ServiceGuard.
The unit that MC/ServiceGuard uses for switching systems is called a package. A package refers to a set of the following resources, which are necessary for applications to run:
Products that group MC/ServiceGuard with HiRDB are usually handled as a single package, which MC/ServiceGuard uses for switching systems. The following figures provide an overview of packaging and the flow of package processing by MC/ServiceGuard.
Figure 26-35 ackage overview
Figure 26-36 Flow of package processing by MC/ServiceGuard
Create a shell script for starting HiRDB (execute $PDDIR/bin/pdstart). Be sure to execute that shell script when you start the package (during package startup preprocessing). Set up the shell script for starting HiRDB so that the package control script for MC/ServiceGuard executes this shell script. The following figure shows the flow of HiRDB startup processing.
Figure 26-37 HiRDB startup processing flow (MC/ServiceGuard)
The following examples show shell scripts for starting HiRDB.
HiRDB single server configuration
#!/bin/sh PDDIR=/HiRDB_S PDCONFPATH=${PDDIR}/conf SHLIB_PATH=${PDDIR}/lib PATH=${PATH}:${PDDIR}/bin export PDDIR PDCONFPATH SHLIB_PATH PATH ${PDDIR}/bin/pdstart>/dev/null 2>&1 |
HiRDB parallel server configuration
#!/bin/sh PDDIR=/HiRDB_P PDCONFPATH=${PDDIR}/conf SHLIB_PATH=${PDDIR}/lib PATH=${PATH}:${PDDIR}/bin export PDDIR PDCONFPATH SHLIB_PATH PATH ${PDDIR}/bin/pdstart -q>/dev/null 2>&1 |
The following are possible causes of a pdstart command failure:
Items 1 to 4 can occur if the package is started before HiRDB has stopped. There is no means to accurately determine when one of these events might happen. In such a case, you can safely ignore the pdstart command error because it does not affect any other operations.
In the case of item 5, HiRDB cannot start because the HiRDB environment setup is incorrect. You must correct the environment setup.
If no system RDAREAs have been created, an instruction to create system RDAREAs (execute the pdinit command) is displayed during HiRDB startup (during execution of the pdstart command). The pdstart command started from MC/ServiceGuard executes in the background, so it cannot respond to this instruction. Therefore, before starting operation of MC/ServiceGuard, execute the pdstart command and make sure that system RDAREAs have been created.
Create a shell script for terminating HiRDB (executing $PDDIR/bin/pdstop), and start this shell script when the package stops. To do this, set a shell script that terminates HiRDB inside the package control script of MC/ServiceGuard. The following figure shows the flow of HiRDB termination processing.
Figure 26-38 HiRDB termination processing flow (MC/ServiceGuard)
The following examples show shell scripts for terminating HiRDB.
HiRDB single server configuration
#!/bin/sh PDDIR=/HiRDB_S PDCONFPATH=${PDDIR}/conf SHLIB_PATH=${PDDIR}/lib PATH=${PATH}:${PDDIR}/bin export PDDIR PDCONFPATH SHLIB_PATH PATH ${PDDIR}/bin/pdstop -f -q>/dev/null 2>&1 |
HiRDB parallel server configuration
#!/bin/sh PDDIR=/HiRDB_P PDCONFPATH=${PDDIR}/conf SHLIB_PATH=${PDDIR}/lib PATH=${PATH}:${PDDIR}/bin export PDDIR PDCONFPATH SHLIB_PATH PATH ${PDDIR}/bin/pdstop -z -q>/dev/null 2>&1 |
MC/ServiceGuard monitors services (applications). It executes a service as a sub-process, and when it detects service termination, it determines that a package error has occurred. The only interface between HiRDB and MC/ServiceGuard, except for HiRDB startup and termination processing, is service termination (exit). All HiRDB processes are monitored by pdprcd and are restarted by HiRDB after an abnormal termination. Therefore, there is no need to have MC/ServiceGuard monitor HiRDB processes. The following figure shows the relationship between process startup and monitoring.
Figure 26-39 Relationship between process startup and monitoring (MC/ServiceGuard)
To maintain the status in which HiRDB is running as a package, a dummy service (dummy process) is necessary. This dummy process must satisfy all of the following conditions:
The following example shows a shell script for generating a dummy process:
#!/bin/sh trap exit SIGTERM while true do sleep 5 done exit |
Specify this shell script in SERVICE_CMD in the package control script. To start a resident process, use SERVICE RESTART ="-R" in the package control script to specify unlimited startups. Otherwise, unexpected termination will be treated as an abnormal termination of the HiRDB server.
Specify the package's IP address (repositionable IP address) in the package control script.
IP[0] = Package-IP-address (repositionable-IP-address) |
This subsection provides and explains an example of a grouped MC/ServiceGuard and HiRDB configuration. The figure below shows the system configuration. In this case, HiRDB uses a HiRDB single server configuration.
Figure 26-40 Example of a grouped MC/ServiceGuard and HiRDB configuration
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 } |
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 |
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 |
Unit information definition
set pd_hostname = vr2001 |
All Rights Reserved. Copyright (C) 2011, 2015, Hitachi, Ltd.