Operating System - HP-UX
1755236 Members
4631 Online
108831 Solutions
New Discussion юеВ

make a file a resource in a package

 
anat heilper
Frequent Advisor

make a file a resource in a package

Hi,
I want to have a text file (includes different variables) a resource of a package so when moving from node to node, the text file will be copied to the new node.
Is there a simple way to do that?
I was thinking of using the user_defined_functions in order to save the parameters that I need and to generated the file each time the package starts,
but I would like to do a more elegant solution.
Thanks,
Anat
5 REPLIES 5
Matti_Kurkela
Honored Contributor

Re: make a file a resource in a package

Why don't you simply place the file on the package disk, so it _moves_ along with the package?

If the file needs to be in a specific location, place the real file in the location of your choice on the package disk and symlink it to wherever it's needed. Or if the file is big enough to merit that, create another LV in the package VG and have it mount to wherever the file is supposed to be.

In a failover situation, copying might not be possible: for example, the node that until recently was running the package might be up in flames, totally ruined.

When designing a failover cluster, always assume the worst: when the package is coming up on the failover server, assume it's too late to get anything out of the primary server. The package MUST be designed to work with whatever it contains at that point. Otherwise you've created a hidden dependency which makes your "failover cluster" just an expensive toy.

MK
MK
anat heilper
Frequent Advisor

Re: make a file a resource in a package

Hi, I don't understand what you mean by the package disk. Do you mean a volume group?
What if I don't have a volume group as a resource?
Rita C Workman
Honored Contributor

Re: make a file a resource in a package

Maybe you should explain your use of the word "package"?

...because we take it to mean you are running a failover environment using MC/Service Guard...
So do you run MC/SG ?

Rita
Matti_Kurkela
Honored Contributor

Re: make a file a resource in a package

Yes, I meant a volume group in cluster mode with one or more LVs, on some form of storage that is accessible to all nodes.

If you must have file(s) travel along with a package, that's the standard solution. In fact, that's the main problem ServiceGuard is designed to solve.

A package without a resource VG is just an interlock arrangement to make sure a program and its IP address(es) is activated on one node at a time only. If that's the only thing you need, fine. But you obviously need a resource VG for your file.

If that file is not changed often, you might be able to set up a scripted rdist or rsync job to check the file for changes and copy the changes automatically to the other node. If you set this up to run hourly and a failover happens at the worst possible time, your text file will be at most one hour out of date.

Remember that ServiceGuard is designed to allow the package to quickly resume running even if power is suddenly removed from the active node without warning: no package halt scripts, no clean shutdowns, a node just vanishes from the network.

If you expect the package to be able to send something to the other node just before it goes down, you're violating the design assumptions of ServiceGuard and your cluster won't be truly fault tolerant.

MK
MK
anat heilper
Frequent Advisor

Re: make a file a resource in a package

Thanks for your help