Nonstop Database, HiRDB Version 9 System Operation Guide

[Contents][Index][Back][Next]

26.2.12 LifeKeeper preparations

We recommend that you read this subsection if you are using LifeKeeper as your cluster software.

You must create these resources in the order described below, and HiRDB must be stopped when you create them.

For details about how to set up a LifeKeeper environment, see the LifeKeeper documentation.

Note
The only cluster configurations in which HiRDB guarantees operations in LifeKeeper are a shared disk (SAN/SCSI) configuration and a 1:1 connection configuration (a 1-to-1 system switchover configuration or a mutual system switchover configuration).
Organization of this subsection
(1) Creating IP resources
(2) Creating file system resources
(3) Creating raw device resources
(4) Creating generic ARK resources
(5) Creating a resource hierarchy

(1) Creating IP resources

Create IP resources and set up a virtual IP address (HiRDB alias IP address) in LifeKeeper. You need to create IP resources only if the IP address is to be inherited after a system switchover.

Set the host name specified in the -x option of the pdunit operand of the system common definition as the virtual IP address.

To set up a virtual IP address, from the GUI window of LifeKeeper, choose Edit, Server, Create Resource Hierarchy, and then IP. In the window that opens, select or specify the items listed in the following table:

Item Value to be selected or specified
Switchback Type Select intelligent.
Server Specify the host name of the primary system
IP Resource Specify the host name specified in the -x option of the pdunit operand or an IP address.
Netmask Specify the host name specified in the -x option of the pdunit operand or the netmask of an IP address.
Network Interface Specify the interface to which the virtual IP address is to be assigned.
IP Resource Tag Specify an IP resource name for managing LifeKeeper.

Once you have completed the setup for the primary system, set up the secondary system. Set up the items described in the above table for the secondary system.

(2) Creating file system resources

Create file system resources to set up a shared disk in LifeKeeper. You need to create file system resources if you create HiRDB file system areas in regular files.

Perform this setup after you have verified that a shared disk has been allocated to the primary system.

To set up a shared disk, from the GUI window of LifeKeeper, choose Edit, Server, Create Resource Hierarchy, and then File System. In the window that opens, select or specify the items listed in the following table:

Item Value to be selected or specified
Switchback Type Select intelligent.
Server Specify the host name of the primary system
Mount Point Select the mount point of the shared disk.
Root Tag Specify a name for managing LifeKeeper.

Once you have completed the setup for the primary system, set up the secondary system. Set up the items described in the above table for the secondary system.

(3) Creating raw device resources

Create raw device resources to set up a shared disk in LifeKeeper. You need to create raw device resources if you are creating HiRDB file system areas in character special files.

To set up a shared disk, from the GUI window of LifeKeeper, choose Edit, Server, Create Resource Hierarchy, and then Raw Device. In the window that opens, select or specify the items listed in the following table:

Item Value to be selected or specified
Switchback Type Select intelligent.
Server Specify the host name of the primary system.
Raw Partition Select a partition for the shared disk.
Root Tag Specify a name for managing LifeKeeper.

Once you have completed the setup for the primary system, set up the secondary system. Set up the items described in the above table for the secondary system.

(4) Creating generic ARK resources

Create Generic ARK resources to set up HiRDB in LifeKeeper, and create resources for HiRDB (or a unit for a HiRDB parallel server configuration).

(a) Creating scripts

Prepare the scripts described below. After you have created a shell script for HiRDB (or a unit for a HiRDB parallel server configuration), specify the path of the shell script for HiRDB (or unit) in the script provided by LifeKeeper.

LifeKeeper-provided shell script
Using the LifeKeeper-provided sample script, create the scripts listed below. To create them, refer to the examples in HiRDB single server configuration or HiRDB parallel server configuration.
  • Start (Restore) script
  • Stop (Remove) script

HiRDB shell script
Create the shell scripts listed below. To create them, refer to the examples in HiRDB single server configuration or HiRDB parallel server configuration.
  • Shell script for starting HiRDB (or unit) (pdstart.sh)
  • Shell script for terminating HiRDB (or unit) (pdstop.sh)
  • Shell script for displaying the HiRDB status (unit operation status) (pdls.sh)

Assign shell script execution permission to the HiRDB administrator or the root user. Note that these scripts must be stored in both the primary and secondary systems.

Examples of these scripts are listed and explained below. In these examples, hirdb is used as the user ID of the HiRDB administrator, and the script timeout is set to 600 (seconds).

HiRDB single server configuration
[Figure] Start (Restore) script and Stop (Remove) script
In a HiRDB single server configuration, specify the same content for the Start (Restore) script and the Stop (Remove) script. The examples show only the protection-target parameter setup (user definition) part for specifying HiRDB settings and the parameter initialization part.
 
    :
 
#######################################
# Protection-target parameter setup (user definition) #
#######################################
 
    :
APP_START="su - hirdb -c /HiRDB_S/conf/pdstart.sh"
                                       # Start command.............1
APP_START_ARGS=""                      # Start command argument
 
APP_STOP="su - hirdb -c /HiRDB_S/conf/pdstop.sh"
                                       # Stop command.............2
APP_STOP_ARGS=""                       # Stop command argument
 
APP_FORCE_STOP=""                      # Forced termination command
APP_FORCE_STOP_ARGS=""                 # Forced termination command argument
 
APP_CHECK[0]="/HiRDB_S/conf/pdls.sh"   # Operation check command 1........3
APP_CHECK_ARGS[0]=""                   # Argument of the above command
 
# APP_CHECK[1]=""                      # Operation check command 2
# APP_CHECK_ARGS[1]=""                 # Argument of the above command
 
 
####################
# Parameter initialization #
####################
 
    :
DEFAULT_TIMEOUT=600          # Script timeout value
START_SUCCESS_CODE=0         # Return value for the start status of the operation check command
STOP_SUCCESS_CODE=12         # Return value for the stop status of the operation check command
CHECK_RETRY_CODE=4           # Return value indicating the need
                             # to retry the operation check command
    :
 
Explanation
  1. For the start command, code the shell script for starting HiRDB (pdstart.sh).
  2. For the stop command, code the shell script for stopping HiRDB (pdstop.sh).
  3. For operation check command 1, code the shell script for displaying the status of HiRDB (pdls.sh).
[Figure] Shell script for starting HiRDB (pdstart.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_S
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdstart
 
[Figure] Shell script for stopping HiRDB (pdstop.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_S
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdstop -f -q...................................1
 
Explanation
  1. Use forced termination (pdstop -f -q) as the termination command so that the system switches over quickly.
[Figure] Shell script for displaying the status of HiRDB (pdls.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_S
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdls -d ust
 

HiRDB parallel server configuration
For a HiRDB parallel server configuration, the content to be specified differs between the Start (Restore) script and the Stop (Remove) script. The examples show only the protection-target parameter setup (user definition) part for specifying HiRDB settings, the parameter initialization part, the Function part, and the Main (restore) part.
Note
When a unit's resource starts in a HiRDB parallel server configuration, the unit's resource becomes active on LifeKeeper's GUI window when a shell script for starting a unit is executed. When a unit's resource is being switched, the unit's resource also becomes active on LifeKeeper's GUI window when a shell script for starting the switching-destination unit is executed. To determine whether the unit has started successfully or whether a system switchover has finished, check for the message KFPS05110-I in syslogfile. If the message KFPS05110-I has been output, unit startup or a system switchover has finished.
If an error message has been output to syslogfile and unit startup failed, remove the cause of the startup failure, choose Out of Service in the GUI operation in LifeKeeper to stop the unit's resource, and then restart it.
[Figure] Start (Restore) script
 
    :
 
#######################################
# Protection-target parameter setup (user definition) #
#######################################
 
    :
APP_START="su - hirdb -c /HiRDB_P/conf/pdstart.sh"
                                       # Start command.............1
APP_START_ARGS=""                      # Start command argument
 
APP_STOP="su - hirdb -c /HiRDB_P/conf/pdstop.sh"
                                       # Stop command.............2
APP_STOP_ARGS=""                       # Stop command argument
 
APP_FORCE_STOP=""                      # Forced termination command
APP_FORCE_STOP_ARGS=""                 # Forced termination command argument
 
APP_CHECK[0]=""                        # Operation check command 1........3
APP_CHECK_ARGS[0]=""                   # Argument of the above command
 
# APP_CHECK[1]=""                      # Operation check command 2
# APP_CHECK_ARGS[1]=""                 # Argument of the above command
 
 
####################
# Parameter initialization #
####################
 
    :
DEFAULT_TIMEOUT=600          # Script timeout value
START_SUCCESS_CODE=0         # Return value for the start status of the operation check command
STOP_SUCCESS_CODE=12         # Return value for the stop status of the operation check command
CHECK_RETRY_CODE=4           # Return value indicating the need
                             # to retry the operation check command
    :
 
############
# Function #
############
 
# Startup processing.............................................................4
APP_start()
{
echo "$(date +'[%Y/%m/%d %H:%M:%S]') : $TAG starting on $HOSTNAME"  >> $lklog
$APP_START $APP_START_ARGS >> $lklog 2>&1 &
}
 
    :
 
##################
# Main (restore) #
##################
 
    :
# Start.................................................................5
APP_start
 
exit 0
 
Explanation
For a HiRDB parallel server configuration, conditions 3 through 5 must be satisfied in order not to wait for the termination of the shell script (pdstart.sh) before starting a unit.
  1. For the start command, code the path for the shell script for starting a unit (pdstart.sh).
  2. For the stop command, code the path for the shell script for stopping a unit (pdstop.sh).
  3. Do not specify operation check command 1.
  4. After the execution of the startup command inside the startup processing, delete the wait processing.
  5. After the execution of the startup processing, delete the operation check command execution part. Also, insert a process that returns 0 after the startup command executes so that the Start (Restore) script terminates normally.
[Figure] Stop (Remove) script
 
    :
 
#######################################
# Protection-target parameter setup (user definition) #
#######################################
 
    :
APP_START="su - hirdb -c /HiRDB_P/conf/pdstart.sh"
                                       # Start command.............1
APP_START_ARGS=""                      # Start command argument
 
APP_STOP="su - hirdb -c /HiRDB_P/conf/pdstop.sh"
                                       # Stop command.............2
APP_STOP_ARGS=""                       # Stop command argument
 
APP_FORCE_STOP=""                      # Forced termination command
APP_FORCE_STOP_ARGS=""                 # Forced termination command argument
 
APP_CHECK[0]="/HiRDB_P/conf/pdls.sh"
                                       # Operation check command 1........3
APP_CHECK_ARGS[0]=""                   # Argument of the above command
 
# APP_CHECK[1]=""                      # Operation check command 2
# APP_CHECK_ARGS[1]=""                 # Argument of the above command
 
 
####################
# Parameter initialization #
####################
 
    :
DEFAULT_TIMEOUT=600          # Script timeout value
START_SUCCESS_CODE=0         # Return value for the start status of the operation check command
STOP_SUCCESS_CODE=12         # Return value for the stop status of the operation check command
CHECK_RETRY_CODE=4           # Return value indicating the need
                             # to retry the operation check command
    :
 
Explanation
  1. For the start command, code the path for the shell script for starting a unit (pdstart.sh).
  2. For the stop command, code the path for the shell script for stopping a unit (pdstop.sh).
  3. For operation check command 1, code the path for the shell script for displaying the operating status of a unit (pdls.sh).
[Figure] Shell script for starting a unit (pdstart.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_P
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdstart -q &....................................1
 
Explanation
  1. For a HiRDB parallel server configuration, add & to the pdstart -q command so that you do not have to wait for the termination of the shell script for starting a unit, and then execute the command in the background.
[Figure] Shell script for stopping a unit (pdstop.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_P
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdstop -z -q....................................1
 
Explanation
  1. Use forced termination (pdstop -z -q) as the termination command so that the system switches over quickly.
[Figure] Shell script for displaying the operating status of a unit (pdls.sh)
 
#!/bin/sh -x
 
PDDIR=/HiRDB_P
PDCONFPATH=${PDDIR}/conf
LD_LIBRARY_PATH=${PDDIR}/lib:${LD_LIBRARY_PATH}
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH PATH LD_LIBRARY_PATH
 
$PDDIR/bin/pdls -d ust
 
(b) Registering scripts

Register scripts and create resources for HiRDB (or a unit for a HiRDB parallel server configuration).

To register scripts, from the GUI window of LifeKeeper, choose Edit, Server, Create Resource Hierarchy, and then Generic Application. In the window that opens, select or specify the items listed in the following table:

Item Value to be selected or specified
Switchback Type Select intelligent.
Server Specify the host name of the primary system
Restore Script Specify the storage location of the Start (Restore) script.
Remove Script Specify the storage location of the Stop (Remove) script.
QuickCheck Script Do not specify this item.
Application Info Do not specify this item.
Bring Resource In Service Select No.
Resource Tag Specify a resource name for managing LifeKeeper.

After you have completed the setup for the primary system, the screen will shift to the Pre-Extend Wizard window for setting up the secondary system. However, choose Cancel and use the GUI window of LifeKeeper to verify that HiRDB resources are set up for the primary system. If a HiRDB parallel server configuration contains multiple units, register scripts for each unit and verify that resources have been created for all units.

After completing the above steps, right-click the resource icon of HiRDB (or unit) to display a menu, and choose In Service to start HiRDB (or unit). After HiRDB (or unit) startup has finished, verify that the resource of HiRDB (or unit) has become enabled on the GUI window. Then, choose Extend Resource Hierarchy to set up the secondary system.

(5) Creating a resource hierarchy

Set up a hierarchy for the resources you created.

To set up the resource hierarchy, right-click the resource icon of HiRDB (or a unit for a HiRDB parallel server configuration) to display a menu, and then choose Create Dependency. Set up the parent resources and child resources as follows:

Parent resources

Child resources