1. 查看磁盘状态
bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none - - online invalid
c2t0d0s2 auto:cdsdisk c2t0d0 ocrvotedg online clone_disk shared
c2t1d0s2 auto:cdsdisk c2t1d0 orasysdg online clone_disk shared
c2t2d0s2 auto:cdsdisk c2t2d0 orasysdg online clone_disk shared
c2t3d0s2 auto:cdsdisk c2t3d0 ztdg online clone_disk shared
c2t4d0s2 auto:cdsdisk c2t4d0 oradatadg online clone_disk shared
c2t5d0s2 auto:cdsdisk c2t5d0 oradatadg online clone_disk shared
c2t6d0s2 auto:cdsdisk c2t6d0 oradatadg online clone_disk shared
c2t8d0s2 auto:cdsdisk c2t8d0 oradatadg online clone_disk shared
c2t9d0s2 auto:cdsdisk c2t9d0 oradatadg online clone_disk shared
c2t10d0s2 auto:cdsdisk c2t10d0 oradatadg online clone_disk shared
c3t0d0s2 auto:none - - online invalid
c3t1d0s2 auto:none - - online invalid
c3t2d0s2 auto:none - - online invalid
c3t3d0s2 auto:none - - online invalid
c3t4d0s2 auto:none - - online invalid
2. 初始化磁盘
bash-3.00# vxdisksetup -i c3t0d0
bash-3.00# vxdisksetup -i c3t2d0
bash-3.00# vxdisksetup -i c3t1d0
bash-3.00# vxdisk list
DEVICE TYPE DISK GROUP STATUS
c1t0d0s2 auto:none - - online invalid
c2t0d0s2 auto:cdsdisk c2t0d0 ocrvotedg online clone_disk shared
c2t1d0s2 auto:cdsdisk c2t1d0 orasysdg online clone_disk shared
c2t2d0s2 auto:cdsdisk c2t2d0 orasysdg online clone_disk shared
c2t3d0s2 auto:cdsdisk c2t3d0 ztdg online clone_disk shared
c2t4d0s2 auto:cdsdisk c2t4d0 oradatadg online clone_disk shared
c2t5d0s2 auto:cdsdisk c2t5d0 oradatadg online clone_disk shared
c2t6d0s2 auto:cdsdisk c2t6d0 oradatadg online clone_disk shared
c2t8d0s2 auto:cdsdisk c2t8d0 oradatadg online clone_disk shared
c2t9d0s2 auto:cdsdisk c2t9d0 oradatadg online clone_disk shared
c2t10d0s2 auto:cdsdisk c2t10d0 oradatadg online clone_disk shared
c3t0d0s2 auto:cdsdisk - - online
c3t1d0s2 auto:cdsdisk - - online
c3t2d0s2 auto:cdsdisk - - online
c3t3d0s2 auto:none - - online invalid
c3t4d0s2 auto:none - - online invalid
3. 看一下现有的磁盘组以及文件系统状态
bash-3.00# vxdg list
NAME STATE ID
ocrvotedg enabled,shared,cds 1334545530.14.sol1
oradatadg enabled,shared,cds 1334546231.20.sol1
orasysdg enabled,shared,cds 1334546065.16.sol1
ztdg enabled,shared,cds 1334546157.18.sol1
看一下磁盘组(oradatadg一共占用大概15gb,13gb分配给了各个卷集)
bash-3.00# vxprint -g oradatadg -uG
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
dg oradatadg oradatadg - - - - - -
dm c2t4d0 c2t4d0s2 - 9.96g - - - -
dm c2t5d0 c2t5d0s2 - 0.96g - - - -
dm c2t6d0 c2t6d0s2 - 0.96g - - - -
dm c2t8d0 c2t8d0s2 - 0.96g - - - -
dm c2t9d0 c2t9d0s2 - 0.96g - - - -
dm c2t10d0 c2t10d0s2 - 0.96g - - - -
vt rs_vset - ENABLED - - ACTIVE - -
v ydata_3 rs_vset ENABLED 3.00g - ACTIVE - -
pl ydata_3-01 ydata_3 ENABLED 3.00g - ACTIVE - -
sd c2t4d0-03 ydata_3-01 ENABLED 1.96g 0.00 - - -
sd c2t5d0-01 ydata_3-01 ENABLED 0.96g 1.96g - - -
sd c2t6d0-01 ydata_3-01 ENABLED 0.06g 2.93g - - -
v ydata_4 rs_vset ENABLED 2.00g - ACTIVE - -
pl ydata_4-01 ydata_4 ENABLED 2.00g - ACTIVE - -
sd c2t8d0-01 ydata_4-01 ENABLED 0.96g 0.00 - - -
sd c2t9d0-01 ydata_4-01 ENABLED 0.96g 0.96g - - -
sd c2t10d0-01 ydata_4-01 ENABLED 0.06g 1.93g - - -
vt vect_vset - ENABLED - - ACTIVE - -
v ydata_1 vect_vset ENABLED 4.00g - ACTIVE - -
pl ydata_1-01 ydata_1 ENABLED 4.00g - ACTIVE - -
sd c2t4d0-01 ydata_1-01 ENABLED 4.00g 0.00 - - -
v ydata_2 vect_vset ENABLED 4.00g - ACTIVE - -
pl ydata_2-01 ydata_2 ENABLED 4.00g - ACTIVE - -
sd c2t4d0-02 ydata_2-01 ENABLED 4.00g 0.00 - - -
bash-3.00# vxprint -g oradatadg -v -ug
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v ydata_1 vect_vset ENABLED 4.00g - ACTIVE - -
v ydata_2 vect_vset ENABLED 4.00g - ACTIVE - -
v ydata_3 rs_vset ENABLED 3.00g - ACTIVE - -
v ydata_4 rs_vset ENABLED 2.00g - ACTIVE - -
bash-3.00# vxdg -g oradatadg free
DISK DEVICE TAG OFFSET LENGTH FLAGS
c2t6d0 c2t6d0s2 c2t6d0 132464 1898768 -
c2t10d0 c2t10d0s2 c2t10d0 131840 1899392 -
数字大概能对上(除以2是因为这里的length是使用512字节为一个unit)
bash-3.00# vxdg -g oradatadg free | grep -v OFFSET | awk -F" " '{print ($5-$4)/1024/1024/2}'
0.842239
0.842834
4. 我们向oradatadg中加入磁盘
bash-3.00# vxdg -g oradatadg adddisk c3t0d0
bash-3.00# vxdg -g oradatadg adddisk c3t1d0
bash-3.00# vxdg -g oradatadg adddisk c3t2d0
5. 拓展文件系统
先看一下文件系统
bash-3.00# cfscluster status
Node : sol1
Cluster Manager : running
CVM state : running
MOUNT POINT SHARED VOLUME DISK GROUP STATUS
/ysysdata ysys_vset orasysdg MOUNTED
/gwvec vect_vset oradatadg MOUNTED
/gwrs rs_vset oradatadg MOUNTED
/ocrvote ocrvotevol ocrvotedg MOUNTED
/ztapp ztvol_1 ztdg MOUNTED
/oralog redovol orasysdg MOUNTED
Node : sol2
Cluster Manager : running
CVM state : running
MOUNT POINT SHARED VOLUME DISK GROUP STATUS
/ysysdata ysys_vset orasysdg MOUNTED
/gwvec vect_vset oradatadg MOUNTED
/gwrs rs_vset oradatadg MOUNTED
/ocrvote ocrvotevol ocrvotedg MOUNTED
/ztapp ztvol_1 ztdg MOUNTED
/oralog redovol orasysdg MOUNTED
我们来拓展一下/gwrs这个文件系统
bash-3.00# df -h | grep gwrs
/dev/vx/dsk/oradatadg/rs_vset 5.0G 320M 4.4G 7% /gwrs
现在一共占用了5g
bash-3.00# vxprint -g oradatadg -v -ug
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v ydata_1 vect_vset ENABLED 4.00g - ACTIVE - -
v ydata_2 vect_vset ENABLED 4.00g - ACTIVE - -
v ydata_3 rs_vset ENABLED 3.00g - ACTIVE - -
v ydata_4 rs_vset ENABLED 2.00g - ACTIVE - -
bash-3.00# vxdg -g oradatadg free | grep -v OFFSET | awk -F" " '{a+=($5-$4)} END {print a/1024/1024/2"g"}'
4.59077g
一共还有大概4.6g的空余空间
以上我们可以看到,使用的是卷集来挂载集群文件系统。所以这个时候拓展文件系统的容量一共有两种方法。下面分别来介绍。
5.1 直接拓展卷集中的卷的容量
我们向ydata_3这个卷中增加500m的容量
bash-3.00# vxresize -g oradatadg ydata_3 +500m
bash-3.00# df -h | grep gwrs
/dev/vx/dsk/oradatadg/rs_vset 5.5G 320M 4.9G 7% /gwrs
简单吧,可以看到不需要其他命令,已经对文件系统生效了。
5.2 新增卷到卷集中
现在试一下第二种方法
新增一个卷
bash-3.00# vxassist -g oradatadg make ydata_5 500m
加入到卷集中
bash-3.00# vxvset -g oradatadg addvol rs_vset ydata_5
没有变化?
bash-3.00# df -h | grep gwrs
/dev/vx/dsk/oradatadg/rs_vset 5.5G 320M 4.9G 7% /gwrs
如果指定的大小大于卷的大小会报错
bash-3.00# fsvoladm add /gwrs ydata_5 600m
UX:vxfs fsvoladm: ERROR: V-3-25572: volume add failed on /gwrs, No such device or address (6)
bash-3.00# fsvoladm add /gwrs ydata_5 500m
ok 结束
bash-3.00# df -h | grep gwrs
/dev/vx/dsk/oradatadg/rs_vset 6.0G 320M 5.3G 6% /gwrs
标红的都是关键性语句