1753404 Members
6982 Online
108793 Solutions
New Discussion юеВ

Cluster Question

 
SOLVED
Go to solution
Waqar Razi
Regular Advisor

Cluster Question

I have one question regarding adding logical volume or a file system to a cluster package. Do we need to shutdown the package for that? I know its recommended but is that necessary? Is there any way we can add logical volume to a cluster without halting the package?
8 REPLIES 8
Steven E. Protter
Exalted Contributor
Solution

Re: Cluster Question

Shalom,

The answer is it depends.

Adding a logical volume to a volume group on shared storage alone does not require package shutdown.

lvextend an existing logical volume to a new physical volume in the volume group also does not require a package shutdown.

extendfs, which extends a filesystem to a new physical disk requires umount and would require a package shut down. OnlineJFS would avoid this problem if installed.

To read your question literally. To add a new logical volume to a volume group that is activated by a SG/Cluster package does not require package shut down.

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
Waqar Razi
Regular Advisor

Re: Cluster Question

Hey steven,

Here are the steps for adding a logical volume to a package. I got these from HP SG guide. Can you make some amendments in it to make this plan perfect so that we just not need to shutdown the application or halt the package.

On the primary:

# cmhaltpkg -v package_name

# vgchange -a e vg02

# lvcreate -L size -n lvol_name /dev/vg02

# newfs -F vxfs /dev/vg02/rlvol_name

# mkdir /new_mount_point

# vgexport -v -s -p -m /etc/lvmconf/vg02.map vg02

(this will create a new map file that now includes new logical volume)

# vgchange -a n vg02



├в ┬в On the adoptive:

# cd /etc/lvmconf

# rcp :/etc/lvmconf/vg02.map .

# mkdir /new_mount_point (needed on both systems)

# vgexport -v /dev/vg02

# mkdir /dev/vg02

# mknod /dev/vg02/group c 64 0x020000

# vgimport -v -s -m /etc/lvmconf/vg02.map vg02

# vgchange ├в a r vg02

# vgcfgbackup vg02

# vgchange ├в a n vg02

Mel Burslan
Honored Contributor

Re: Cluster Question

well, the procedure you copied is fine even if you skip shutting down the package on the primary node. It works fine.

One caveat:
There is a missing point in it. If you edit the package control script, you will see lines looking like :

LV[1]=/dev/vg01/lvol2; FS[1]=/pkg01b; FS_MOUNT_OPT[1]="-o rw"

you need to add another one of these into the package control script, of course using the index of the last similar line +1.

Then it should be fine
________________________________
UNIX because I majored in cryptology...
Kranti Mahmud
Honored Contributor

Re: Cluster Question

Hi Razi,

>>is it possible to do this without halting the package <<

step1 :- vgextend /dev/vgxx

step2:- lvcreate -L /dev/vgxx/lvolxx
fsadm -F vxfs -o largefiles /dev/vgxx/lvolxx

step3 :- vgexport -pvs -m /dev/vgxx

step3:- Copy the mapfile to the other node

step4 :- Activate in share mode
vgchange -a s /dev/vgxx

On the other node:

1. Export the VG
>>>vgexport /dev/vgxx

2. Recreate the directory
>>>>mkdir -p /dev/vgxx

3. Recreate the VG group file
>>>mknod /dev/vgxx/group c 64 0xMM0000
where MM is a unique identifier (ex 01 for vg01)

4. Preview the vgimport to check for any possible error
>>>>vgimport -pvs -m /dev/vgxx
where mapfile is the one copied from the first node

5. If no error, remove the preview mode
>>>>vgimport -vs -m /dev/vgxx

6. Activate in share mode
>>>>vgchange -a s /dev/vgxx

<>

need add entry to pkg.ctnl.file on the both nodes (if you mount the file system by package)

Rgds-Kranti
Dont look BACK as U will miss something INFRONT!
Waqar Razi
Regular Advisor

Re: Cluster Question

I have one more question here, what is the difference between activating the VG in shared (-s) and exclusive (-e) mode.

Lets say on the primary node if the pkg is up:

1- Can we switch the modes of VG (vgchange) while the package is up or do we need to halt the pkg?

2- Do we need to switch to shared mode with -s switch if we want to add some LV or file system to the pkg?


3- While transferring the changes to the adoptive node, while we activate the VG there with -s, Do we need to deactivate it on the primary node first.
Mel Burslan
Honored Contributor

Re: Cluster Question

shared mode activation is used for volume groups which are going to be simultaneously activated on more than one node.

exclusive activation, as far as I know is only for cluster controlled volume groups. Once activated in this mode, the volume group can not be simultaneously activated on another node sharing the same storage but when the exclusivity lock gets removed, i.e. package goes down on the original node, it can be activated on one other place. It actually is a flag that tells peple who want to activate this volume group with straight activation as in

vgchange -a y vgname

that volume group is under cluster control and should not be treated as a regular vg. Wheras shared activation, i.e.

vgchange -a s vgname

can be activated on multiple nodes at the same time. At this point, it is upto the application to track the sanity of data by employing file locking and what not. Again, as far as I know, LVM does not provide any file locking for shared activated vg's.

Hope this helps.
________________________________
UNIX because I majored in cryptology...
khilari
Regular Advisor

Re: Cluster Question

hi Waqar, u need to do the followinng to add an lv to a cluster package.

1) create the lv.
2) put in the package control file its entry.
3) RCP it to the other nodes control file.

Ofcourse do an insf -e disk on the other node as well because incase the packsge fails over the other node should have the device files for the disks on which the new lv was made.

You never really shutdown a package but u move it around different cluster nodes if u need to do maintainance on one node.
Kranti Mahmud
Honored Contributor

Re: Cluster Question

Hi Waqar,

Check the following link for more info:

http://www.cs.bgu.ac.il/~arik/usail/man/hpux/vgchange.1.html

Rgds-kranti
Dont look BACK as U will miss something INFRONT!