Operating System - HP-UX
1757070 Members
2554 Online
108858 Solutions
New Discussion юеВ

Cluster Volume Group mount

 
Viswanath Buddi
Occasional Contributor

Cluster Volume Group mount

Hi,
I need to find out whether my cluster volume group is mounted on the particular node.
I am using the below mentioned steps to find it out.

1. /usr/sbin/cmviewconf | grep "lock vg name"
2. if vg_name configured execute
find /etc/cmcluster -name control.sh -exec grep vg_name {} \;
3. Parse the out put fron above coomand adn get file system mount point and volume group name.
4. Execute vgdisplay vg_name . if it is success then file system is mounted on that particular noe.

But I found that cmviewconf is depricated in Service Guard 11.19. So can some help me here to find the volume group is online on that particular node.
5 REPLIES 5
Ralph Grothe
Honored Contributor

Re: Cluster Volume Group mount

Why is cmvieconf deprecated?
As far as I know it is the quickest responding command that shows you the cluster's current configuration.

So I would use this to get the paths to the packages' run scripts (refine the parsing, dependig if you few or lots of packages)

# cmviewconf|egrep 'package (name|run script):'

An alternative would be to parse the output of something like this (which returns relatively soon either)

# cmquerycl -k -l lvm -c YOUR_CLUSTER_NAME

Then I would look (parse) where the package(s) is|are running by

# cmviewcl -l package

Then either grep the run script(s) that I had parsed from cmviewconf above like

# grep ^[^#]*VG\\[[0-9]]= PATH_TO_RUNSCRIPT

or know the VG(s) I was looking for from the cmquerycl command above already.

Then you can run a vgdisplay command on the node where the package started to see if the VG got activated.

Finally you could parse the package run script for FS entries to retrieve the mount points (just substitute VG by FS above),
and run a bdf, mount or grep /etc/mnttab to see if the LVs got mounted.

On the other hand you could simply execute this on the node where the package started to see if all LVs got mounted.

$ (. PATH_TO_PACKAGE_RUNSCRIPT; bdf ${FS[*]})


But this all seems far too much fuss.
Why don't you just look into the package's control script's log file.
If its VG didn't get activated or its LVs didn't get mounted there will be error messages in that log.

But on the other hand
Madness, thy name is system administration
Viswanath Buddi
Occasional Contributor

Re: Cluster Volume Group mount

Hi Ralph,
Your answer is really appreciative. I found that cmviewconf is deprecated in the below mentioned doc http://www.docs.hp.com/en/T1905-90000/ch01s01.html

Coming to my question I am developing one application which can show whether the files system is mounted on particular cluster node.
As you mentioned I can't take it from the log file.

I am getting below mentioned error while executing
# (./etc/cmcluster/pkg2/pkg2.sh; bdf ${FS[*]})
ksh: ./etc/cmcluster/pkg2/pkg2.sh: not found
ksh: *: parameter not set

Can u please let me know what might be the problem
Ralph Grothe
Honored Contributor

Re: Cluster Volume Group mount

I think that's because you were executing it from a ksh while the control script probably is the standard hpux posix shell.
The round parens execute a subshell.
I'm not sure right now, but I think if tha parent shell was a ksh so will be its subshell.

Anyway, sourcing the complete control script probably isn't very wise when all you want is access to the array assignments of VG, LV and FS.
Also, who knows if there are "unconventional commands" outside the customer_defined_run|halt_script or the other function bodies that might be problematic when sourced as root!

I rather would suggest to do something similar to this
(sorry this looks really ugly, but I had several array assignments in my control script why I added the tr in the pipe.
This may not be necessary for your control script)

$ grep ^[^#]*FS\\[[0-9]]= /etc/cmcluster/pkg2/pkg2.sh|tr \; \\012|grep FS\\[|cut -d= -f2|xargs bdf
Madness, thy name is system administration
Viswanath Buddi
Occasional Contributor

Re: Cluster Volume Group mount

Hi Ralph,
I tired the code given by you

grep ^[^#]*FS\\[[0-9]]= /etc/cmcluster/pkg2/pkg2.sh|tr \; \\012|grep FS\\[|cut -d= -f2|xargs bdf
---------------------------------

Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 19038208 15269632 3740024 80% /
/dev/vg00/lvol1 2048000 169024 1864384 8% /stand
/dev/sharedVG/lvol1
4194304 18110 3915189 0% /sharedFS

Is there any problem with my cluster configuration?


Ralph Grothe
Honored Contributor

Re: Cluster Volume Group mount

Before you pipe the output into bdf
have a look at what was actually parsed.
Remove the last pipe and everything that follows.
Does it produce any sensible output?
Madness, thy name is system administration