Scalable Database Server, HiRDB Version 8 System Operation Guide
This section provides an overview of Sun Cluster's service control and explains how to register HiRDB as a data service in the Sun Cluster environment using a Sun Cluster control script.
Use HA-API to register HiRDB as a data service in the Sun Cluster environment. Available APIs include data service registration (hareg), cluster status check (haget), etc. For details, see the Sun Cluster documentation.
A method refers to a call-out to a data service that occurs in each step during reconfiguration. The following methods are available:
For the HiRDB data service, register the control scripts that will be called when the Start (START, START_NET) and Stop (STOP, STOP_NET) methods occur.
To set up the HiRDB environment as a data service in the Sun Cluster environment, execution control using Sun Cluster HA-API must be carried out. This section explains an example of creating Sun Cluster control scripts for controlling the calling of methods from Sun Cluster. The following names are used for the Sun Cluster control scripts to be created:
Script to be executed by START_NET
#!/bin/sh ## ********************************************************************* ## HiRDB START_NET Control Script (for Sun Cluster) ## ********************************************************************* PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/SUNWcluster/bin:/HiRDB_S1/bin export PATH PDDIR=/HiRDB_S1 PDCONFPATH=/HiRDB_S1/conf LD_LIBRARY_PATH=/HiRDB_S1/lib export PDDIR PDCONFPATH LD_LIBRARY_PATH if [ "$1" != "sc-lnode0" ] then exit 0 fi $PDDIR/bin/pdstart |
Script to be executed by STOP_NET
#!/bin/sh
## *********************************************************************
## HiRDB STOP_NET Control Script (for Sun Cluster)
## *********************************************************************
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin:/opt/SUNWcluster/bin:/HiRDB_S1/bin
export PATH
PDDIR=/HiRDB_S1
PDCONFPATH=/HiRDB_S1/conf
LD_LIBRARY_PATH=/HiRDB_S1/lib
export PDDIR PDCONFPATH LD_LIBRARY_PATH
if [ "$2" != "sc-lnode0" ]
then
exit 0
fi
MASTER_HOST=`haget -f master -h sc-lnode0`
if [ $MASTER_HOST != `hostname` ]
then
exit 0
fi
$PDDIR/bin/pdstop -f -q*
|
Use Sun Cluster's hareg command to register the HiRDB data service hirdb00 into the logical host.
hareg -r hirdb00 -b "/HiRDB_S1/conf" -m START_NET="hirdb00-start_net.sh" -t START_NET=1800 -m STOP_NET="hirdb00-stop_net.sh" -t STOP_NET=300 -h sc-lnode0 -a 1 |
All Rights Reserved. Copyright (C) 2007, Hitachi, Ltd.