Tuesday, March 30, 2010

Sample Exercise to Create a High Availability Service Group in VCS:

Sample Process Script:
Copy and Save the below script under your mount point (Eg: /mohi/loopy)

#!/bin/ksh
 
# Loopy script for VCS class.
#############################
#
# $1 is Service Group name
# $0 is name of shell script being executed
#
 
while true
do
        echo `date` ${1} Loopy is alive  >> ${0}out
        sleep 4
        echo `date` ${1} Loopy is still alive  >> ${0}out
        sleep 4
done



Service Group Name: mohisg
Participating Nodes: sys11 and sys12

Resources:

Network Resources:
NIC Resource Name: mohinic
IP Resource Name: mohiip

Disk Resources:
DiskGroup Name: mohidg
Volume Name: mohivol
Mount Point: mohimount

Process Resource:
Process Name: mohiprocess


Creating Service Group.
+++++++++++++++++
# haconf -makerw
# hagrp -add mohisg
# hagrp -modify mohisg SystemList sys11 0 sys22 1
# hagrp -modify mohisg AutoStartList sls11
# hagrp -display mohisg
# haconf -dump
# view /etc/VRTSvcs/conf/config/main.cf


Adding a NIC resource to a service group
+++++++++++++++++++++++++++
# hares -add mohinic NIC mohisg
# hares -modify mohinic Critical 0
# hares -modify mohinic Device hme0
# hares -modify mohinic NetworkHosts 192.168.1.11
# hares -modify mohinic Enabled 1
# hares -state mohinic


Adding a IP resource
++++++++++++++++
# hares -add mohiip IP mohisg
# hares -modify mohiip Critical 0
# hares -modify mohiip Device hme0
# hares -modify mohiip Address 192.168.1.92
# hares -modify mohiip Address 192.168.1.93
# hares -modify mohiip Enabled 1
# hares -online mohiip -sys sls11
# hares -state mohiip
# hastatus -sum
# haconf -dump


Adding a DiskGroup resource
++++++++++++++++++++++
# hares -add mohidg DiskGroup mohisg
# hares -modify mohidg Critical 0
# hares -modify mohidg DiskGroup mohidg
# hares -modify mohidg mohidg Enabled 1
# hares -online mohidg -sys sls11
# hares -state mohidg
# vxdg list | grep mohidg
# haconf -dump
# view main.cf


Adding Volume resource
++++++++++++++++++
# hares -add mohivol Volume mohisg
# hares -modify mohivol Critical 0
# hares -modify mohivol Volume mohivol
# hares -modify mohivol DiskGroup mohidg
# hares -modify mohivol Enabled 1
# hares -display mohivol
# hares -online mohivol -sys sls11
# hares -state mohivol
# vxprint -g mohidg
# haconf -dump


Adding a MountPoint resource
+++++++++++++++++++++++
# hares -add mohimount mount mohisg
# hares -modify mohimount Critical 0
# hares -modify mohimount MountPoint /mohi
# hares -modify mohimount BlockDevice /dev/vx/dsk/mohidg/mohivol
# hares -modify mohimount FSType vxfs
# hares -modify mohimount FSCKopt %-y
# hares -modify mohimount Enabled 1
# hares -display mohimount
# hares -online mohimount -sys sls11
# hares -state mohimount
# haconf -dump
# view main.cf


Adding a Process Resource
++++++++++++++++++++
# hares -add mohiprocess Process mohisg
# hares -modify mohiprocess Critical 0
# hares -modify mohiprocess PathName /bin/sh
# hares -modify mohiprocess Arguments "/mohi/loopy mohisg"
# hares -modify mohiprocess Enabled 1
# hares -display mohiprocess
# hares -online mohiprocess -sys sls11
# hares -state mohiprocess

# ps -ef | grep loopy
# haconf -dump
# view main.cf


Linking Resources in the service group
+++++++++++++++++++++++++++++
# hares -link mohiip mohinic
# hares -link mohivol mohidg
# hares -link mohimount mohivol
# hares -link mohiprocess mohiip
# hares -link mohiprocess mohimount
# hares -dep | grep mohisg
# haconf -dump -makerw

Testing the Service Group
++++++++++++++++++++

#hastatus -sum
#hagrp -switch mohisg -to sys12
#hagrp -state mohisg
#hagrp -switch mohisg -to sys11
#hagrp -state mohisg

No comments:

Post a Comment