***************************检查双机是否自动启动*********************************
/etc/rc.config.d/cmcluster中设置AUTOSTART_CMCLD=0
*****************************建立信任关系******************************************
vi /etc/hosts
192.168.100.1 plcdb21-mchb
192.168.100.2 plcdb22-mchb(根据客户要求改)
3.12.21.81 plcdb21
3.12.21.82 plcdb22
3.12.21.91 plcdb21-vip
3.12.21.92 plcdb22-vip
vi /.rhosts
plcdb21 root
plcdb22 root
plcdb21-mchb root
plcdb22-mchb root
plcdb21-vip root
plcdb22-vip root
**********配置心跳IP Private IP***************
1、smh
2、n——i——n——lan0——p
3、选中[X] IPv4 Attributes (Select to enable)
4、Private IP
5、配置完ip,submask后,modify,ok退出
*********创建pv*******************
3.12.21.81 plcdb21 LUN ID 3.12.21.82 plcdb22
锁盘
disk160 14 disk169 15 ID=08FD disk159 14 disk168 15
***********************************************************
disk144 14 disk148 15 52G ID=093A disk111 15 disk147 14 /dev/vggg
disk145 14 disk14915 52G ID=093C /dev/vgarch1
52G ID=093E disk112 15 disk148 14 /dev/vgarch2
disk146 14 disk150 14 100G ID=0AC4 disk11315disk149 14 /dev/vgdata
disk147 14 disk151 14 100G ID=0AC8 disk114 15 disk150 14 /dev/vgdata
1.
pvcreate -f /dev/rdisk/disk145
pvcreate -f /dev/rdisk/disk149
pvcreate -t 90 /dev/rdisk/disk145
pvcreate -t 90 /dev/rdisk/disk149
pvcreate -f /dev/rdisk/disk144
pvcreate -f /dev/rdisk/disk148
pvcreate -f /dev/rdisk/disk146
pvcreate -f /dev/rdisk/disk150
pvcreate -f /dev/rdisk/disk147
pvcreate -f /dev/rdisk/disk151
pvcreate -f /dev/rdisk/disk160/pvcreate -f /dev/rdisk/disk169
2. 【可省略】
pvcreate -f /dev/rdisk/disk111
pvcreate -f /dev/rdisk/disk147
pvcreate -t 90 /dev/rdisk/disk111
pvcreate -t 90 /dev/rdisk/disk147
pvcreate -f /dev/rdisk/disk112
pvcreate -t 90 /dev/rdisk/disk112
pvcreate -f /dev/rdisk/disk148
pvcreate -t 90 /dev/rdisk/disk148
mkdir /dev/vggg
mknod /dev/vggg/group c 128 0x020000
mknod /dev/vgarch2/group c 128 0x040000
***************************创建vg(pvg)*************************************************
锁盘
disk160 14 disk169 15 ID=08FD disk159 14 disk168 15
*****************************************************************************************
disk144 disk148 52M ID=093A disk111 disk147 /dev/vggg
disk145 disk14952M ID=093C /dev/vgarch1
52M ID=093E disk112 disk148 /dev/vgarch2
disk146 disk150 100M ID=0AC4 disk113disk149 /dev/vgdata
disk147 disk151 100M ID=0AC8 disk114 disk150 /dev/vgdata
*****************************************************************************************
ll /dev/*/group
mkdir /dev/vgdata
mkdir /dev/vggg
mkdir /dev/vglock
mkdir /dev/vgarch1
mkdir /dev/vgarch2
mknod /dev/vgdata/group c 128 0x010000
mknod /dev/vggg/group c 128 0x020000
mknod /dev/vgarch1/group c 128 0x03000
mknod /dev/vgarch2/group c 128 0x040000
mknod /dev/vglock/group c 128 0x050000
1、
vgcreate -V 2.0 -g PVG0 -s 64 -S 2000t /dev/vgdata /dev/disk/disk146 /dev/disk/disk147
vgextend -g PVG1 /dev/vgdata /dev/disk/disk150 /dev/disk/disk151
vgcreate -V 2.0 -s 64 -S 2000t /dev/vgdata /dev/disk/disk147 /dev/disk/disk150 /dev/disk/disk151
vgcreate -V 2.0 -s 64 -S 2000t /dev/vggg /dev/disk/disk144 /dev/disk/disk148
vgcreate -V 2.0 -s 64 -S 2000t /dev/vgarch1 /dev/disk/disk149 /dev/disk/disk145
vgcreate -V 2.0 -s 64 -S 2000t /dev/vglock /dev/disk/disk160
******************创建lv*****************************************************
#lvcreate -s g -D y -L 512 -n sybdev0 -m 1 vgsybase /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 4096 -n lv_lcdb2_system01_4g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_sysaux01_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 5120 -n lv_lcdb2_undotbs01_5g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 5120 -n lv_lcdb2_undotbs02_5g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 5120 -n lv_lcdb2_temp01_5g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_users01_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_abc01_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_others01_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 2048 -n lv_lcdb2_r01_2g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_t01_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 15360 -n lv_lcdb2_index01_15g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 256 -n lv_lcdb2_control01_256m /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 256 -n lv_lcdb2_control02_256m /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 64 -n lv_lcdb2_spfile_64m /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 64 -n lv_lcdb2_password_64m /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo11_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo12_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo13_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo14_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo15_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo21_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo22_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo23_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo24_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_redo25_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo11_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo12_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo13_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo14_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo15_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo16_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo21_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo22_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo23_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo24_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo25_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_sredo26_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_ocr01_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_ocr02_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_vote01_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_vote02_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 1024 -n lv_lcdb2_vote03_1g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 4096 -n lv_lcdb2_data01_4g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 4096 -n lv_lcdb2_data02_4g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_data03_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 8192 -n lv_lcdb2_data04_8g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 16384 -n lv_lcdb2_data05_16g /dev/vgdata
lvcreate -m 1 -s g -M n -c n -L 16384 -n lv_lcdb2_data06_16g /dev/vgdata
vgdisplay -v vgdata |grep lv |wc -l 检查lv数量
*************************导出map*************************************
vgexport -v -p -s -m /tmp/vgdata.map /dev/vgdata
vgexport -v -p -s -m /tmp/vglock.map /dev/vglock
***********************传输到B机**************************************
rcp /tmp/vgdata.map plcdb22:/tmp/
rcp /tmp/vglock.map plcdb22:/tmp/
rcp /etc/lvmpvg plcdb22:/etc
*********************在A机上检查vg信息******************************
vgchange -a y /dev/vgdata
vgchange -a y /dev/vglock
vgchange -a n /dev/vgdata
vgchange -a n /dev/vglock
#************************在B机上创建vg信息********************************
mkdir /dev/vgdata
mkdir /dev/vglock
mknod /dev/vgdata/group c 128 0x010000
mknod /dev/vglock/group c 128 0x050000
*************************在B机上导入vg信息*******************************
vgimport -N -s -v -m /tmp/vgdata.map /dev/vgdata
vgimport -N -s -v -m /tmp/vglock.map /dev/vglock
************************在B机上激活vg,查看vg信息**************************************
vgchange -a y /dev/vgdata
vgchange -a y /dev/vglock
ll /dev/*/group
************************备份vg(可选)***************************************
vgcfgbackup /dev/vgdata
vgcfgbackup /dev/vglock
**************************在B机去激活vg*********************************
vgchange -a n /dev/vgdata
vgchange -a n /dev/vglock
******************************在A机生成ascii脚本**********************************
cmquerycl -v -C /etc/cmcluster/cluster.ascii -n plcdb21 -n plcdb22
*******************************在A机编辑ascii脚本***************************************
vi /etc/cmcluster/cluster.ascii
#########################################
CLUSTER_NAME PLCDB2 ###大写
HOSTNAME_ADDRESS_FAMILY IPV4
FIRST_CLUSTER_LOCK_VG /dev/vglock ###########把vg改成vglock
NODE_NAME plcdb21
NETWORK_INTERFACE lan6
HEARTBEAT_IP 192.168.100.1
NETWORK_INTERFACE lan905
HEARTBEAT_IP 10.10.51.1
# NETWORK_INTERFACE lan906############注释掉
# HEARTBEAT_IP 192.168.100.1#############注释掉
FIRST_CLUSTER_LOCK_PV /dev/disk/disk160#############第一节点锁盘
NODE_NAME plcdb22
NETWORK_INTERFACE lan6
HEARTBEAT_IP 192.168.100.2
NETWORK_INTERFACE lan905
HEARTBEAT_IP 10.10.51.2
#NETWORK_INTERFACE lan906##################
#HEARTBEAT_IP 192.168.192.2####################
FIRST_CLUSTER_LOCK_PV /dev/disk/disk159 ##########第二节点锁盘
MEMBER_TIMEOUT 14000000
AUTO_START_TIMEOUT 600000000
NETWORK_POLLING_INTERVAL 2000000
NETWORK_FAILURE_DETECTION INOUT
NETWORK_AUTO_FAILBACK YES
SUBNET 192.168.0.0
IP_MONITOR OFF
SUBNET 13.12.21.0
IP_MONITOR ON
POLLING_TARGET 3.12.21.254
########SUBNET 192.168.1.0##############注释掉
########IP_MONITOR OFF###############注释掉
MAX_CONFIGURED_PACKAGES 10 ########300改成10
USER_NAME ANY_USER
USER_HOST ANY_SERVICEGUARD_NODE
USER_ROLE MONITOR
OPS_VOLUME_GROUP /dev/vgdata ############检查################
OPS_VOLUME_GROUP /dev/vgdata1
OPS_VOLUME_GROUP /dev/vglock
**********************************在A机检查ascii脚本*********************************
cmcheckconf -v -C /etc/cmcluster/cluster.ascii
**********************************在A机激活vglock**********************************
vgchange -a n /dev/vglock
vgchange -a y /dev/vglock
***********************************传输ascii脚本到B机********************************
rcp /etc/cmcluster/cluster.ascii plcdb22:/etc/cmcluster/
***********************************应用ascii脚本***************************************
cmapplyconf -k -v -C /etc/cmcluster/cluster.ascii
**********************************在A机运行并检查双机*************************************
cmruncl -v
cmviewcl -v
***************************************更改vg属性********************************************
vgchange -S y -c y vgdata
vgchange -a s vgdata
remsh plcdb22 /usr/sbin/vgchange -a s vgdata
********************如果上条没有通过的话,执行查看下列文档:********************
cmviewcl -v
/etc/cmcluster/
/var/adm/syslog/syslog.log
**********************************在A机创建包目录*****************************************
mkdir /etc/cmcluster/plcdb_pkg
**********************************在A机创建包配置文件*********************************************
cmmakepkg -p /etc/cmcluster/plcdb_pkg/plcdb_pkg01.conf
cmmakepkg -p /etc/cmcluster/plcdb_pkg/plcdb_pkg02.conf
**********************************在A机创建包控制文件*********************************************
cmmakepkg -s /etc/cmcluster/plcdb_pkg/plcdb_pkg01.cntl
cmmakepkg -s /etc/cmcluster/plcdb_pkg/plcdb_pkg02.cntl
**********************************在A机编辑包配置文件1**********************************************
vi /etc/cmcluster/plcdb_pkg/plcdb_pkg01.conf
########################################################################
PACKAGE_NAME PLCDB-PKG01
PACKAGE_TYPE MULTI_NODE
NODE_NAME plcdb21
#NODE_NAME plcdb22
AUTO_RUN YES
NODE_FAIL_FAST_ENABLED NO
RUN_SCRIPT /etc/cmcluster/plcdb_pkg/plcdb_pkg01.cntl
HALT_SCRIPT /etc/cmcluster/plcdb_pkg/plcdb_pkg01.cntl
RUN_SCRIPT_TIMEOUT NO_TIMEOUT
HALT_SCRIPT_TIMEOUT NO_TIMEOUT
SUCCESSOR_HALT_TIMEOUT NO_TIMEOUT
FAILOVER_POLICY CONFIGURED_NODE
FAILBACK_POLICY MANUAL
PRIORITY NO_PRIORITY
LOCAL_LAN_FAILOVER_ALLOWED YES
MONITORED_SUBNET 3.12.21.0
MONITORED_SUBNET_ACCESS FULL
##############################################################
*********************************在A机编辑包控制文件1****************************************
vi /etc/cmcluster/plcdb_pkg/plcdb_pkg01.cntl
####################################################################
VGCHANGE="vgchange -a s"
CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=exclusivewrite"
VG[0]=vgdata
VXVM_DG_RETRY="NO"
DEACTIVATION_RETRY_COUNT=2
KILL_PROCESSES_ACCESSING_RAW_DEVICES="NO"
VXVOL="vxvol -g \$DiskGroup startall"
FS_UMOUNT_COUNT=1
FS_MOUNT_RETRY_COUNT=0
CONCURRENT_VGCHANGE_OPERATIONS=1
ENABLE_THREADED_VGCHANGE=0
CONCURRENT_FSCK_OPERATIONS=1
CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS=1
在test_return 51上
/etc/cmcluster/plcdb_pkg/start_pkg01.sh
在test_return 52上
/etc/cmcluster/plcdb_pkg/shut_pkg01.sh
##############################################################
**********************************在A机编辑包配置文件2**********************************************
vi /etc/cmcluster/plcdb_pkg/plcdb_pkg02.conf
########################################################################
PACKAGE_NAME PLCDB-PKG02
PACKAGE_TYPE MULTI_NODE
NODE_NAME plcdb22
AUTO_RUN YES
NODE_FAIL_FAST_ENABLED NO
RUN_SCRIPT /etc/cmcluster/plcdb_pkg/plcdb_pkg02.cntl
HALT_SCRIPT /etc/cmcluster/plcdb_pkg/plcdb_pkg02.cntl
RUN_SCRIPT_TIMEOUT NO_TIMEOUT
HALT_SCRIPT_TIMEOUT NO_TIMEOUT
SUCCESSOR_HALT_TIMEOUT NO_TIMEOUT
FAILOVER_POLICY CONFIGURED_NODE
FAILBACK_POLICY MANUAL
PRIORITY NO_PRIORITY
LOCAL_LAN_FAILOVER_ALLOWED YES
MONITORED_SUBNET 10.10.51.0
MONITORED_SUBNET_ACCESS FULL
##############################################################
*********************************在A机编辑包控制文件2****************************************
vi /etc/cmcluster/plcdb_pkg/plcdb_pkg02.cntl
####################################################################
VGCHANGE="vgchange -a s"
CVM_ACTIVATION_CMD="vxdg -g \$DiskGroup set activation=exclusivewrite"
VG[0]=vgdata
VXVM_DG_RETRY="NO"
DEACTIVATION_RETRY_COUNT=2
KILL_PROCESSES_ACCESSING_RAW_DEVICES="NO"
VXVOL="vxvol -g \$DiskGroup startall"
FS_UMOUNT_COUNT=1
FS_MOUNT_RETRY_COUNT=0
CONCURRENT_VGCHANGE_OPERATIONS=1
ENABLE_THREADED_VGCHANGE=0
CONCURRENT_FSCK_OPERATIONS=1
CONCURRENT_MOUNT_AND_UMOUNT_OPERATIONS=1
51上
/etc/cmcluster/plcdb_pkg/start_pkg02.sh
/etc/cmcluster/plcdb_pkg/shut_pkg02.sh
52上
##############################################################
******************************增加脚本文件**********************************************
echo 'echo "The PLCDB-PKG01 is start" ' >> /etc/cmcluster/plcdb_pkg/start_pkg01.sh
echo 'echo "The PLCDB-PKG01 is shutdown"' >> /etc/cmcluster/plcdb_pkg/shut_pkg01.sh
echo 'echo "The PLCDB-PKG02 is start" ' >> /etc/cmcluster/plcdb_pkg/start_pkg02.sh
echo 'echo "The PLCDB-PKG02 is shutdown" ' >> /etc/cmcluster/plcdb_pkg/shut_pkg02.sh
******************************在A机修改文件权限****************************************
chmod 777 /etc/cmcluster/plcdb_pkg/start_pkg01.sh
chmod 777 /etc/cmcluster/plcdb_pkg/shut_pkg01.sh
chmod 777 /etc/cmcluster/plcdb_pkg/start_pkg02.sh
chmod 777 /etc/cmcluster/plcdb_pkg/shut_pkg02.sh
chmod 744 /etc/cmcluster/plcdb_pkg/plcdb_pkg01.cntl
chmod 744 /etc/cmcluster/plcdb_pkg/plcdb_pkg02.cntl
chmod 744 /etc/cmcluster/plcdb_pkg
*********************************传输到B机*********************************************
rcp -pr /etc/cmcluster/plcdb_pkg plcdb22:/etc/cmcluster/
***********************************在A机检查ascii文件和包文件**************************************
cmcheckconf -v -C /etc/cmcluster/cluster.ascii
cmcheckconf -v -C /etc/cmcluster/cluster.ascii -P /etc/cmcluster/plcdb_pkg/plcdb_pkg01.conf
cmcheckconf -v -C /etc/cmcluster/cluster.ascii -P /etc/cmcluster/plcdb_pkg/plcdb_pkg02.conf
*************************************在A机运行ascii文件和配置文件****************************************
cmapplyconf -v -C /etc/cmcluster/cluster.ascii -P /etc/cmcluster/plcdb_pkg/plcdb_pkg01.conf
cmapplyconf -v -C /etc/cmcluster/cluster.ascii -P /etc/cmcluster/plcdb_pkg/plcdb_pkg02.conf
*************************************在A机更改vg信息***********************************************
vgchange -a n /dev/vglock
vgchange -c y /dev/vglock
vgchange -c y /dev/vgdata
*****************************************在A机检查双机配置******************************************
测试
cmruncl -v
cmhaltnode -f -v plcdb21
cmhaltnode -f -v plcdb22
cmrunnode -v plcdb21
cmrunnode -v plcdb22 跑节点
cmviewcl
cmhaltcl-v-f
cmrunpkg PLCDB-PKG02
cmmodpkg -n tjweb2 -e pkgweb
pvcreate -f /dev/rdisk/disk
pvcreate -f /dev/rdisk/disk
ll /dev/*/group
mkdir /dev/vgarch1
mkdir /dev/vgarch2
mknod /dev/vgarch1/group c 128 0x030000
mknod /dev/vgarch2/group c 128 0x040000
vgcreate -V 2.0 -s 32 -S 2t /dev/vgarch1 /dev/disk/disk39
vgcreate -V 2.0 -s 32 -S 1t /dev/vgarch2 /dev/disk/disk
lvcreate -n lvarch1 -L 102400 /dev/vgarch1
lvcreate -n lvarch2 -L 102400 /dev/vgarch1
newfs -F vxfs -o largefiles /dev/vgarch1/rlvarch1
newfs -F vxfs -o largefiles /dev/vgarch2/rlvarch2
mkdir /oracle
mount /dev/vgarch1/lvarch1 /oracle
mount /dev/vgarch1/lvarch2 /oracle
转载于:https://blog.51cto.com/penguin2012/1213775