Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Configuring OPS Clusters with MC/LockManager: > Chapter 5 Building an OPS Cluster Configuration

Creating the Logical Volume Infrastructure for OPS

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

After installing software components, it is necessary to create the appropriate logical volume infrastructure to support the use of shared files within OPS. This is done by issuing Logical Volume Manager commands. The procedure described in this section assumes that you are using RAID-protected disk arrays and LVM's physical volume links (PV links) to define redundant data paths from each node in the cluster to every logical unit on the array.

NOTE: If you are planning to run packages, you will need to create a volume group infrastructure for those volume groups that are used by packages. These volume groups must be different from volume groups that contain the OPS files. The basic methodology for creating volume groups for packages is the same as for OPS, but there are a few significant differences. Please see the following section “Creating Volume Groups for Packages” for details.

You can create volume groups for packages using mirrored standalone disks. However, the use of mirrored standalone disks for OPS data files is not supported.

Creating Mirrors of Root Logical Volumes

It is highly recommended that you use mirrored root volumes on all cluster nodes. If you are using a disk array for your root logical volumes, skip ahead to the section, "Configuring Volume Groups on Arrays." If you are using a standalone root disk, it should be mirrored as shown here.

The following procedure assumes that you are using separate boot and root volumes; you create a mirror of the boot volume (/dev/vg00/lvol1), root volume (/dev/vg00/lvol3), and primary swap (/dev/vg00/lvol2). The procedure cannot be carried out with SAM. In this example and in the following commands, /dev/dsk/c4t5d0 is the primary disk and /dev/dsk/c4t6d0 is the mirror; be sure to use the correct device file names for the root disks on your system.

  1. Create a bootable LVM disk to be used for the mirror.

    # pvcreate -B /dev/rdsk/c4t6d0 
  2. Add this disk to the current root volume group.

    # vgextend /dev/vg00 /dev/dsk/c4t6d0 
  3. Make the new disk a boot disk.

    # mkboot /dev/rdsk/c4t6d0  
  4. Copy the correct AUTO file into the new LIF area.

    # mkboot -a "hpux -l q (;0)/vmunix" /dev/rdsk/c4t6d0 
  5. Mirror the boot, root and primary swap logical volumes to the new bootable disk. Ensure that all devices in vg00, such as /usr, /swap, etc., are mirrored.

    NOTE: The boot logical volume (/dev/vg00/lvol1 by default) must be done first to ensure that it occupies the first contiguous set of extents on the new disk.

    The following is an example of mirroring the boot logical volume:

    # lvextend -m 1 /dev/vg00/lvol1 /dev/dsk/c4t6d0 

    The following is an example of mirroring the root logical volume:

    # lvextend -m 1 /dev/vg00/lvol3 /dev/dsk/c4t6d0 

    The following is an example of mirroring the primary swap logical volume:

    # lvextend -m 1 /dev/vg00/lvol2 /dev/dsk/c4t6d0 
  6. Update the boot information contained in the BDRA for the mirror copies of boot, root and primary swap.

    # /usr/sbin/lvlnboot -b /dev/vg00/lvol1
    # /usr/sbin/lvlnboot -v -r /dev/vg00/lvol3
    # /usr/sbin/lvlnboot -s /dev/vg00/lvol2
  7. Check if the BDRA is correct.

    # /usr/sbin/lvlnboot -R /dev/vg00 
  8. Verify that the mirrors were properly created.

    # lvlnboot -v

    The output of this command is shown in a display like the following:

    Boot Definitions for Volume Group /dev/vg00:
    Physical Volumes belonging in Root Volume Group:
    /dev/dsk/c4t5d0 (10/0.5.0) Boot Disk
    /dev/dsk/c4t6d0 (10/0.6.0) Boot Disk
    Boot: lvol1 on: /dev/dsk/c4t5d0
    /dev/dsk/c4t6d0
    Root: lvol3 on: /dev/dsk/c4t5d0
    /dev/dsk/c4t6d0
    Swap: lvol2 on: /dev/dsk/c4t5d0
    /dev/dsk/c4t6d0
    Dump: lvol2 on: /dev/dsk/c4t6d0, 0

Creating OPS Volume Groups on Disk Arrays

On your disk arrays, you should use redundant I/O channels from each node, connecting them to separate controllers on the array. Then you can define alternate links to the LUNs or logical disks you have defined on the array. If you are using SAM, choose the type of disk array you wish to configure, and follow the menus to define alternate links. If you are using LVM commands, specify the links on the command line.

The following example shows how to configure alternate links using LVM commands. The following disk configuration is assumed:

8/0.15.0 /dev/dsk/c0t15d0  /* I/O Channel 0 (8/0) SCSI address 15 LUN 0 */
8/0.15.1 /dev/dsk/c0t15d1 /* I/O Channel 0 (8/0) SCSI address 15 LUN 1 */
8/0.15.2 /dev/dsk/c0t15d2 /* I/O Channel 0 (8/0) SCSI address 15 LUN 2 */
8/0.15.3 /dev/dsk/c0t15d3 /* I/O Channel 0 (8/0) SCSI address 15 LUN 3 */
8/0.15.4 /dev/dsk/c0t15d4 /* I/O Channel 0 (8/0) SCSI address 15 LUN 4 */
8/0.15.5 /dev/dsk/c0t15d5 /* I/O Channel 0 (8/0) SCSI address 15 LUN 5 */

10/0.3.0 /dev/dsk/c1t3d0 /* I/O Channel 1 (10/0) SCSI address 3 LUN 0 */
10/0.3.1 /dev/dsk/c1t3d1 /* I/O Channel 1 (10/0) SCSI address 3 LUN 1 */
10/0.3.2 /dev/dsk/c1t3d2 /* I/O Channel 1 (10/0) SCSI address 3 LUN 2 */
10/0.3.3 /dev/dsk/c1t3d3 /* I/O Channel 1 (10/0) SCSI address 3 LUN 3 */
10/0.3.4 /dev/dsk/c1t3d4 /* I/O Channel 1 (10/0) SCSI address 3 LUN 4 */
10/0.3.5 /dev/dsk/c1t3d5 /* I/O Channel 1 (10/0) SCSI address 3 LUN 5 */

Assume that the disk array has been configured, and that both the following device files appear for the same LUN (logical disk) when you run the ioscan command:

/dev/dsk/c0t15d0
/dev/dsk/c1t3d0

Use the following procedure to configure a volume group for this logical disk:

  1. First, set up the group directory for vg_ops:

    # mkdir /dev/vg_ops 
  2. Next, create a control file named group in the directory /dev/vg_ops, as follows:

    # mknod /dev/vg_ops/group c 64 0xhh0000 

    The major number is always 64, and the hexadecimal minor number has the form

    0xhh0000

    where hh must be unique to the volume group you are creating. Use the next hexadecimal number that is available on your system, after the volume groups that are already configured. Use the following command to display a list of existing volume groups:

    # ls -l /dev/*/group 
  3. Use the pvcreate command on one of the device files associated with the LUN to define the LUN to LVM as a physical volume.

    # pvcreate -f /dev/rdsk/c0t15d0 

    It is only necessary to do this with one of the device file names for the LUN. The -f option is only necessary if the physical volume was previously used in some other volume group.

  4. Use the following command to create the volume group itself with the two links:

    # vgcreate /dev/vg_ops /dev/dsk/c0t15d0 /dev/dsk c1t3d0 

LVM will now recognize the I/O channel represented by /dev/dsk/c0t15d0 as the primary link to the disk; if the primary link fails, LVM will automatically switch to the alternate I/O channel represented by /dev/dsk/c1t3d0. Use the vgextend command to add additional disks to the volume group, specifying the appropriate physical volume name for each PV link.

Repeat the entire procedure for each distinct volume group you wish to create. For ease of system administration, you may wish to use different volume groups to separate logs from data and control files.

NOTE: The default maximum number of volume groups in HP-UX is 10. If you intend to create enough new volume groups that the total exceeds ten, you must increase the maxvgs system parameter and then re-build the HP-UX kernel. In SAM, select the Kernel Configuration Area, then choose "Configurable Parameters." Maxvgs appears on the list.

Creating Logical Volumes for OPS

After you create volume groups and add PV links to them, you define logical volumes for data, logs, and control files. The following are some examples:

# lvcreate -n ops1log1.log -L 4 /dev/vg_ops  
# lvcreate -n opsctl1.ctl -L 4 /dev/vg_ops
# lvcreate -n system.dbf -L 28 /dev/vg_ops
# lvcreate -n opsdata1.dbf -L 1000 /dev/vg_ops

Oracle Demo Database Files

The following set of files is required for the Oracle demo database which you can create during the installation process.

Table 5-1 Required Oracle File Names for Demo Database

Logical Volume Name

LV Size (MB)

Raw Logical Volume Path Name

Oracle File Size (MB)*

opsctl1.ctl

4

/dev/vg_ops/ropsctl1.ctl

1

opsctl2.ctl

4

/dev/vg_ops/ropsctl2.ctl

1

opsctl3.ctl

4

/dev/vg_ops/ropsctl3.ctl

1

system.dbf

28

/dev/vg_ops/rsystem.dbf

25

ops1log1.log

4

/dev/vg_ops/rops1log1.log

1

ops1log2.log

4

/dev/vg_ops/rops1log2.log

1

ops1log3.log

4

/dev/vg_ops/rops1log3.log

1

rollback.dbf

8

/dev/vg_ops/rrollback.dbf

4

temp.dbf

4

/dev/vg_ops/rtemp.dbf

1

users.dbf

4

/dev/vg_ops/rusers.dbf

1

tools.dbf

16

/dev/vg_ops/rtools.dbf

15

ops2log1.log

4

/dev/vg_ops/rops2log1.log

1

ops2log2.log

4

/dev/vg_ops/rops2log2.log

1

ops2log3.log

4

/dev/vg_ops/rops2log3.log

1

opsdata1.dbf

/dev/vg_ops/ropsdata1.dbf

opsdata2.dbf

/dev/vg_ops/ropsdata2.dbf

opsdata3.dbf

/dev/vg_ops/ropsdata3.dbf

 

* The size of the logical volume is larger than the Oracle file size because Oracle needs extra space to allocate a header in addition to the file's actual data capacity.

Create these files if you wish to build the demo database. The three logical volumes at the bottom of the table are included as additional data files, which you can create as needed, supplying the appropriate sizes. If your naming conventions require, you can include the Oracle SID and/or the database name to distinguish files for different instances and different databases. If you are using the ORACLE_BASE directory structure, create symbolic links to the ORACLE_BASE files from the appropriate directory. Example:

# ln -s /dev/vg_ops/ropsctl1.ctl /u01/ORACLE/db001/ctrl01_1.ctl

(For more information about Oracle directories, refer to the Oracle Server for HP 9000 Installation and Configuration Guide.

After creating these files, set the owner to oracle and the group to dba with a file mode of 660. The logical volumes are now available on the primary node, and the raw logical volume names can now be used by the Oracle DBA.

Displaying the Logical Volume Infrastructure

To display the volume group, use the vgdisplay command:

# vgdisplay -v /dev/vg_ops 

Exporting the Logical Volume Infrastructure

Before the OPS volume groups can be shared, their configuration data must be exported to other nodes in the cluster. This is done either in SAM or by using HP-UX commands, as shown in the following sections.

NOTE: A volume group using an HP High Availability Disk Array cannot be designated as a cluster lock volume group. You will need to use another volume group containing an independent disk for the cluster lock.

Exporting with SAM

In SAM, choose "Disks and File Systems," then choose "Volume Groups." Open the Actions menu and choose "Distribute." Follow the prompts in the dialog box to select the volume group that is to be distributed to one or more additional nodes. Enter the name of each node that is to receive the volume group and select "Add." When the list is complete, press "OK." SAM automatically configures the volume group for use on the other nodes.

NOTE: In distributing the volume group, SAM does not import PV links on other nodes. Therefore, to complete the distribution, you use the vgextend command on all nodes to add the alternate PV links to the volume group you have distributed. Use the vgdisplay command to verify the existence of the correct groups of PV links on all nodes.

Exporting with LVM Commands

Use the following commands to set up the same volume group on another cluster node. In this example, the commands set up a new volume group on a system known as ftsys10. This volume group will hold the same physical volume that was created on a configuration node known as ftsys9.

To set up the volume group on ftsys10 (and other nodes), use the following steps:

  1. On ftsys9, copy the mapping of the volume group to a specified file.

    # vgexport -s -p -m /tmp/vg_ops.map  /dev/vg_ops 
  2. Still on ftsys9, copy the map file to ftsys10 (and to additional nodes as necessary.)

    # rcp /tmp/vg_ops.map ftsys10:/tmp/vg_ops.map 
  3. On ftsys10 (and other nodes, as necessary), create the volume group directory and the control file named group:

    # mkdir /dev/vg_ops 
    # mknod /dev/vg_ops/group c 64 0xhh0000

    For the group file, the major number is always 64, and the hexadecimal minor number has the form

    0xhh0000

    where hh must be unique to the volume group you are creating. If possible, use the same number as on ftsys9. Use the following command to display a list of existing volume groups:

    # ls -l /dev/*/group 
  4. Import the volume group data using the map file from node ftsys9. On node ftsys10 (and other nodes, as necessary), enter:

    # vgimport -s -m /tmp/vg_ops.map /dev/vg_ops \   /dev/dsk/c3t12d0 /dev/dsk/c4t3d0
    CAUTION: Special care should be used when importing volume groups that use PV links with the A3231A (Model 10) and A3232A (Model 20) disk arrays. On these arrays, each disk device file name represents a link to a disk through a separate controller, and all primary links must use the same controller. Even though the device file names may be different on different nodes, it is very important to specify the PV links in the vgimport command in the same controller order on all nodes that they were specified in creating the volume group on the configuration node. Failure to do this with PV links will result in poor performance.

Creating Volume Groups for Packages

If you are creating packages, you must configure separate volume groups that can be activated each time the package starts up on a particular node. Packages activate volume groups in exclusive mode rather than shared mode, which is used for OPS volume groups. Another difference is that with package volume groups, you can define file systems that are mounted when the package starts up. By contrast, OPS data is stored on raw logical volumes, which do not use mounted file systems.

Creating Package Volume Groups on Disk Arrays

You create volume groups for packages in the same way you create volume groups for use by OPS, using the same LVM commands. The following example creates a volume group that uses PV links /dev/dsk/c5t2d0 and /dev/dsk/c6t2d0 representing a LUN on a disk array for use by a package. The example shows all the commands, including the commands to create a file system to be mounted on /mnt1:

  1. On the configuration node, create physical volumes from the disks:

    # pvcreate -f /dev/rdsk/c5t2d0 

    You only need to use the pvcreate command on one PV link.

  2. Use the following commands to create a volume group called vg_pkg1:

    # mkdir /dev/vg_pkg1 
    # mknod /dev/vg_pkg1/group c 64 0xhh0000

    Replace the minor number hh with the next available hexadecimal minor group number available on your system.

  3. Create the volume group with two PV links for the disk:

    # vgcreate /dev/vg_pkg1 /dev/dsk/c5t2d0 /dev/dsk/c6t2d0 
  4. Repeat this procedure for additional volume groups.

  5. Create a logical volume named lvol1 with 12 MB:

    # lvcreate -L 12 /dev/vg_pkg1 
  6. To display the volume group, use the vgdisplay command:

    # vgdisplay -v /dev/vg_pkg1 
  7. Create a file system on the logical volume and mount it on /mnt1.

    # mkdir /mnt1 
    # newfs -F vxfs /dev/vg_pkg1/rlvol1
    # mount /dev/vg_pkg1/lvol1 /mnt1
  8. Repeat this process for any other volume groups you need to create.

  9. Before setting up the volume group for use on other nodes, you must first unmount any file systems that reside on the volume group, then deactivate it. At run time, volume group activation and file system mounting are done through the package control script.

    # umount /mnt1 
    # vgchange -a n /dev/vg_pkg1

Creating Logical Volumes for Use with Packages

Use the lvcreate command to create logical volumes. Th following example is for a volume group named /dev/vgdatabase:

# lvcreate  -L 120 -m 1 -s g /dev/vgdatabase 

This command creates a 120 MB mirrored volume named lvol1. The name is supplied by default, since no name is specified in the command. The -s g option means that mirroring is PVG-strict, that is, the mirror copies of data will be in different physical volume groups.

NOTE: If you are using disk arrays in RAID 1 or RAID 5 mode, omit the -m 1 and -s g options.

Creating Package Volume Groups with Mirrored Individual Data Disks

NOTE: The procedure described in this section is for use only with application packages, not with OPS instances and not with OPS data. Software mirroring is not supported for OPS data.
Using SAM to Create Volume Groups and Logical Volumes

You can use SAM to prepare the volume group and logical volume structure needed for HA packages. In SAM, choose the "Disks and File Systems Area." Then use the following procedure for each volume group and file system you are using with the package:

  1. Select the Volume Groups subarea.

  2. From the Actions menu, choose Create or Extend.

  3. Choose the first physical disk you wish to use in the volume group by selecting it from the list of available disks.

  4. Enter the volume group name, e.g., vgdatabase.

  5. Choose Create or Extend Volume Group.

  6. Choose Add New Logical Volumes.

  7. Specify the file system that is to be mounted on the volume group, for example, /mnt1.

  8. Repeat the procedure for additional volume groups, logical volumes, and file systems.

Skip ahead to the section "Distributing the Package Volume Group".

Using LVM Commands to Create Volume Groups and Logical Volumes

You can use LVM commands to create volume groups for packages on mirrored disks. Use the procedures in this section.

Selecting Disks for the Volume Group

Obtain a list of the disks on both nodes and identify which device files are used for the same disk on both. Use the following command on each node to list available disks as they are known to each system:

# lssf /dev/dsk/*  

In the following examples, we use /dev/rdsk/c1t2d0 and /dev/rdsk/c0t2d0, which happen to be the device names for the same disks on both ftsys9 and ftsys10. In the event that the device file names are different on the different nodes, make a careful note of the correspondences.

Creating Physical Volumes

On the configuration node (ftsys9), use the pvcreate command to define disks as physical volumes. This only needs to be done on the configuration node. Use the following commands to create two physical volumes for the sample configuration:

# pvcreate -f /dev/rdsk/c1t2d0 
# pvcreate -f /dev/rdsk/c0t2d0
Creating a Volume Group.

Use the following steps to build a volume group on the configuration node (ftsys9). Later, the same volume group will be created on other nodes.

  1. First, set up the group directory for vgdatabase:

    # mkdir /dev/vgdatabase 
  2. Next, create a control file named group in the directory /dev/vgdatabase, as follows:

    # mknod /dev/vgdatabase/group c 64 0xhh0000 

    The major number is always 64, and the hexadecimal minor number has the form

    0xhh0000

    where hh must be unique to the volume group you are creating. Use the next hexadecimal number that is available on your system, after the volume groups that are already configured. Use the following command to display a list of existing volume groups:

    # ls -l /dev/*/group 
  3. Create the volume group and add physical volumes to it with the following commands:

    # vgcreate /dev/vgdatabase /dev/dsk/c1t2d0 
    # vgextend /dev/vgdatabase /dev/dsk/c0t2d0

    The first command creates the volume group and adds a physical volume to it. The second command adds the second physical volume to the volume group.

  4. Repeat this procedure for additional volume groups.

Creating Logical Volumes

Use the following command to create logical volumes (the example is for a volume group named /dev/vgdatabase):

# lvcreate  -L 120 -m 1 /dev/vgdatabase 

This command creates a 120 MB mirrored volume named lvol1. The name is supplied by default, since no name is specified in the command.

NOTE: If you are using disk arrays in RAID 1 or RAID 5 mode, omit the -m 1 option.
Creating File Systems

If your installation uses file systems, create them next. Use the following commands to create a file system for mounting on the logical volume just created:

  1. Create the file system on the newly created logical volume:

    # newfs -F vxfs /dev/vgdatabase/rlvol1 

    Note the use of the raw device file for the logical volume.

  2. Create a directory to mount the disk:

    # mkdir /mnt1 
  3. Mount the disk to verify your work:

    # mount /dev/vgdatabase/lvol1 /mnt1 

    Note the mount command uses the block device file for the logical volume.

  4. Verify the configuration:

    # vgdisplay -v /dev/vgdatabase 

Distributing the Package Volume Group to Other Nodes

After creating volume groups for cluster data, you must make them available to any cluster node that will need to activate the volume group.

Distributing the Package Volume Group to Other Cluster Nodes with SAM

In SAM, choose the Disks and File Systems area, then choose Volume Groups. Select the volume group that is to be distributed to one or more additional nodes. Enter the name of each node that is to receive the volume group and select "Add." When the list is complete, press OK. SAM automatically configures the volume group for use on the other nodes.

After distributing the volume groups, check the /etc/lvmpvg files on each node to ensure that each physical volume group contains the correct physical volume names for that node.

Distributing the Package Volume Group to Other Cluster Nodes with LVM Commands

Use the following commands to set up the same volume group on another cluster node. In this example, the commands set up a new volume group on ftsys10 which will hold the same physical volume that was available on ftsys9. You must carry out the same procedure separately for each node on which the volume group's package can run.

To set up the volume group on ftsys10, use the following steps:

  1. On ftsys9, copy the mapping of the volume group group to a specified file.

    # vgexport -p -s -m /tmp/vgdatabase.map  /dev/vgdatabase 
  2. Still on ftsys9, copy the map file to ftsys10:

    # rcp /tmp/vgdatabase.map ftsys10:/tmp/vgdatabase.map 
  3. On ftsys10, create the volume group directory:

    # mkdir /dev/vgdatabase 
  4. Still on ftsys10, create a control file named group in the directory /dev/vgdatabase, as follows:

    # mknod /dev/vgdatabase/group c 64 0xhh0000 

    The major number is always 64, and the hexadecimal minor number has the form

    0xhh0000

    where hh must be unique to the volume group you are creating. If possible, use the same number as on ftsys9. Use the following command to display a list of existing volume groups:

    # ls -l /dev/*/group 
  5. Import the volume group data using the map file from node ftsys9. On node fsys10, enter:

    # vgimport -s -m /tmp/vgdatabase.map /dev/vgdatabase  

    Note that the disk device names on ftsys10 may be different from their names on ftsys9. You should check to ensure that the physical volume names are correct throughout the cluster.

  6. Enable the volume group on ftsys10:

    # vgchange -a y /dev/vgdatabase 
  7. Create a directory to mount the disk:

    # mkdir /mnt1 
  8. Mount and verify the volume group on ftsys10:

    # mount /dev/vgdatabase/lvol1 /mnt1 
  9. Unmount the volume group on ftsys10:

    # umount /mnt1
  10. Deactivate the volume group on ftsys10:

    # vgchange -a n /dev/vgdatabase 

Creating Additional Volume Groups

The preceding sections show in general how to create volume groups and logical volumes for use with MC/LockManager. Repeat the procedure for as many volume groups as you need to create, substituting other volume group names, logical volume names, and physical volume names.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1998 Hewlett-Packard Development Company, L.P.