1826580 Members
4098 Online
109695 Solutions
New Discussion

Re: Service Dependency

 
Kathir Lakshmanan
Honored Contributor

Service Dependency

How to set a Service Dependency? For example I have three services,

1. Oracle Listener
2. Oracle Database
3. Application

If the Ora db goes down or some process not running. (Restart Count Set to 1) then the application and listener should be stopped before attempting to stop oracle and then restart them in a proper order (listener, oracle, app)

So, my question how does the cluster handle this situation, is there a way one can set dependencies for services?

-Kathir
6 REPLIES 6
Kevin Wright
Honored Contributor

Re: Service Dependency

this should all be defined in the pkg run/halt script. You should call another script that shuts down your DB/app in the order required.

Please review:
http://docs.hp.com/en/ha.html
Kathir Lakshmanan
Honored Contributor

Re: Service Dependency

Kevin,

Thanks I checked the 'Managing Service Guard Manual' before asking the question, but I couldnt find much of an information on services and their dependencies..Is there any other doc which talks about this??

I understand the mon scripts should take care of the restarts but is there a way to build a dependency between the services configured in one package? If yes how to configure the cntl file for that??

-Kathir
BPatrick
Trusted Contributor

Re: Service Dependency

The sequence in which the services are stopped and restarted can be deifned in the pakage control file. In the .sh file check for the functions halt_services and start_services and change accordingly.

Patrick
Carsten Krege
Honored Contributor

Re: Service Dependency

It appears to me that you do not use the SG package concept correctly. The application start sequence should be defined in the function customer_defined_run_commands() in the package control script. The commands required to stop the application should be defined in the customer_defined_halt_cmds() function.

The services are usually only used to monitor specific processes and if possible to restart them in case they fail. THis said your service should not stop the application or the DB. THe exit of a service (after max restart is reached) should trigger the stop sequence in the package control script.

Perhaps you should check into the developer toolbox for SG (free download) to get templates for application packages. See
http://h20293.www2.hp.com/portal/swdepot/displayProductInfo.do?productNumber=SGDTOOLBOX

For Oracle, HP offers ready to use templates as part of the Enterprise Cluster Master toolkit. See http://h20293.www2.hp.com/portal/swdepot/displayProductsList.do?category=HA

To answer your question directly: No, you cannot define dependencies between package services. They are started/stopped in the order of the indeces that you defined in the package control script.

Carsten
-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
Kathir Lakshmanan
Honored Contributor

Re: Service Dependency

Thanks, I understand the start / stop should be done from the run/halt cmds in the pkg cntl script. But when you monitor a service, and if the service is not running, can you define a dependency so that the dependent services are stopped and started in order..

From the posts and the document, I understand that dependencies are possible only in the package and not in service...

-Kathir
Kathir Lakshmanan
Honored Contributor

Re: Service Dependency

See the previous post.