Operating System - HP-UX
1851688 Members
3093 Online
104061 Solutions
New Discussion

Re: Startup the package in sequence

 
SOLVED
Go to solution
Kenneth Yap
Frequent Advisor

Startup the package in sequence

Dear Expert,
Is there any way to configure the package startup in sequence or any software control in MC/ServiceGuard ?

Thanks

Kenneth Yap
11 REPLIES 11
Peggy Fong
Respected Contributor

Re: Startup the package in sequence

Hi
Would you elaborate a little more on what you are looking to do? Not sure if you want to change when a package starts up, or have multiple packages, or what exactly you are really looking for.
Thanks,
Peg
Kenneth Yap
Frequent Advisor

Re: Startup the package in sequence

Just an example;
I have two node cluster, one is active and another is standby.
I have two package, package 1 and package 2.
The application in package 2 is depend on application in package 1.
The package 1 have to startup first before package 2 startup.
So, Is there any configuration or software that can control the package startup sequence ?

regards,

Kenneth Yap
melvyn burnard
Honored Contributor

Re: Startup the package in sequence

There is currently nothing built in to ServiceGuard to control/allow this.

You would need to build the checks into your scripts for this and test them thoroughly.
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Juan González
Trusted Contributor

Re: Startup the package in sequence

Hi Kenneth,
there is something in MC/ServiceGuard that I think is similar which you need.
When you have one pkg depending on other, for example pkgB depends on pkgA, i.e. to run pkgB is required than pkgA is running in the same node you can employ EMS (Event Monitoring Service).
The EMS solution allows a pkg to be dependent upon the value of an EMS variable. The EMS has many variables that it can monitor, one of which is the state of a MC/SG pkg.

The steps to configure the pkg for this are:
1. Identify the EMS resource name. You can use the resls command to do it.
#resls /
#resls /cluster
...
The resource name will be something similar to
/cluster/package/package_status/pkgA
2.Edit the pkg configuration for pkgB and add the following lines:
RESOURCE_NAME /cluster/package/package_status/pkgA
RESOURCE_POLLING_INTERVAL 60
RESOURCE_UP_VALUE = UP

3. Bring down the cluster, apply the configuration of pkgB and start the cluster.

4. Once the cluster restarts you can use cmviewcl -v to verify the status of the EMS resource.

Before doing this changes check that you have EMS installed and think if this really match what you want (you must run both pkgs in the same node, if pkgA fails pkgB will follow it,...)

Best regards
JGM
Kenneth Yap
Frequent Advisor

Re: Startup the package in sequence

Hi JGM ,
Thanks for your step. I will try it.

Regards,

Kenneth Yap
Kenneth Yap
Frequent Advisor

Re: Startup the package in sequence

Hi JGM,
I have no ideal how to find the resource of the package status.
The cluster node already have EMS .
Do it need any software to install ?

Thanks & Regards

Kenneth Yap
Juan González
Trusted Contributor
Solution

Re: Startup the package in sequence

Hi Kenneth,
you can find the EMS resource with the resls command:
#resls /
will return something like
/net
/system
/cluster
...
#resls /cluster
will return something like
/package
/localNode
/status
..
#resls /cluster/package

until you reach something like
/cluster/package/package_status/
#resls /cluster/package/package_status/
will return the differents values that this resource could have.

Best regards
Juan Gonzalez
Kenneth Yap
Frequent Advisor

Re: Startup the package in sequence

Hi JGM,
I have found that before the EMS can monitor the cluster, it need to install the EMS HA Monitor software.
For detail, please refer to the side document below.

http://www.docs.hp.com/hpux/pdf/B7612-90015.pdf

Thanks,

Regards

Kenneth Yap
Carsten Krege
Honored Contributor

Re: Startup the package in sequence

I would be very careful with configuring another package as a dependent resource with EMS. There are several reasons for this:

1) EMS gets the cluster status via SNMP. If SNMP is down (snpdm, mib2agt), you won't be able to retrieve the package status anymore and a package can fail or cannot start. I don't think that it is a good idea to make your HA environment dependent from SNMP.
2) During cluster start when no package is running, the dependent package resource would not be available and could not start. You would therefore need to configure the EMS resource as DEFERRED RESOURCE (that is evaluated at the end of the package start). However, the timing is probably quite sensitive and it might decide whether your packages are started or fail. The timing depends on the resource polling interval and how fast your package starts/stops. As these timing values are very variable, I think this solution would not that easy to implement.

It is much more reliable to configure cmrunpkg commands in the package control script to start the dependent package from here (like Melvyn recommended). There are still caveats of this procedure, but it will be much more reliable. Melvyn was also right that you need to do careful testing of this concept.

If the packages are really depending from each other (i.e. the one cannot run without the other), I would really recommend to make one package out of the two, since this is straight forward and the easiest way to implement it.

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
Mike Taylor_3
Occasional Advisor

Re: Startup the package in sequence

My experience is that packages start in lexographic order of the package name. If you can be flexible about package names, you can control the order of package startup.
Kenneth Yap
Frequent Advisor

Re: Startup the package in sequence

Hi Make,
What its means "package start in lexographic order "?