Operating System - HP-UX
1816940 Members
3847 Online
109574 Solutions
New Discussion юеВ

Serviceguard A.11.19 and external script

 
SOLVED
Go to solution
Ahmed_58
Regular Advisor

Serviceguard A.11.19 and external script

Dears,

we have new OS 11.23 installation, with "ServiceGuard A.11.19", a failover package created, now I need to add start/stop for Oracle with package start/stop.

I can see a "external_script.template" in ./examples directory, but don't now how to configure/call the command, all I need is to add oracle start/stop command with the package, as this version do not have a pkg control file.

regards,
Ahmed
8 REPLIES 8
Stephen Doud
Honored Contributor

Re: Serviceguard A.11.19 and external script

Hello Ahmed,

Version B.05.00 of T1909BA - the Enterprise Cluster Master Toolkit (ECMT), is the first version of the toolkit product that enables the administrator to create an Oracle package with the modular package configuration file. It supports A.11.18 (with patches) and A.11.19.

When installed, the product loads /etc/cmcluster/scripts and ../modules with files that are linked to the package configuration file when you create the package configuration file thus:
$ cmmakepkg -m ecmt/oracle/oracle pkg.conf

Along with standard package parameters, you also customize the following parameters (as needed) that are included in the package configuration file:
ecmt/oracle/oracle/TKIT_DIR
ecmt/oracle/oracle/INSTANCE_TYPE
#ecmt/oracle/oracle/ORACLE_HOME
ecmt/oracle/oracle/ORACLE_ADMIN
#ecmt/oracle/oracle/SID_NAME
ecmt/oracle/oracle/ASM
#ecmt/oracle/oracle/ASM_DISKGROUP
#ecmt/oracle/oracle/ASM_VOLUME_GROUP
#ecmt/oracle/oracle/ASM_HOME
ecmt/oracle/oracle/ASM_USER
#ecmt/oracle/oracle/ASM_SID
ecmt/oracle/oracle/LISTENER
#ecmt/oracle/oracle/LISTENER_NAME
#ecmt/oracle/oracle/LISTENER_PASS
ecmt/oracle/oracle/PFILE
ecmt/oracle/oracle/MONITOR_PROCESSES
ecmt/oracle/oracle/MAINTENANCE_FLAG
ecmt/oracle/oracle/MONITOR_INTERVAL
ecmt/oracle/oracle/TIME_OUT
ecmt/oracle/oracle/PARENT_ENVIRONMENT
ecmt/oracle/oracle/CLEANUP_BEFORE_STARTUP
ecmt/oracle/oracle/USER_SHUTDOWN_MODE
ecmt/oracle/oracle/KILL_ASM_FOREGROUNDS

Then you copy the /opt/cmcluster/toolkit/oracle/<scripts> to the TKIT directory specified in the ecmt/oracle/oracle/TKIT_DIR parameter above and perform cmapplyconf on the package configuration file. This loads the cluster binary file with pointers to the Oracle toolkit scripts that will be used when the package is started or stopped.

Homework assignment:
Read
http://docs.hp.com/en/ha.html -> HP Enterprise Cluster Master Toolkit ->
Modular Package support in Serviceguard for Linux and ECM Toolkits

http://docs.hp.com/en/ha.html -> Serviceguard ->
Migrating Packages from Legacy to Modular Style, October 2007

/opt/cmcluster/toolkit/oracle/README (exists if you installed the ECMT product)
Ahmed_58
Regular Advisor

Re: Serviceguard A.11.19 and external script

Dear Stephen,

all I need is to start/stop Oracle/Database when package start/stop, so it is only one command with su - oracle? do I really need to do all this?

Ahmed
rariasn
Honored Contributor

Re: Serviceguard A.11.19 and external script

Hi,

Modify "script control package":

customer_defined_halt_cmds:

su - oracle -c /etc/cmcluster/examples/script_to_stop_oracle

customer_defined_run_cmds:

su - oracle -c /etc/cmcluster/examples/script_to_start_oracle

Copy "script control package" to other nodes of cluster.

rgs,

rgs,
Stephen Doud
Honored Contributor

Re: Serviceguard A.11.19 and external script

There are two ways to configure a package - the 'legacy' method, which rariasn alluded to, and the new modular package, which you alluded to when you called out "external_script.template".

You need to decide which method suits you best. First, learn how to implement either by reading the Managing Serviceguard manual located at http://docs.hp.com/en/ha.html -> Serviceguard -> User Guide

Also, if the Enterprise Cluster Master toolkit is installed, use the /opt/cmcluster/toolkit/oracle/README document for guidance.

If ECMT is not installed, you have to decide how to provide the control mechanism to start/stop and monitor the Oracle instance from custom scripts called from either the customer_defined_run/halt_cmds (legacy package control script) or from external_scripts (modular package configuration file).
Ahmed_58
Regular Advisor

Re: Serviceguard A.11.19 and external script

thanks Stephen,
as i'm using version 11.19 therefore we must use the modular script "external_script.template" , but don't how/where to use it, and how to call the script.

Ahmed
Matti_Kurkela
Honored Contributor
Solution

Re: Serviceguard A.11.19 and external script

The script location is configured in the modular-style package configuration file using the keyword:

external_script /path/to/script

When the above line is added to package configuration, Serviceguard does three things:

1.) when starting the package, Serviceguard will run the script using command line "/path/to/script start".

2.) when halting the package Serviceguard will run the script using "/path/to/script stop".

3.) when running cmcheckconf/cmapplyconf, Serviceguard will run the script with command line "/path/to/script verify". If the script returns a non-zero error code (e.g. script terminates with "exit 1"), the cmcheckconf/cmapplyconf operation will fail.

You cannot place the external_script to the package filesystem: the script must be available even if the package is down, on all the cluster nodes.

MK
MK
Ahmed_58
Regular Advisor

Re: Serviceguard A.11.19 and external script

Dear Matti,
I can't find the external_script location in my pkg config file? or any where says to put the path for external script!?

Ahmed
Stephen Doud
Honored Contributor

Re: Serviceguard A.11.19 and external script

Ahmed,

On a system installed with A.11.19, I just did this:
# cmmakepkg modularPkg.config
Package template is created.
This file must be edited before it can be used.
# grep ^#external modularPkg.config
#external_pre_script
#external_script

If you don't find these references, it may be because you used switches (options) with cmmakepkg that restricted the modules loaded into the package configuration file.
Use my technique to create a new package configuration file and use that file for your package.