The goal of
this workshop, is to add new FS under existing Service Group
Let say we
will create mount Point /app/test1
Current Status of the Cluster :
[root@lab1
Desktop]# hastatus -summ
--
SYSTEM STATE
--
System State Frozen
A lab1 RUNNING 0
A lab2 RUNNING 0
A lab3 RUNNING 0
--
GROUP STATE
--
Group System Probed AutoDisabled State
B app_sg lab1 Y N ONLINE
B app_sg lab2 Y N ONLINE
B app_sg lab3 Y N ONLINE
B cvm lab1 Y N ONLINE
B cvm lab2 Y N ONLINE
B cvm
lab3 Y N ONLINE
Currently Mounted FS:
[root@lab1
Desktop]# df -Ph
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_lab1-lv_root 18G
6.7G 9.8G 41% /
tmpfs 1.5G 76K
1.5G 1% /dev/shm
/dev/sda1 485M 40M
421M 9% /boot
/dev/sr0 3.6G 3.6G
0 100% /media/RHEL_6.5 x86_64 Disc 1
/dev/vx/dsk/appdg/appvol01 100M
7.2M 88M 8% /app/test
[root@lab1
Desktop]# vxdg list
NAME STATE ID
appdg enabled,shared,cds 1469017360.12.lab2.localdomain
[root@lab1
Desktop]# vxdisk -oalldgs list
DEVICE TYPE DISK GROUP STATUS
disk_2 auto:cdsdisk - - online
disk_3 auto:cdsdisk appdg02
appdg online shared
disk_4 auto:cdsdisk -
- online
disk_5 auto:cdsdisk -
- online
disk_6 auto:cdsdisk - - online
disk_7 auto:cdsdisk appdg01
appdg online shared
disk_8 auto:cdsdisk -
- online
sda auto:LVM - - online invalid
Checking the Master Node:
[root@lab1
Desktop]# vxdctl -c mode
mode:
enabled: cluster active - MASTER
master:
lab1
Now we
create a new volume appvol02, and we’ll use this volume to create a filesystem
VxFS.
Then, we’ll
try to mount it on /app/test just to check that everything is all right.
·
In
order to mount a VxFS filesystem at the same time on more systems, use the [-o cluster] option, as
below
[root@lab1
Desktop]# vxassist -g appdg make appvol02 100m layout=mirror
[root@lab1
Desktop]# vxprint -qthg appdg -v appvol02
v appvol02
- ENABLED ACTIVE
204800 SELECT -
fsgen
pl
appvol02-01 appvol2 ENABLED
ACTIVE 204800 CONCAT
- RW
sd
appdg02-02 appvol2-01 appdg02
204800 204800 0
disk_3 ENA
pl
appvol02-02 appvol2 ENABLED
ACTIVE 204800 CONCAT
- RW
sd
appdg01-02 appvol2-02 appdg01
204800 204800 0
disk_7 ENA
[root@lab1
Desktop]# mkfs -t vxfs /dev/vx/dsk/appdg/appvol02
version 10 layout
204800 sectors, 102400 blocks of size 1024,
log size 1024 blocks
rcq size 1024 blocks
largefiles supported
maxlink supported
[root@lab1
~]# mkdir -p /app/test1/
[root@lab2
~]# mkdir -p /app/test1/
[root@lab3
~]# mkdir -p /app/test1/
[root@lab1
/]# mount -t vxfs -o cluster /dev/vx/dsk/appdg/appvol2 /app/test1/
[root@lab1
/]# df -Ph /app/test1/
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
5.2M 89M 6% /app/test1
[root@lab2
~]# mount -t vxfs -o cluster /dev/vx/dsk/appdg/appvol2 /app/test1/
[root@lab2
~]# df -Ph /app/test1/
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
7.2M 88M 8% /app/test1
[root@lab3
~]# mount -t vxfs -o cluster /dev/vx/dsk/appdg/appvol2 /app/test1/
[root@lab3
~]# df -Ph /app/test1/
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
3.2M 91M 4% /app/test1
[root@lab1
~]# umount /app/test1
[root@lab2
~]# umount /app/test1
[root@lab3
~]# umount /app/test1
Now that we
have configured the volume manager part, we’ll configure the VCS cluster in
order to control the import of the diskgroup and the mount of the filesystem.
We create a
new service group (app_sg) with two resources:
·
Res
Name: cvmvoldg1 - Resource Type: CVMVolDg
·
Res
Name: cfsmount1 - Resource Type: CFSMount
[root@lab1
/]# cfsmntadm add appdg appvol02 /app/test1 app_sg all=cluster,rw
Mount Point is being added...
/app/test1 added to the cluster-configuration
Or the above command also be executed as below:
[root@lab3
~]# cfsmntadm add appdg appvol02
/app/test1 app_sg lab1=rw lab2=rw lab3=rw
Mount Point is being added...
/app/test1 added to the cluster-configuration
[root@lab1
/]# hastatus -summ
--
SYSTEM STATE
--
System State Frozen
A lab1 RUNNING 0
A lab2 RUNNING 0
A lab3 RUNNING 0
--
GROUP STATE
--
Group System Probed AutoDisabled State
B app_sg lab1 Y N PARTIAL
B app_sg lab2 Y N PARTIAL
B app_sg lab3 Y N PARTIAL
B cvm lab1 Y N ONLINE
B cvm lab2 Y N ONLINE
B cvm lab3 Y N ONLINE
[root@lab1
~]# hares -display -group app_sg -attribute State
#Resource Attribute
System Value
cfsmount1 State lab1 OFFLINE
cfsmount1 State lab2 OFFLINE
cvmvoldg1 State lab1 ONLINE
cvmvoldg1 State lab2 ONLINE
OLD Mount poiint will remain mounted
[root@lab1
/]# df -Ph
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_lab1-lv_root 18G
6.7G 9.8G 41% /
tmpfs 1.5G 224K
1.5G 1% /dev/shm
/dev/sda1 485M 40M
421M 9% /boot
/dev/sr0 3.6G 3.6G
0 100% /media/RHEL_6.5 x86_64 Disc 1
/dev/vx/dsk/appdg/appvol01 100M
7.2M 88M 8% /app/test
[root@lab1
/]# hares -display -group app_sg -attribute State
#Resource Attribute System Value
cfsmount1 State lab1 ONLINE
cfsmount1 State lab2 ONLINE
cfsmount1 State lab3 ONLINE
cfsmount2 State lab1 OFFLINE
cfsmount2 State lab2 OFFLINE
cfsmount2 State lab3 OFFLINE
cvmvoldg1 State lab1 ONLINE
cvmvoldg1 State lab2 ONLINE
cvmvoldg1 State lab3 ONLINE
[root@lab1
/]# cfscluster status
Node :
lab1
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1
appvol02 appdg NOT MOUNTED
Node :
lab2
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1
appvol02 appdg NOT MOUNTED
Node :
lab3
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1
appvol02 appdg NOT MOUNTED
Now Mount the New Volume:
[root@lab1
/]# cfsmount /app/test1
Mounting...
[/dev/vx/dsk/appdg/appvol02] mounted
successfully at /app/test1 on lab1
[/dev/vx/dsk/appdg/appvol02] mounted
successfully at /app/test1 on lab2
[/dev/vx/dsk/appdg/appvol02] mounted
successfully at /app/test1 on lab3
[root@lab1
/]# hastatus -summ
--
SYSTEM STATE
--
System State Frozen
A lab1 RUNNING 0
A lab2 RUNNING 0
A lab3 RUNNING 0
--
GROUP STATE
--
Group System Probed
AutoDisabled State
B app_sg lab1 Y N ONLINE
B app_sg lab2 Y N ONLINE
B app_sg lab3 Y N ONLINE
B cvm lab1 Y N ONLINE
B cvm lab2 Y N ONLINE
B cvm lab3 Y N
ONLINE
[root@lab1
/]# hares -display -group app_sg -attribute State
#Resource Attribute System Value
cfsmount1 State lab1 ONLINE
cfsmount1 State lab2
ONLINE
cfsmount1 State lab3 ONLINE
cfsmount2 State lab1 ONLINE
cfsmount2 State lab2 ONLINE
cfsmount2 State lab3 ONLINE
cvmvoldg1 State lab1 ONLINE
cvmvoldg1 State lab2 ONLINE
cvmvoldg1 State lab3 ONLINE
[root@lab1
/]# df -Ph /app/test1
Filesystem Size
Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
7.2M 88M 8% /app/test1
[root@lab2
~]# df -Ph /app/test1
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
7.2M 88M 8% /app/test1
[root@lab3
~]# df -Ph /app/test1
Filesystem Size Used Avail Use% Mounted on
/dev/vx/dsk/appdg/appvol02 100M
7.2M 88M 8% /app/test1
We can run
also the following command in order to check the CFS is correctly online:
[root@lab1
/]# cfscluster status
Node :
lab1
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1
appvol02 appdg MOUNTED
Node :
lab2
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1
appvol02 appdg MOUNTED
Node :
lab3
Cluster Manager :
running
CVM state :
running
MOUNT POINT
SHARED VOLUME DISK GROUP STATUS
/app/test
appvol01 appdg MOUNTED
/app/test1 appvol02 appdg MOUNTED
Thank you for reading.
No comments:
Post a Comment