Operating System - HP-UX
1849239 Members
2713 Online
104042 Solutions
New Discussion

ServiceGuard package question

 
SOLVED
Go to solution
AndyMueller
Frequent Advisor

ServiceGuard package question

Hello Guru's:
I'm building a 2 node (1 package) ServiceGuard cluster. All is well, however on the failover node, I need to run another package, which in essence first unmounts filesystems there, before the package from the cluster (failed node) can fail over. How does one do this? I presume in the package control script, or maybe with the Service_Name feature. I have no idea how to do this, so any help will be rewarded.

Thanks, Andy
12 REPLIES 12
Steven E. Protter
Exalted Contributor

Re: ServiceGuard package question

Shalom Andy,

In the new package script on the second node, there is a place to put in commands to handle the necessary umounts.

The package control script is the place to do this. If you use a sample package control scrip t there are plenty of comments in there to help you do it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
AndyMueller
Frequent Advisor

Re: ServiceGuard package question

Steven,

ok that makes sense, but how does my new package control script on the second node get triggered by the package failing over from node 1? I'm using a different package control script for the initial package move. How do the 2 package control scripts correlate to each other?

Andy
Court Campbell
Honored Contributor

Re: ServiceGuard package question

Can you explain what it is you want to accomplish. I am confused in the fact that you state you are building a 2 node cluster that will run 1 package, yet you state that you need another package. Can I assume that you actually want to run 2 packages, and that you want 1 package to run on each node? This can easily be done. But I don't understand why you would want one package to umount filesystems mounted by another package. Or am I reading this wrong?
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
melvyn burnard
Honored Contributor

Re: ServiceGuard package question

when configuring a package, you create a script file or control file. In the package configuration file you specify the full path to this run/halt control script.
Because this then goes into the SG cluster binary, the control script MUST be the same path and name on ALL nodes.
What your attemptinmg to do is actually not supported, as when the package switches, the first thing it does is attempt to activate the volume group(s) for the package, then mount any file systems, and as there are already file systems there, this will not work.

What you could try to do is add in your own function to the control scrippt on the second node to do these unmounts, and then call the function BEFORE it does the vgchange, but as this means making changes outside of the areas that customers are allowed to, it becomes unsupported.
In a future release there may be added functionality to allow "pre_vg_activation" customer functions.

My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
AndyMueller
Frequent Advisor

Re: ServiceGuard package question

Yes, you may be reading it wrong. Before the package can fail over from node1 to node2, I need to unmount some filesystems on node2 FIRST. I thought I could do this this by running another package on node2, which "somehow" gets triggered to run that package control script when the package on node1 is getting ready to fail over. I know this sounds confusing, I still don't know how a package control script from node1, can trigger another package control script to execute on node2 first, then continue with "normal" package failover.
Court Campbell
Honored Contributor

Re: ServiceGuard package question

You could write a script that unmounts the filesystems on the other node. Then call this script in the customer defined functions section of the control script.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
Rita C Workman
Honored Contributor
Solution

Re: ServiceGuard package question

What we do is create a second package for the other node.....
In the PRODUCTION packages cntl file at the very top we put the following statement:

/usr/sbin/cmhaltpkg -n $(/usr/bin/uname -n)

Whe your prod fails over, the first thing it does it stop the other package !

Works for us ..
Rgrds,
Rita
melvyn burnard
Honored Contributor

Re: ServiceGuard package question

The suggestion re the script being called in the customer defined run/halt functions will not work in this case, as this i sthe LAST function to be called, i.e. the vg is aalready activated, file systems mounts hav eoccured etc. This needs to be done BEFORE the vg activation, and can be done as per the post just previous to this response when run before we go the vg activation function, but I stress is unsupported
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Court Campbell
Honored Contributor

Re: ServiceGuard package question

Melvyn,

If Andy puts this as a customer defined halt commands then this is ran before volume group deactivation. anyway he would be sending commands to another host via ssh or something.
"The difference between me and you? I will read the man page." and "Respect the hat." and "You could just do a search on ITRC, you don't need to start a thread on a topic that's been answered 100 times already." Oh, and "What. no points???"
A. Clay Stephenson
Acclaimed Contributor

Re: ServiceGuard package question

My psychic, Miss Cleo, tells me that you are running a test and production system on the cluster and only the production system is a SG package -- so you must stop the test system first. This is exactly the sort of situation to avoid when it absolutely, positively must work the first time. Generally there are enough pitfalls in the design of a robust SG cluster that there is no need to invent pitfalls of our own. Of course, Miss Cleo could be wrong about all of this. If Miss Cleo is right, be aware that running test and production on the cluster is going to be a nightmare for you when the SOX/security/HIPPA auditors knock on your door.
If it ain't broke, I can fix that.
AndyMueller
Frequent Advisor

Re: ServiceGuard package question

Thank you all for responding. So far Rita's suggestion looks like the most viable option. And Miss Cleo is actually incorrect, we are not running a Production environment and a Test env in the same cluster. Thank you all again.
Andy
Steve Lewis
Honored Contributor

Re: ServiceGuard package question

Andy,

You must understand that when a primary node TOCs, the secondary has to decide where the problem lies - is it with the primary, or is it with the network, or is it with itself.
If it decides that the problem lies with the primary node, then the failover node takes over, moving the package ownership and starting up the package (adding IPs, activating VGs, then mounting filesystems, then running customer commands).

So to do what you want to achieve, you must put yourself into an unsupported situation by manually unmounting filesystems before the package start-up filesystem mounts.

Putting an unmount in the package halt script is useless when a node TOCs, the command would never be run.

My pet psychic mystic Meg suggested that you may have NFS mounted the package filesystems to the other node, at the same location, so want to unmount the NFS mounts, to avoid trying to over-mount with the real ones and fail to start the package. Is Meg correct?