Operating System - HP-UX
1836245 Members
1471 Online
110096 Solutions
New Discussion

Package control script question...

 
Rad Rioveros
Occasional Advisor

Package control script question...

Hi Gurus,

Im quite new to HPUX and MC/Service Guard, and I hope you guys can explain/help me on questions i got.

On our package control script, there was no SERVICE_NAME[0], SERVICE_CMD[0], and SERVICE_RESTART[0] parameter set. Oracle is included on this package, and was started via script on the "customer_defined_run_cmds" function.

Question:
-are the PIDs generated by the script that runs oracle will be monitored by the cluster package manager? that, if one of these process IDs is gone/killed/failed, will triger failover?

Thanks in advance,
Rad
8 REPLIES 8
Sundar_7
Honored Contributor

Re: Package control script question...

Hi Rad,

The answer to your question is NO.

Package monitor has no means of keeping track of the PIDs started by the scripts in the customer_defined_run_cmds section.

The usually practise is to have a process monitoring script started as a service.

This script should keep monitoring for the process and if one of the process is missing then it should exit with an error code (say 1).

In this case, package manager will realize the service exited with NON-ZERO value and willhalt the package.

Hope this helps

Sundar
Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: Package control script question...

I meant to say it will halt the package and move it to any adaptive nodes defined for the package.
Learn What to do ,How to do and more importantly When to do ?
Isralyn Manalac_1
Regular Advisor

Re: Package control script question...

Hi,

The pkg monitoring script will monitor the critical Oracle (in this case) process like pmon, smon, etc. When it sees that one of those critical Oracle processes dies, then the package will halt.

Ira
Gary L. Paveza, Jr.
Trusted Contributor

Re: Package control script question...

Since you are not running the oracle script as a service (I'm assuming you are using the Oracle toolkit which contains the database startup/shutdown/monitoring all within one script), it will not monitor for a failed Oracle database. The customer_defined_run_commands will start it up (if you call it with the start option) and the customer_defined_halt_commands will shut it down (if you call it with the shutdown option). If you want monitoring and failover if one of the critical oracle processes hang, you need to define it as a service as well. I can help you do that if this is something you want.
Stephen Doud
Honored Contributor

Re: Package control script question...

If you look at the bottom of the standard package control script, which will be activating the Oracle volume groups, mounting file systems etc prior to starting the Oracle application, you will see that the script's functions are called in this order when the script is executed with a "start" option by Serviceguard (subsequent to a cmrunpkg for example):
verify_physical_data_replication # add hook for MetroCluster
activate_volume_group
activate_disk_group
check_and_mount
verify_ha_nfs $1 # add hook for NFS
add_ip_address
get_ownership_dtc
customer_defined_run_cmds
start_services
start_resources

Note that customer_defined_run_cmds is performed before start_services.
One would start Oracle using the ORACLE.sh script with a 'start' option from the customer_defined_run_cmds function, and then call the same script with the 'monitor' option via the SERVICE_CMD parameter, because the SERVICE_CMD is expected to remain persistent. If the command called from SERVICE_CMD definition dies, SG normally fails the package over to the adoptive node.

The HP Enterprise Cluster Master toolkit provides an ORACLE.sh, which after customization for the user's environment, can be called with the following options:

shutdown | halt | start | monitor

The 'monitor' function relies on the MONITOR_PROCESSES defined by the administrator, to determine the PIDs of the processes to monitor. Hence the parameter MONITOR_PROCESSES_PID[$n] in that function.

.SD.
Rita C Workman
Honored Contributor

Re: Package control script question...

As Stephen mentions, you can have this 'Oracle monitoring feature' put into your MC/SG environment, and hence failover to another node.
But ... be sure that is what you want to do. My preference is to keep Oracle Monitoring with Oracle. All too often some DBA does a fat finger (..my favorite ooops..) and drops an instance. Or maybe your listener gets out of sync (hey it happens)...Nothing was really wrong (other than maybe human error), but now you have failed over. And maybe had to stop some other "less important" package on the other node - when all you needed was to restart your instance back on it's original box.

So...if your new to HPUX & MC/SG, make sure you consider all the options, and choose which is best for your situation.
Sometimes....you may not want to take advantage of every whistle & bell. You decide what is best.

Rgrds,
Rita
Gary L. Paveza, Jr.
Trusted Contributor

Re: Package control script question...

One additional item. If you choose to do this, you may want to consider modifying the oracle script so that you can place a maintenance flag - which will turn off monitoring. Basically, when this file gets created, monitoring is turned off. When it's removed, the monitor script recalculates the PIDs and resumes monitoring.
Rad Rioveros
Occasional Advisor

Re: Package control script question...

Hi all,

I'd like to thank you for all the replies and inputs you gave. That's very helpful to me.

Thanks,
Rad