Make sure the diskgroup can be deported, and imported without errors.
# vxdg deport
# vxdg -t import
VERITAS Cluster Server logically groups together a set of Resources (such as Mount points, Applications, Oracle instances, etc) into Service Groups. Generally speaking, when one resource in a service group is no longer available, VCS will mark the resource as FAULTED, and migrate the entire service group to which it belongs to another node in the cluster. This is referred to as 'failover'. This document assumes that you have successfully completed the installation process, and that 'had' is currently running on your system, and that the command "/opt/VRTSvcs/bin/hastatus -summary" produces output similar to the following:
# /opt/VRTSvcs/bin/hastatus -summary
-- SYSTEM STATE
-- System State Frozen
A node1 RUNNING 0
A node2 RUNNING 0
The basic outline of creating a new service group is:
1. Create a list of related resources. For example, some typical resources are VXVM DiskGroups and Mount points.
2. Create a one-to-one map of the resources defined in step (1) with the Agents provided by VERITAS. For more information on Agents, see the VCS Bundled Agent Guide. Looking in the Bundled Agent Guide, we see that VCS comes with a DiskGroup agent, and a Mount agent.
3. In order to configure a service group, you must first make the configuration writeable and add it to the configuration. As always, when you add the group you should choose a meaningful name:
# haconf -makerw
# hagrp -add NEW_SG_NAME
VCS:10136:group added; populating SystemList and setting the Parallel attribute recommended before adding resources
4. Now you must, as the message says, populate the SystemList attribute (the Parallel attribute is beyond the scope of this document). The system list is the list of systems where it is possible for this service group to come online.
# hagrp -modify SystemList node1 0 node2 1
5. Configure the "AutoStartList" attribute - this is the system where this service group will automatically start at boot time:
# hagrp -modify AutoStartList
6. Once this is done, you may begin adding resources to the group. For more information on the types of resources available, and their individual requirements, refer to the VCS Bundled Agent Guide (or appropriate documentation that shipped with your agent). We will add a Disk Group and a Mount resource in this example. Again, be sure to choose meaningful names:
# hares -add MY_DG_RESOURCE DiskGroup
VCS:10245:Resource added
NameRule and Enabled attributes must be set before agent monitors
# hares -modify DiskGroup
# hares -add MY_MOUNTPOINT_RESOURCE Mount
# hares -modify BlockDevice
# hares -modify MountPoint
# hares -modify FsckOpt [%-y|%-n]
7. Once all of the resources have been added to the service group, VCS must be told in which order to bring them online. Otherwise, it will try to bring all resources on line simultaneously. The command 'hares -link res2 res1' will create a dependency such that "res1" MUST be online before VCS will attempt to start "res2":
# hares -link
8. Once all resources have been added, and all dependencies created, execute the following commands to enable all resources and write the configuration to disk:
# hagrp -enableresources
# haconf -dump -makero
9. Finally, to online your new service group, execute the command:
# hagrp -online -sys
On my test systems, I used the examples to run the following commands:
# hagrp -add MyMountGrp
VCS:10136:group added; populating SystemList and setting the Parallel attribute recommended before adding resources
# hagrp -modify MyMountGrp SystemList camcs12 0 camcs9 1
# hagrp -modify MyMountGrp AutoStartList camcs12
# hares -add MyDgResource DiskGroup MyMountGrp
VCS:10245:Resource added
NameRule and Enabled attributes must be set before agent monitors
# hares -modify MyDgResource DiskGroup vxvm_mydg
# hares -add MyMountResource Mount MyMountGrp
VCS:10245:Resource added
NameRule and Enabled attributes must be set before agent monitors
# hares -modify MyMountResource BlockDevice /dev/vx/dsk/vxvm_mydg/vol01
# hares -modify MyMountResource MountPoint /my/mount/point
# hares -modify MyMountResource FsckOpt %-y
# hares -link MyMountResource MyDgResource
# hagrp -enableresources MyMountGrp
# haconf -dump -makerw
# hagrp -online MyMountGrp -sys camcs12
# hastatus -sum
-- SYSTEM STATE
-- System State Frozen
A camcs12 RUNNING 0
A camcs9 RUNNING 0
-- GROUP STATE
-- Group System Probed AutoDisabled State
B MyMountGrp camcs12 Y N ONLINE
B MyMountGrp camcs9 Y N OFFLINE
Looking in the /etc/VRTSvcs/conf/config/main.cf file, we can see the new service group configuration has been added:
# cat /etc/VRTSvcs/conf/config/main.cf
include "types.cf"
cluster vcs01 (
)
system camcs12 (
)
system camcs9 (
)
group MyMountGrp (
SystemList = { camcs12 = 0, camcs9 = 1 }
AutoStartList = { camcs12 }
)
DiskGroup MyDgResource (
DiskGroup = vxvm_mydg
)
Mount MyMountResource (
MountPoint = "/my/mount/point"
BlockDevice = "/dev/vx/dsk/vxvm_mydg/vol01"
FsckOpt = "-y"
)
MyMountResource requires MyDgResource
No comments:
Post a Comment