HPUX 专区 High Availability MC/ServiceGuard Installation
High Availability MC/ServiceGuard InstallationContents
1 MC/ServiceGuard Installation
2 MC/ServiceGuard Configuration
2.1 Basic System Configuration
2.2 Cluster Configuration
2.3 Sample Package and Service Configuration
3 MC/ServiceGuard Installation Acceptance Test
3.1 MC/ServiceGuard Package/Service Failure Scenarios
Appendix A Sample cluster configuration file - /etc/cmcluster/cluster.cfg
Appendix B Sample package configuration file - /etc/cmcluster/spkg/spkg.cfg
Appendix C Sample package control file - /etc/cmcluster/spkg/spkg.ctl (configuration portion)
Appendix D Sample service script file - /etc/cmcluster/spkg/sscript
Appendix E Sample cluster configuration diagram
Appendix F MC/ServiceGuard Quick Reference
Reference Documentation
a MC/ServiceGuard Version A.10.06 Release Notes (B3936-90009)
b Managing MC/ServiceGuard (B3936-90005)1 MC/ServiceGuard Installation
MC/ServiceGuard Cluster configuration is based on two nodes machines (namely primary and standby), single LAN connection (data and heartbeat signals), single shared SCSI bus, one shared SCSI data disk as lock disk.Appendix E shows sample MC/ServiceGuard configuration diagram.
Full Installation on MC/ServiceGuard, including cluster and package manager.
command swinstall on node primary and node standby
2 MC/ServiceGuard Configuration
2.1 Basic System Configuration
i Update hosts table (on primary and standby)
Edit file /etc/hosts to include all configured network inte**ces of all hosts
ii Setup trusted system (on primary and standby)
Edit file /.rhosts with examples:
primary root
standby root
iii Configure shared volume groups and logical volumes
On primary, create shared volume group(s) and export map file
primary# mkdir /dev/vgshare
primary# mknod /dev/vgshare/group c 64 0x090000
* choose unused minor number eg 0x090000 as necessary
primay# pvcreate -f /dev/rdsk/cXtYd0
* Lock disk controller number X and SCSI address Y
primary# vgcreate /dev/vgshare /dev/dsk/cXtYd0
primary# lvcreate -l 100 /dev/vgshare
primary# newfs -F vxfs /dev/vgshare/rlvol1
primary# mkdir /shared
primary# mount /dev/vgshare/lvol1 /shared
primary# bdf
* checkpoint for filesystem mounting
primary# umount /shared
primary# vgchange -a n /dev/vgshare
primary# vgexport -p -v -s -m /tmp/vgshare.map /dev/vgshare
primary# rcp /tmp/vgshare.map standby:/tmp/vgshare.map
On standby, import shared volume group(s)
standby# mkdir /dev/vgshare
standby# mknod /dev/vgshare/group c 64 0x090000
* choose unused minor number eg 0x090000 as necessary
standby# vgimport -s -v -m /tmp/vgshare.map /dev/vgshare /dev/dsk/cXtYd0
* Lock disk controller number X and SCSI address Y
** may be different from the ones in primary
standby# vgchange -a y /dev/vgshare
standby# mkdir /shared
standby# mount /dev/vgshare/lvol1 /shared
standby# bdf # checkpoint
standby# vgcfgbackup /dev/vgshare
standby# umount /shared
standby# vgchange -a n /dev/vgshare
On both primary and standby, activate local volume group(s) only
Edit file /etc/lvmrc
a. AUTO_VG_ACTIVATE=1 change to AUTO_VG_ACTIVATE=0
b. under function custom_vg_activation, add local VGs
/sbin/vgchange -a y -s /dev/vg00 # all local VGs
On primary, get ready for MC/ServiceGuard configuration
primary# vgchange -a y /dev/vgshare
2.2 Cluster Configuration
All time intervals, parameters are set as MC/ServiceGuard default. Please notice that the configuration is for functional test purpose only, not a HP supported configuration.
i Query existing hardware & system configuration (on primary)
primary# cd /etc/cmcluster
primary# cmquerycl -v -C /etc/cmcluster/cluster.cfg -n primary -n standby
ii Modify cluster configuration, check and apply (on primary)
primary# vi /etc/cmcluster/cluster.cfg
* refer to appendix A for sample cluster configuration file
primary# cmcheckconf -v -C /etc/cmcluster/cluster.cfg
primary# cmapplyconf -v -C /etc/cmcluster/cluster.cfg
iii Startup cluster (on primary)
primary# cmruncl -v
primary# cmviewcl -v # check point, cluster status is up
iv Auto Startup (on both primary and standby)
primary/standby# vi /etc/rc.config.d/cmcluster
AUTOSTART_CMCLD=0 changed to AUTOSTART_CMCLD=1
2.3 Sample Package and Service Configuration
A sample package (spkg) is configured with single service (ssvr).The service is designed to run a sample service script (sscript, refer to appendix D) which is able to display current time and
hostname on console device every ten seconds.
i Configure package (on primary)
primary# mkdir /etc/cmcluster/spkg
primary# cmmakepkg -p /etc/cmcluster/spkg/spkg.cfg
primary# cmmakepkg -s /etc/cmcluster/spkg/spkg.ctl
primary# chmod 755 /etc/cmcluster/spkg/spkg.ctl
ii Modify package configuration (on primary)
primary# vi /etc/cmcluster/spkg/spkg.cfg
* refer to appendix B for sample package configuration file
primary# vi /etc/cmcluster/spkg/spkg.ctl
* refer to appendix C for sample package control file
iii Duplicate configuration and control files to other sites (on primary)
primary# cd /etc/cmcluster
primary# tar cvf - * | remsh standby '(cd /etc/cmcluster; tar xvpf -)'
primary# cmhaltcl -fv
primary# cmcheckconf -v -C /etc/cmcluster/cluster.cfg -P
/etc/cmcluster/spkg/spkg.cfg
primary# cmapplyconf -v -C /etc/cmcluster/cluster.cfg -P
/etc/cmcluster/spkg/spkg.cfg
iv Startup cluster (on either primary or standby)
primary/standby# cmruncl -v
primary/standby# cmviewcl -v # check point
3 MC/ServiceGuard Installation Acceptance Test
3.1 MC/ServieGuard Package/Service Failure Scenarios
By killing service script, service and causing package fail.The package will be restarted at standby node.
i Startup MC/SG cluster and nodes (on either primary or standby)
primary/standby# cmruncl -v
ii Startup standard package and service on primary
automatically start with cluster, or
primary# cmrunpkg -v
iii Verify cluster, nodes, package and services status on primary
primary# cmviewcl -v
* make sure package auto-switch flag is enable.
iv Terminate service manually on primary
eg by killing process sscript
v Verify cluster, nodes, package and services status on standby
standby# cmviewcl -v
vi Transfer package from standby back to primary manually by shutting down on standby and restarting package on primary
standby# cmhaltpkg -v spkg
standby# cmmodpkg -e -n primary spkg
standby# cmrunpkg -v -n primary spkg
standby# cmmodpkg -e spkgAppendix A Sample cluster configuration file - /etc/cmcluster/cluster.cfg
CLUSTER_NAME sample# fill-in cluster name
FIRST_CLUSTER_LOCK_VG/dev/vgshare # auto-detected lock VG
# change if necessary
NODE_NAME primary# auto-detected hostname
NETWORK_INTE**CElan0 # auto-detected LAN inte**ce
HEARTBEAT_IP 192.9.28.1# auto-detected IP address
FIRST_CLUSTER_LOCK_PV/dev/dsk/cXtYd0 # auto-detected lock PV
# change if necessary
NODE_NAME standby
NETWORK_INTE**CElan0
HEARTBEAT_IP 192.9.28.2
FIRST_CLUSTER_LOCK_PV/dev/dsk/cXtYd0
HEARTBEAT_INTERVAL1000000# default timing parameters
NODE_TIMEOUT 2000000
AUTO_START_TIMEOUT600000000
NETWORK_POLLING_INTERVAL 2000000
VOLUME_GROUP /dev/vgshare # auto-detected shared VG
# change if necessary
Appendix B Sample package configuration file - /etc/cmcluster/spkg/spkg.cfg
PACKAGE_NAME spkg # fill-in package name
NODE_NAME primary# fill-in primary hostname
NODE_NAME standby# fill-in standby hostname
RUN_SCRIPT /etc/cmcluster/spkg/spkg.ctl
# fill-in package start
# control script name
RUN_SCRIPT_TIMEOUTNO_TIMEOUT# default timing parameter
HALT_SCRIPT /etc/cmcluster/spkg/spkg.ctl
# fill-in package start
# control script name
HALT_SCRIPT_TIMEOUTNO_TIMEOUT# default timing parameter
SERVICE_NAME ssvr # fill-in service name
SERVICE_FAIL_FAST_ENABLED NO # default parameter
SERVICE_HALT_TIMEOUT300 # default timing parameter
SUBNET 192.9.28.0# fill-in subnetwork address
PKG_SWITCHING_ENABLEDYES # default parameter
NET_SWITCHING_ENABLEDYES # default parameter
NODE_FAIL_FAST_ENABLEDNO # default parameter
Appendix C Sample package control file - /etc/cmcluster/spkg/spkg.ctl (configuration portion)
PATH=/sbin:/usr/bin:/usr/sbin:/etc:/bin# default search path
VGCHANGE="vgchange -a e" # default exclusive VG option
VG=/dev/vgshare # fill-in shared Volume Group
LV="/dev/vgshare/lvol1"; FS="/shared" # fill-in LV and mount point
IP=192.9.28.3 # fill-in relocateable IP
SUBNET=192.9.28.0 # fill-in subnetwork address
SERVICE_NAME=ssvr # fill-in service name
SERVICE_CMD=/etc/cmcluster/spkg/sscript # fill-in service script name
SERVICE_RESTART="" # default parameter
Appendix D Sample service script file - /etc/cmcluster/spkg/sscript
#!/usr/bin/ksh
trap "exit " 15
while true
do
echo "`uname -n` `date`" | tee -a /shared/sscript.log > /dev/console
sleep 10
哥 以我们当前的知识水平还不能理解你这么深奥的知识!给点注释吧哥! 这种系统现在都是银行使用得多
页:
[1]