Wise people learn when they can; fools learn when they must - Arthur Wellesley

Sunday, 19 March 2017

VCS ON RHEL6–CONFIGURE & OPERATION-P2 (NFS VIA GUI)


VCS ON RHEL6–CONFIGURE & OPERATION-P2

SETTING UP NFS AS A VCS RESOURCE VIA GUI,

Check the disks,

[root@pr01 ~]# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       -            -            online invalid
sdb          auto:none       -            -            online invalid
sdc          auto:sliced     -            -            online
sdd          auto:none       -            -            online invalid
sde          auto            -            -            error
sdf          auto:none       -            -            online invalid

Setup a disk for NFS,

[root@pr01 ~]# vxdisksetup -i sdd format=sliced
[root@pr01 ~]# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       -            -            online invalid
sdb          auto:none       -            -            online invalid
sdc          auto:sliced     -            -            online
sdd          auto:sliced     -            -            online
sde          auto            -            -            error
sdf          auto:none       -            -            online invalid

Create DG,

[root@pr01 ~]# vxdg init nfs_dg nfs-disk01=sdd cds=off

Create Volume,

[root@pr01 ~]# vxassist -g nfs_dg maxsize
Maximum volume size: 20240384 (9883Mb)
[root@pr01 ~]# vxassist -g nfs_dg make nfs-vol 9883M

Create File system,

[root@pr01 ~]# mkfs -t vxfs /dev/vx/dsk/nfs_dg/nfs-vol
    version 9 layout
    20240384 sectors, 10120192 blocks of size 1024, log size 16384 blocks
    rcq size 1024 blocks
    largefiles supported

Mount Directory,

[root@pr01 ~]# mkdir /nfs-test
[root@pr01 ~]# mount -t vxfs /dev/vx/dsk/nfs_dg/nfs-vol /nfs-test
[root@pr01 ~]# df -kh
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2              13G  6.5G  5.4G  55% /
tmpfs                 497M     0  497M   0% /dev/shm
/dev/sda1             485M   37M  423M   8% /boot
.host:/               108G  104G  4.2G  97% /mnt/hgfs
/dev/vx/dsk/nfs_dg/nfs-vol
                      9.7G   21M  9.1G   1% /nfs-test
[root@pr01 ~]# umount /nfs-test

IF NFS IS NOT INSTALLED,

[root@pr01 ~]# yum install -y nfs*
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
localrepo                                                                     | 2.9 kB     00:00 ...
Setting up Install Process
Package nfs-utils-lib-1.1.5-6.el6.x86_64 already installed and latest version
Package nfs4-acl-tools-0.3.3-6.el6.x86_64 already installed and latest version
Package 1:nfs-utils-1.2.3-36.el6.x86_64 already installed and latest version
Nothing to do

We can find the sample configuration for “nfs-resource” at following location.

[root@pr01 sample_nfs]# pwd
/etc/VRTSvcs/conf/sample_nfs

NOW CREATE THE SERVICE GROUP VIA GUI,





















Ohhh... Something went wrong... BUT WHAT.......??

Lets find out.

[root@pr01 ~]# ls /dev/vx/dsk/nfs_dg/nfs-vol
ls: cannot access /dev/vx/dsk/nfs_dg/nfs-vol: No such file or directory

[root@pr01 ~]# vxdg list
NAME         STATE           ID
apps_dg      enabled              1488602380.15.pr01
[root@pr01 ~]# vxdg list nfs_dg
VxVM vxdg ERROR V-5-1-582 Disk group nfs_dg: No such disk group
[root@pr01 ~]# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       -            -            online invalid
sdb          auto:none       -            -            online invalid
sdc          auto:sliced     appsdg01     apps_dg      online
sdd          auto:sliced     -            (nfs_dg)     online
sde          auto            -            -            error
sdf          auto:none       -            -            online invalid


[root@dr01 config]# ls /dev/vx/dsk/nfs_dg/nfs-vol
/dev/vx/dsk/nfs_dg/nfs-vol

[root@dr01 config]# ls -l /dev/vx/dsk/nfs_dg/nfs-vol
ls: cannot access /dev/vx/dsk/nfs_dg/nfs-vol: No such file or directory

[root@dr01 config]# vxdg list nfs_dg
VxVM vxdg ERROR V-5-1-582 Disk group nfs_dg: No such disk group

[root@dr01 config]# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:sliced     -            (nfs_dg)     online
disk_1       auto:sliced     -            (apps_dg)    online
disk_2       auto            -            -            error
disk_3       auto:none       -            -            online invalid
sda          auto:none       -            -            online invalid
[root@dr01 config]#

Resource dependency tree should be like this,

IP > NIC
VOL > DG
MOUNT > VOL
SHARE > MOUNT
SHARE > NFS SERVICE
NFS restart > IP
NFS restart > SHARE


Problem was with dependency, resources were started in unmannered state.








[root@pr01 ~]# vxdisk -o alldgs list
DEVICE       TYPE            DISK         GROUP        STATUS
sda          auto:none       -            -            online invalid
sdb          auto:none       -            -            online invalid
sdc          auto:sliced     appsdg01     apps_dg      online
sdd          auto:sliced     nfs-disk01   nfs_dg       online
sde          auto            -            -            error
sdf          auto:none       -            -            online invalid

[root@pr01 ~]# vxdg list
NAME         STATE           ID
apps_dg      enabled              1488602380.15.pr01
nfs_dg       enabled              1488721312.27.pr01

[root@pr01 ~]# hastatus -sum

-- SYSTEM STATE
-- System               State                Frozen

A  dr01                 RUNNING              0
A  pr01                 RUNNING              0

-- GROUP STATE
-- Group           System               Probed     AutoDisabled    State

B  NFS_APP1        dr01                 Y          N               OFFLINE
B  NFS_APP1        pr01                 Y          N               ONLINE



No comments:

Post a Comment