How to do NFS on VCS using command line

This entry was posted in Storage, Unix and tagged on June 17, 2012, by

Consider the following scenario.

Servers: sparc1 sparc2

Storage : VXVM disk group, shared1

File system : /home

Public interface: hme0

IPaddress: 192.168.9.150

Group name:  NFS_group1

sparc1 is primary location to start the NFS_group1

1. First create the virtual IP

# ifconfig hme0:1 192.168.9.150 netmask 255.255.255.0 up

2. Create a disk group shared1

# vxdg init shared1 c1t80d0s2

# vxdg -g shared1 c1t81d0s2 c1t82d0s2 c1t83d0s2

# vxassist -g shared1 make code_vol 10g

# mkdir /home

3. Deport the disk group

# vxdg deport shared1

4. Now add the services and resources to the services

Add the service group

# haconf -makerw

# hagrp -add NFS_group1

# hagrp -modify NFS_group1 SystemList sparc1 0 sparc2 1

# hagrp -modify NFS_group1 AutoStartList sparc1 sparc2

Add the resources

# hares -add DG_shared DiskGroup NFS_group1

# hares -modify DG_shared DiskGroup shared1

# hares -add IP_nfs IP NFS_group1

# hares -modify IP_nfs Device hme0

# hares -modify IP_nfs Address “192.168.9.150”

# hares -modify IP_nfs Enabled 1

# hares -add Mount_sourcecode Mount NFS_group1

# hares -modify Mount_sourcecode MountPoint “/home”

# hares -modify Mount_sourcecode BlockDevice “/dev/vx/dsk/shared1  /code_vol”

# hares -modify Mount_sourcecode MountOpt rw

# hares -modify Mount_sourcecode FSType vxfs

# hares -modify Mount_sourcecode FsckOpt %-y

# hares -modify Mount_sourcecode Enabled 1

# hares -add share_sourcecode Share NFS_group1

# hares -modify share_sourcecode PathName “/home”

# hares -modify share_sourcecode Enabled 1

# hares -add NFS_group2_16 NFS NFS_group1

# hares -modify NFS_group2_16 Enabled 1

# hares -add NIC_group_hme0 NIC NFS_group1

# hares -modify NIC_group_hme0 Device hme0

# hares -modify NIC_group_hme0 NetworkType ether

# hares -modify NIC_group_hme0 Enabled 1

Create the dependencies

# hares -link IP_nfs share_sourcecode

# hares -link IP_nfs NIC_group_hme0

# hares -link Mount_sourcecode DG_shared

# hares -link share_sourcecode NFS_group2_16

# hares -link share_sourcecode Mount_sourcecode

Close the configuration and push the changes.

# haconf -dump -makero

5. Create the mount directroy on sparc2

# mkdir /home on sparc2

6. Enable the resources from sparc1

# haconf -makerw

Enable all the resoureces and bring the service group online

# hagrp -online NFS_group1 -sys sparc1

Check the status of the service , it should be online

# hastatus – summary

Switch the service group from one system to another

# hagrp -switch NFS_group1 to -sparc2

# hastatus – summary

You will see its online on sparc2

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright 2017 ©Aceadmins. All rights reserved.