====== HACMP resources denpendency ====== On an HACMP cluster with 2 resources, if you want to use dependencies to start one resource before the other, you have to use an "Application Monitor". ==== First select the relation parent/child between the resources: ==== # smitty hacmp --> Extended Configuration --> Extended Resource Configuration --> Configure Resource Group Run-Time Policies --> Configure Dependencies between Resource Groups --> Configure Parent/Child Dependency --> Add Parent/Child Dependency between Resource Groups Select the Parent Resource Group oradbdbrg oradbrtrg Select the Child Resource Group oradbrtrg Add Parent/Child Dependency between Resource Groups * Parent Resource Group [oradbdbrg] + * Child Resource Group [oradbrtrg] + ==== Second, create a custom script to monitor the startup of the parent resource (this is just a sample to test): ==== [root@oraclu1]/home/scripts# cat monitordb.sh #!/usr/bin/ksh logpath=`dirname $0` sn=`basename $0 | cut -d. -f1` logname=$logpath/$sn.log NUM=`date "+%d-%m-%Y %H:%M:%S"` process="/usr/sbin/writesrv" ps -ef | grep "$process" | grep -v grep > /dev/null 2>&1 if [ $? -eq 0 ] then echo "OK: $NUM process $process found" >> $logname exit 0 else echo "NOK: $NUM process $process not found" >> $logname exit 1 fi ==== Third, configure the monitoring of the parent resource in HACMP: ==== # smitty hacmp --> Extended Configuration --> Extended Resource Configuration --> HACMP Extended Resources Configuration --> Configure HACMP Applications Servers --> Configure HACMP Application Monitoring --> Configure Custom Application Monitors --> Add a Custom Application Monitor Add Custom Application Monitor * Monitor Name oradbdbmon Application Server(s) to Monitor oradbdbapp + * Monitor Mode [Startup Monitoring] + * Monitor Method [/home/scripts/monitordb.sh] Monitor Interval [60] # Hung Monitor Signal [9] # * Stabilization Interval [300] # Restart Count [0] # Restart Interval [0] # * Action on Application Failure [notify] + Notify Method [] Cleanup Method [] Restart Method [] ==== Now you can synchronize HACMP and test. ====