1836818 Members
1715 Online
110110 Solutions
New Discussion

Add new VG in package

 
Abhijeet_3
Frequent Advisor

Add new VG in package

I want to add another new VG03 in my running package Pkg01, does it need to halt the custer to add new VG03 in cluster configuration file to make it as cluster aware.

Pl give me steps to add new VG in running package.

Thanks

Abhijeet

9 REPLIES 9
Victor Fridyev
Honored Contributor

Re: Add new VG in package

Hi,

If this vg existed when you created the cluster, i.e. if it presents in the cluster.ascii file, you can add it into the package cntl file and you will have to restart the package.
If the vg is new for the cluster, additionally you will have to repeat all cluster building.

HTH
Entities are not to be multiplied beyond necessity - RTFM
Sandman!
Honored Contributor

Re: Add new VG in package

No you don't need to halt the cluster to add a VG to an MC/SG cluster. Does VG03 already exist meaning have you run pvcreate/vgcreate commands in order to create VG03?

If so, update the cluster config file "/etc/cmcluster/cmclconfig.ascii" and add entries in the pkg control script for activating VG03 and mounting the LVOLs associated with VG03. Distribute the cluster config file and the pkg control script to all the other nodes. Thereafter bounce the package i.e. cmhaltpkg followed by cmrunpkg
Devesh Pant_1
Esteemed Contributor

Re: Add new VG in package

Abhijeet,
I am providing you the steb by step procedure.
There is a way to get it done without halting the cluster, but I would advise halting the cluster since we need to make the cluster aware of the vg03

1. Halt the cluster by issuing the command

cmhaltcl

Now we need to make sure that the other node in the cluster is also comfortable with the new vg03 being added to do this follow the steps:

2. Unmount the filesystems on first node ( where pkg01 is running ) of the cluster to make them ready to be exported over to the other node.

3. After unmounting Run
vgchange â a n vg03

vgexport -s -v -p -m /tmp/vg03.map /dev/vg03

4. Copy the map file over to the other node

rcp /tmp/vg03.map secondnode:/tmp

5. Log on to the other node to import the volumegroup

Run ioscan to scan in the LUNs presented to the node verify if you could see them

6. Create the directories
/dev/vg03
and the group file with the correct major and minor number
mknod group c 64 0x160000
vgimport -s -v -m /tmp/vg03.map /dev/vg03

vgchange â a y /dev/vg03

7. Mount all the filesystem and verify if everything was imported and mounted okay on the secondnode of the cluster

8. Umount all the filesystem and do a vgchange â a n /dev/vg03

9. Edit the cluster config file

vi the file /etc/cmcluster/clustername

At the end of the file add the line for the volume group vg03
VOLUME_GROUP /dev/vg03

10. After this check the configuration file by running the following command

cmcheckconf -k -v -C /etc/cmcluster/clustername

After verifying that there are no errors, distribute the files across the cluster with the following command

cmapplyconf -k -v -C /etc/cmcluster/afprodcluster

11. Edit the file /etc/cmcluster/pkg01/pkg01.sh
( Assuming that this is the run script in the pkg01.config file)

for the following changes

VG[3]="vg03"

And add the details of the filesystem mounts

eg.
LV[0]=/dev/vg03/lv_03; FS[0]=/mountpoint03; FS_MOUNT_OPT[0]="-o rw,suid,largefiles,delaylog,datainlog";
FS_UMOUNT_OPT[0]=""; FS_FSCK_OPT[0]=""; FS_TYPE[0]="vxfs"

12. Copy the file /etc/cmcluster/pkg01/pkg01.sh to the other node of the cluster

rcp /etc/cmcluster/pkg01/pkg01.sh secondnode:/etc/cmcluster/pkg01/pkg01.sh

13. Apply the config file to create the cluster

cmapplyconf -C /etc/cmcluster/clustername -P /etc/cmcluster/pkg01/pkg01.config

deactivate the volumegroup
vgchange -a n /dev/vg03

make it cluster aware

vgchange -c y /dev/vg03

14. Start up the cluster

cmruncl

15. Check the cluster status
cmviewcl -v

check if the volumegroup lvols got mounted

That should do it, if you get stuck on any step, post back again

Thanks
DP
freddy_21
Respected Contributor

Re: Add new VG in package

i Agree with Devesh Pant, but about to edit control file, you no need to apply anymore. just edit and run the cluster. If you change the configuration file. you need compile it.


Freddy
rariasn
Honored Contributor

Re: Add new VG in package

No,

In the node that run the package,

# vgchange -c y vg03

# vgchange -a e vg03

Distribute the vg03 configuration to another node of the cluster.

rgs,

ran
rariasn
Honored Contributor

Re: Add new VG in package

Sorry,

Modify the package control script to include vg03 activation.

ran
Stephen Doud
Honored Contributor

Re: Add new VG in package

Create the VG and Lvols
Create a MAP file for the VG:
# vgexport -pvs -m map. /dev/
# rcp map. :/etc/lvmconf

On 'otherhost':
# mkdir /dev/ ; mknod /dev//group c 64 0xNN0000 (where NN is unique for all VGs in lvmtab).
# vgimport -vs -m /etc/lvmconf/map. /dev/

This will sync up lvmtab between nodes.

Next, add references for the VG and lvol in the package control script. Then copy the updated script to the other node.

Add the VOLUME_GROUP reference to the cluster.ascii file and cmapplyconf it to 'clusterize' the VG. If you do not list the new VG in the cluster.ascii, but use vgchange -c y to clusterize it, a cmapplyconf performed later will de-cluster the VG!

You can do these steps while the cluster and affected packages are running.

Test the package start/stop on both nodes to verify your modifications work properly.
Doug O'Leary
Honored Contributor

Re: Add new VG in package

Hey;

Just to add my $.02; you do not need to stop the cluster in order to add a new volume group to a package.

In fact, you don't have to list *any* volume groups in the cluster configuration file excepting the one used as the cluster locking vg. I found that bit of trivia out when I neglected to list any vgs in a cluster config file and the cluster worked right out of the box.

You will need a package outage, however, to test/verify start/stop scripts and to test failover.

The steps:

## On primary node:

1. Create vg03:

mkdir /dev/vg03
mknod /dev/vg03/group c 64 0x0#0000
# ensure minor number is unique on both systems.
pvcreate ${list_o_raw_devs}
vgcreate ${appropriate_args} vg03 ${list_o_devs}

2. Create lvs and mount points as appropriate

3. Shutdown the package then update package control script as appropriate

4. Set exclusive bit on vg03:

vgchange -c y vg03

5. Deactivate vg03;

vgchange -a n vg03

6. Start the package on the primary node; verify vg03 activates and is mounted where needed.

7. Obtain a map of vg03:

vgexport -s -p -m /tmp/vg03.map vg03

8. Copy map over to adoptive node:

scp /tmp/vg03.map ${ad}:/tmp

9. Shutdown the package:

# On adoptive node:

1. Import the vg:

mkdir /dev/vg03
mknod /dev/vg03/group c 64 ${minor} # use same minor as on primary node.
vgimport -s -m /tmp/vg03.map vg03

2. scp package files to adoptive node:

cd /etc/cmcluster/${pkg}
scp ${pn}:/etc/cmcluster/${pkg}/${pkg_control-script} .

3. Create mount points for vg03 as appropriate

4. Start the package; troubleshoot as necessary

cmrunpkg -n ${adoptive_node} ${pkg}

Simple! At least not overly complex if you keep an understanding of what you're doing in mind...

HTH;

Doug

------
Senior UNIX Admin
O'Leary Computers Inc
linkedin: http://www.linkedin.com/dkoleary
Resume: http://www.olearycomputers.com/resume.html
Abhijeet_3
Frequent Advisor

Re: Add new VG in package

Thanks