Operating System - HP-UX
1827807 Members
2673 Online
109969 Solutions
New Discussion

Re: how to mount SG package file systems without modifying package configuration file

 
Wallace Liu
Advisor

how to mount SG package file systems without modifying package configuration file

Hi ,

When run cmrunpkg command, it first mounts the package file systems and run the application specific commands defined in the external_script(in version A.11.18.00) or customer_defined_run_cmds(earlier version) .

I have a need to mount the file systems only without starting the application specific commands defined in the external_script/customer_defined_run_cmds.

One way to this requirement is to modify the external_script or commenting out the script defined in customer_defined_run_cmds section.

I saw some people call mount_fs to achive the goal of mounting file systems only. How to do this?

Thanks

Wallace
10 REPLIES 10
Shailendran V Naidu
Frequent Advisor

Re: how to mount SG package file systems without modifying package configuration file

Hi Wallace,
You can manually mount the package file systems by doing the following:

1) Halt the package
2) vgchange -a e /dev/vg_name
3) mount package_lvol /mount_point


Or

If the package is running. You can activate the VG in readonly mode and mount the FS in any of the adoptive nodes.

1) Go to the other node where u want to access the file systems.
2) vgchange -a r /dev/vg_name
3) mount package_lvol /mount_point


Thanks.
Ganesan R
Honored Contributor

Re: how to mount SG package file systems without modifying package configuration file

Hi,

You can always activate the vg manually outside the cluster and mount the filesystems.

You can remove the cluster aware flag and activate it in normal mode and mount the filesystem.

Or you can activte directly with exclustive mode and mount the filesystems.
Best wishes,

Ganesh.
Mel Burslan
Honored Contributor

Re: how to mount SG package file systems without modifying package configuration file

or you can just start the package in debug mode. It only activates the VGs, mounts the filesystems and stops.

To accomplish this,

cd /etc/cmcluster
touch debug
cd /etc/cmcluster/
touch debug
cmrunpkg

To undo what you have done, just delete the two debug files you just created

Hope this helps.
________________________________
UNIX because I majored in cryptology...
Rita C Workman
Honored Contributor

Re: how to mount SG package file systems without modifying package configuration file

If it's a one-time request than you have good suggestions above. I really like Mel's. I'm going to have to try that one of these days.

But, if your running some kind of test - say failover to other nodes to ensure all the disks, f/s will come up right (without starting anything) then your best option is to rem out the start_db instructions and copy the pkg file over to the other nodes.
Remember to to remove the "rem" when your done & again copy to other nodes.

Just a thought,
Rita
Wallace Liu
Advisor

Re: how to mount SG package file systems without modifying package configuration file

Hi Mel,

Is your solution documented in some cluster documentations? Is this a solution only applys in your environment?

I tried your method, however the cluster still called package script to start the application after mounting the file systems.

If this is not a solution documented in HP menual, then I am sure that this is a specufic solution in your environment by some coding work in the package control file.

My intention is to find a way to stop the allication from running without modifying the package control file.

Thanks

Wallace
Wallace Liu
Advisor

Re: how to mount SG package file systems without modifying package configuration file

Hi all,

Thanks for your reply. However your solutions do not address my requirement. The solutions you provided involve a lot of manual work and manully keep the file system mounting arrangement as same as the package configuration is a hard work.

Why do I post this question?
I myself is very good at Cluster and have setup many clusters. I want to find a way for people without cluster knowledge to mount package file systems and do their application tasks without my involvement.

I saw other people ran fs_mount to do this. The MC/SG provides a bunch of scripts. fs_mount is a function defined in the script.

I roughly remember the modified fs_mount function only takes in the package name and mount all file systems automatically.

Thanks

Wallace

Stephen Doud
Honored Contributor

Re: how to mount SG package file systems without modifying package configuration file

Pardon the following summary. You probably already know it, but this thread may be referred to by others less-aware.

The legacy package control script does the following:
1) defines system resources (via configurable parameters) required by the application
2) permits customization of the customer_define_run_cmds and _halt_cmds sections to launch the customers' business application
3) defines functions
4) runs specific functions based on whether Serviceguard passed a "start" or "stop" parameter to the script.

To make Serviceguard avoid mounting file systems and performing subsequent startup functions (and conversely, avoid the symmetrical halt functions), I suggest the following:

1) Copy the normal run-time package control script (eg pkg1.sh) to another file (say, pkg1.nomnt.sh), and a backup file (say, pkg1.sh.BCK)
2) Edit the copy (pkg1.nomnt.sh) and comment out the function calls that you do not want to run (in both the START and STOP sections of the script.
Example:
In the "start" section at the bottom, comment out the lines:

check_and_mount
verify_ha_nfs $1 # add hook for NFS
add_ip_address
ha_nfs_file_locks
get_ownership_dtc
wait_for_cvm_dg_vols_enabled
customer_defined_run_cmds
start_services
start_resources

In the "stop" section at the bottom, comment out the lines:

stop_resources
halt_services
customer_defined_halt_cmds
disown_dtc
remove_ip_address
verify_ha_nfs $1 # add hook for NFS
umount_fs

4. With the package halted, cp pkg1.nomnt.sh pkg1.sh

5. Start the package. The system will only activate the VGs and will not perform any subsequent resource activation nor start the application nor services.

6. Halt the package. The system will only perform the function calls left in the 'stop' section.

7. To go back to normal operation, cp pkg1.sh.BCK pkg1.sh

The modular package format is not so easily fooled into performing a limited startup or shutdown. You would have to install A.11.19 to take advantage of a new "partial startup" feature available in that version.

Mel Burslan
Honored Contributor

Re: how to mount SG package file systems without modifying package configuration file

Wallace,

creating debug files is not something specific to my environment. It may be related to my version of MCSG I am running, which is 11.16 and the SG-Ext-SAP-R3 integration package I am using. All of my clusters with the exception of one, run SAP on them. So I take this debug file creation utility for granted. I am assuming it is introduced by the SG-SAP integration script as it was mentioned in this document:

http://docs.hp.com/en/T2357-90003/T2357-90003.pdf

(search for word debug)

But after all, serviceguard is mainly based on scripting. So, as a very good serviceguard admin that you claim to be, you can put any of the suggestions here, into a simple script, which can be run by the SG inexperienced users. On the other hand, if you are the main SG admin, do you really want people with little or no knowledge of serviceguard and high availability, mess with the cluster controlled filesystems and create inconsistencies for you. I sure would not.
________________________________
UNIX because I majored in cryptology...
Wallace Liu
Advisor

Re: how to mount SG package file systems without modifying package configuration file

Hi,

I have finally got the script:
=============================================
PKGNAME=$1

# Verify the package name supplied is correct

# Make sure the package is not running

CONF=/etc/cmcluster/${PKGNAME}/${PKGNAME}.cntl

if [ ! -f $CONF ]

then

echo $CONF not found

exit 1

fi

. $CONF

activate_volume_group

check_and_mount

exit

=============================================
This script requires a package control file. This script selectively uses some configuration of the control file. However, HP is phasing out the solution of one configuration file and one control file for one package. I am running "ServiceGuard A.11.18.00", this version be default creates a combined configuration file. The manpage of cmmakepkg says:
-p This parameter will be obsolete in a future release of
Serviceguard. Create a legacy template of the package
configuration file. Each package should have a separate
configuration file.

-s This parameter will be obsoleted in a future release of
Serviceguard. Create a legacy template package control
script used to run and halt the package. Each legacy package
should have a separate control script.

Due to the nature of the combined configuration file on my system, I am not able to use this script.
Wallace Liu
Advisor

Re: how to mount SG package file systems without modifying package configuration file

Mounting package file systems without using cmrunpkg can not be achieved in environment using combined package configuration file.