1. use the root user to modify the/etc/lvmrc file to make the shared VG. first, disable the automatic active setting when the file is started. You must ensure that these VG are activated when SG is started. Back up the/etc/lvmrc file # cp/etc/lvmrc/etc/lvmrc_orig and modify the/etc/lvmrc file From: AUTO_VG_ACTIVATE1To: AUTO
1. modify the/etc/lvmrc file as the root user
To make a shared VG, you must first disable its automatic active setting.
You must ensure that these VG are activated when SG is started.
Back up the/etc/lvmrc file
# Cp/etc/lvmrc/etc/lvmrc_orig
Modify the/etc/lvmrc file
From:
AUTO_VG_ACTIVATE = 1
To:
AUTO_VG_ACTIVATE = 0
Add the custom_vg_activation module to the/etc/lvmrc file,
This parameter is set for a non-shared VG. (Or not)
Custom_vg_activation ()
{
# E.g./sbin/vgchange-a y-s
# Parallel_vg_sync "/dev/vg00/dev/vg01"
# Parallel_vg_sync "/dev/vg02/dev/vg03"
/Sbin/vgchange-a y vg00
/Sbin/vgchange-a y vg01
/Sbin/vgchange-a y vg02
/Sbin/vgchange-a y vg03
Return 0
}
2. create a shared logical volume Group
On the master node:
# Initialize PV
Pvcreate-f/dev/rdsk/c0t12d0
# Add a directory for VG in the/dev directory
Mkdir/dev/vg_ops
# The Major number must be 64, and the minor number is a hexadecimal number of 2, which is uniquely identified.
Mknod/dev/vg_ops/group c 64 0 0x060000
# Create VG
Vgcreate/dev/vg_ops/dev/dsk/c0t12d0
# Activate VG
Vgchange-a y vg_ops
# Create an LV
Lvcreate-n P901_control_01.ctl-L 110/dev/vg_ops
Lvcreate-n P901_control_02.ctl-L 110/dev/vg_ops
Lvcreate-n P901_control_03.ctl-L 110/dev/vg_ops
Lvcreate-n P901_system_01.dbf-L 400/dev/vg_ops
Lvcreate-n P901_log1_01.log-L 120/dev/vg_ops
Lvcreate-n P901_log1_02.log-L 120/dev/vg_ops
Lvcreate-n P901_log1_03.log-L 120/dev/vg_ops
Lvcreate-n P901_log2_01.log-L 120/dev/vg_ops
Lvcreate-n P901_log2_02.log-L 120/dev/vg_ops
Lvcreate-n P901_log2_03.log-L 120/dev/vg_ops
Lvcreate-n p90?spfile1.dbf-L 5/dev/vg_ops
Lvcreate-n P901_users_01.dbf-L 120/dev/vg_ops
Lvcreate-n P901_temp_01.dbf-L 100/dev/vg_ops
Lvcreate-n P901_undotbs_01.dbf-L 312/dev/vg_ops
Lvcreate-n P901_undotbs_02.dbf-L 312/dev/vg_ops
Lvcreate-n P901_example_01.dbf-L 160/dev/vg_ops
Lvcreate-n P901_cwmlite_01.dbf-L 100/dev/vg_ops
Lvcreate-n P901_indx_01.dbf-L 70/dev/vg_ops
Lvcreate-n P901_tools_01.dbf-L 20/dev/vg_ops
Lvcreate-n P901_drsys_01.dbf-L 90/dev/vg_ops
# Deactivate VG
Vgchange-a n vg_ops
# Create an LV map file
Vgexport-v-s-p-m/tmp/vg_ops.map/dev/vg_ops
# Copy the map file to another node
Rcp/tmp/vg_ops.map ow.hp2:/tmp/vg_ops.mapOn the other nodes:
Mkdir/dev/vg_ops
Mknod/dev/vg_ops/group c 64 0 0x060000
# Create VG and LV on other nodes
Vgimport-v-s-m/tmp/vg_ops.map/dev/vg_ops
# Configure the permissions and owner of the corresponding VG and LV on all nodes
# Chown oracle: dba/dev/vg_ops/r *
# Remsh nodehp2 chown oracle: dba/dev/vg_ops/r *
# Chmod 777/dev/vg_ops
# Remsh nodehp2 chmod 777/dev/vg_ops
# Chmod 660/dev/vg_ops/r *
# Remsh nodehp2 chmod 660/dev/vg_ops/r *
Note: When creating VG, pay attention to the uniqueness of minor number. the following commands are commonly used:
# Find/dev-name group-exec ls-l {};
Crw ------- 1 root sys 64 0x060000 May 6/dev/vg_ops/group
In this example, "vg_ops" is "0x060000", so "0x060000" cannot be used to create other VG, valid minornumbers ranges from 0x010000 to 0xFF0000 ".
3. installation of cluster software ServiceGuard
Installed by the supplier. Oracle 10gR2 RAC requires that the Serviceguard Extension forRAC version must be A.11.16.00 or later, and also include A.11.16.00.
4. plan the cluster environment
1) configure the cluster:
Use cmquerycl to create a cluster configuration file
The Cmquerycl command must be executed on the master node.
# Cmquerycl-v-C/etc/cmcluster/cmclconf. ascii-n nodehp1-nnodehp2
2) modify the cluster configuration file
CLUSTER_NAME # example nodehp
FIRST_CLUSTER_LOCK #/dev/vg_ops
FIRST_CLUSTER_PV #/dev/dsk/c0t12d0
OPS_VOLUME_GROUP #/dev/vg_ops
DLM_ENABLED # NO
GMS_ENABLED # NO
FIRST_CLUSTER_LOCK, FIRST_CLUSTER_PV = cluster lock volume Group and disk as voting purposes. The voting VG and the disk must be accessible to all nodes (shared VG can be used ). If a node is dumped, the VG processing is required.
OPS_VOLUME_GROUP = all shared VG
DLM_ENABLED and GMS_ENABLED = NO (NO after 8.1.7)
3) use the cmcheckconf command to verify the cluster configuration file
# Cmcheckconf-v-C/etc/cmcluster/cmclconf. ascii
4) use vgchange to activate the lock volume Group
# Vgchange-a y vg_ops
5) use cmapplyconf to copy the cluster configuration file to all nodes.
# Cmapplyconf-v-C/etc/cmcluster/cmclconf. ascii
6) use vgchange to deactivate the lock volume Group
# Vgchange-a n vg_ops
5. basic cluster management
1) start the cluster:
# Cmruncl
2) use vgchange to set up shared VG on the master node
# Vgchange-S y-c y vg_ops
3) use vgchange to activate the shared VG on each node.
# Vgchange-a s vg_ops
# Remsh nodehp2/usr/sbin/vgchange-a s vg_ops
4) use cmhaltcl to close the cluster or use cmhaltnode to remove nodes from the cluster.
# Cmhaltnode
5) use cmrunnode to add nodes to the cluster
# Cmrunnode
6) you can use cmhaltpkg, cmrunpkg, and cmmodpkg to manage the pkg of a cluster. you can also use it to restore a cluster node. For more information, see the online manual.
6. Log Files for Cluster
/Var/adm/syslog. log contains the system information of HP Serviceguard Extension forRAC