svccfg -s nfs/server setprop "application/auto_enable=false"
svccfg -s nfs/mapid setprop "application/auto_enable=false"
svccfg -s nfs/nlockmgr setprop "application/auto_enable=false"
svccfg -s nfs/status setprop "application/auto_enable=false"
Now we are all set to play with VCS. I mean it's time to decide what all resources are required for this service group. In technical language - "Hierarchy of resources"
Keep NFSRestart at top, all other should be child of this resource.
it needs following 6 resources :-
1. NFSRestart
2. Share
3. DiskGroup
4. Mount
5. IP
6. NIC
Don't get scared how to handle these many resources, we already have divided in 3 sections.
We will take a bottom-up approach , it's not a rocket science, trust me. See, my approach is , if anything feels too tough or lengthy , just break it into peaces , and then assemble it at the end.
First thing that we can do is to make a service group with a familiar name , just in case we need to recall "nfssg".
#hagrp -add nfssg
#hagrp -modify nfssg SystemList sys1 0 sys2 1
#hagrp -modify nfssg AutoStartList sys1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now we have to make a mount resource which will mount one of the volume from this disk group to a mount point /test :
Now, when the mount point is available, our task is to make a share resource which will nfs share this mount point , /test.
You know what , we are done with resources and service group. Nothing mechanical stuff needed now. Only bit of logic and now you will use only 1000th part of your brain to how exactly we should link these resources.
Now resources : (BOTTOM - UP)
Start with the easiest one, i.e. NIC and IP resources :
Why this IP ? Because it is used to access NFS share from client. ( remember what we do at client, mount ip:/nfsshare /mnt , so this ip address will be used by client to access our share point)
#hares -add mnicb MultiNICB nfssg
#hares -modify mnicb Critical 0
#hares -modify mnicb Device e1000g0
#hares -modify mnicb Enabled 1
#hares add ipmnicb IPMultiNICB nfssg
#hares -modify ipmnicb Critical 0
#hares -modify ipmnicb Address 192.168.1.100
#hares -modify ipmnicb BaseResName mnicb
#hares -modify ipmnicb NetMask 255.255.255.0
#hares -modify ipmnicb Enabled 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now we need a mount point to be shared. This mount point will come from a disk group , as we are using VxVM. So make a DiskGroup resource and name it nfsdg. (Don't confuse with name nfssg)
#hares -add nfsdg DiskGroup nfssg
#hares -modify nfsdg Critical 0
#hares -modify nfsdg DiskGroup dg1
#hares -modify nfsdg Enabled 1
#hares -add nfsmount Mount nfssg
#hares -modify nfsmount Critical 0
#hares -modify nfsmount BlockDevice /dev/vx/dg1/dsk/vol1
#hares -modify nfsmount MountPoint /test
#hares -modify nfsmount MountOpt
#hares -modify nfsmount Enabled 1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#hares -add nfsshare Share nfssg
#hares -modify nfsshare Critical 0
#hares -modify nfsshare PathName /test
#hares -modify nfsshare Options %-y
#hares -modify nfsshare Enabled 1
The most important resource is NFRestart resource, it will restart nfs services whenever it is called by VCS. Usually whenever service group is brought online or offline, this resource is triggered. As it is most important, we will give highest priority to this resource and it will be our top resource in dependency hierarchy. First add it :
#hares -add nfsrestart NFSRestart nfssg
#hares -modify nfsrestart Critical 0
#hares -modify nfsrestart Enabled 1
As we know NFSRestart is most important , so make it grandfather, I mean keep it at the top of dependency tree : NFSRestart ->Share->Mount->DiskGroup and another one is IP->NIC , thats it. DONE. We will make 2 dependency tree not 1 because making 1 dependency tree will violate the rule of max 5 dependency in a tree.
#hares -link nfsrestart nfsshare
#hares -link nfsshare nfsmount
#hares -link nfsmount nfsdg
#hares -link ipmnicb mnicb
~~~~~~~~~~~~~DONE ...!!!~~~~~~~~~~~
#haconf -dump -makero
BRING THE SERVICE GROUP ONLINE :-
#hagrp -online nfssg -sys sys1
Clarity of facts :-
1. Here , we are working on NFS server and not on client. We are providing high availability to "nfs share".
2. On client, simply mount it by "mount" command. If you want to provide HA on this mount point as well, simple "Mount" type resource will work , with block device modified as "192.168.1.100:/test" .