分类: 服务器与存储
2009-09-17 17:58:45
vxreattach, vxrecover及Vxtask
说到vxreattach命令,就不得不说detach状态,将阵列从主机上断开,这可以通过vxdmpadm disable ctlr或array来实现。
方法1) disable 阵列
racibm231# vxdmpadm listenclosure all
ENCLR_NAME ENCLR_TYPE ENCLR_SNO STATUS ARRAY_TYPE LUN_COUNT
===============================================================================
ams_wms0 AMS_WMS 75013813 CONNECTED A/A-A 18
disk Disk DISKS CONNECTED Disk 2
emc_clariion0 EMC_CLARiiON CK200072400921 CONNECTED CLR-A/PF 7
racibm231# vxdmpadm -f enable enclosure= emc_clariion0;
再用vxdmpadm listenclosure all就能看见ams_wms0 的status变为unconnected.
方法2)disable controller
racibm232# vxdmpadm listctlr
CTLR-NAME ENCLR-TYPE STATE ENCLR-NAME
=====================================================
scsi1 Disk ENABLED disk
fscsi0 AMS_WMS ENABLED ams_wms0
fscsi1 AMS_WMS ENABLED ams_wms0
fscsi0 EMC_CLARiiON ENABLED emc_clariion0
racibm232# vxdmpadm -f disable ctlr=fscsi0 ;
再用vxdmpadm listctlr就能看见ams_wms0 的status变为disabled.
此时用vxdisk vxdisk -o alldgs list来查看就能看见emc有2个盘变成detached的状态。
racibm231# date ; vxdisk -o alldgs list ; vxprint -p ; vxtask list
Thu Sep 17 14:19:52 BEIST 2009
DEVICE TYPE DISK GROUP STATUS
ams_wms0_7 auto:cdsdisk - (fendg_racibm231_234) online
ams_wms0_8 auto:cdsdisk - (fendg_racibm231_234) online
ams_wms0_9 auto:cdsdisk - - online
ams_wms0_10 auto:cdsdisk - - online
ams_wms0_11 auto:cdsdisk - - online
ams_wms0_12 auto:cdsdisk - - online
ams_wms0_13 auto:cdsdisk ams_wms0_13 ocrvote online shared
ams_wms0_14 auto:cdsdisk - - online
ams_wms0_15 auto:cdsdisk - - error
ams_wms0_16 auto:cdsdisk ams_wms0_16 oradatadg online shared
ams_wms0_17 auto:cdsdisk - - online
ams_wms0_18 auto:cdsdisk - - online
ams_wms0_19 auto:cdsdisk - - online
ams_wms0_20 auto:cdsdisk - - online
ams_wms0_21 auto:cdsdisk - - online
ams_wms0_22 auto:cdsdisk - - online
ams_wms0_23 auto:cdsdisk - - online
ams_wms0_43 auto:cdsdisk - - online
disk_0 auto:LVM - - LVM
disk_1 auto:LVM - - LVM
emc_clariion0_21 auto:cdsdisk - (ocrvote) online shared
emc_clariion0_32 auto:cdsdisk - - online
emc_clariion0_34 auto:cdsdisk - (oradatadg) online shared
emc_clariion0_60 auto:cdsdisk - (fendg_racibm231_234) online
emc_clariion0_61 auto:cdsdisk - - online
emc_clariion0_62 auto:cdsdisk - - online
emc_clariion0_63 auto:cdsdisk - - online
- - emc_clariion0_34 oradatadg detached was:emc_clariion0_34
- - emc_clariion0_21 ocrvote detached was:emc_clariion0_21
此时如果系统的后台有vxattachd 在运行的话,系统会自动帮你reattach,否则就要手动
Reattach. 直接用reattach命令去 reattach,没必要vxdg -g ocrvotedg reattachsite SFRAC2.
系统会自动帮你把disk加到相应的site里。
racibm231# ps -ef|grep atta
root 393412 1 0 14:12:15 - 0:00 /usr/bin/sh - /usr/lib/vxvm/bin/vxattachd root
root 925718 315618 0 14:21:27 pts/0 0:00 grep atta
做了些测试,遇到不能reattach成功(包括自动或手动),基本都是由于需要被 reattach的磁盘在某个节点不正常,常常是error的状态。正常能被reattach 的disk状态在vxdisk -o alldgs list输出应该是类似于下面的,每个disk有2行输出,一定要保证集群中每个节点的输出都是一致的。
emc_clariion0_21 auto:cdsdisk - (ocrvote) online shared
emc_clariion0_34 auto:cdsdisk - (oradatadg) online shared
- - emc_clariion0_21 ocrvote detached was:emc_clariion0_21
- - emc_clariion0_34 oradatadg detached was:emc_clariion0_34
是否有disk处于detached状态,从vxprint –p也能看出来。
racibm231# vxprint -p ; vxtask list
Disk group: oradatadg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
pl oradatavol-01 oradatavol ENABLED 20971520 - ACTIVE - -
pl oradatavol-02 oradatavol DETACHED 20971520 - STALE - -
pl oradatavol_dcl-01 oradatavol_dcl ENABLED 1712 - ACTIVE - -
pl oradatavol_dcl-02 oradatavol_dcl ENABLED 1712 - ACTIVE - -
vxrecover常用于mirror volume不一致时,系统对mirror plex进行mirror.
这个过程可以通过vxtask list来看出, 如果是cluster环境, 请在master上运行,即recover也和其他的修改配置操作一样,只在master上执行。 对比reattach,只能看见
racibm231# ps -ef|grep atta
root 393412 1 0 14:12:15 - 0:00 /usr/bin/sh - /usr/lib/vxvm/bin/vxattachd root
看不到reattach的进度,
Vxtask list可以很清楚直观地看到recover的进度
racibm231# vxtask list
TASKID PTID TYPE/STATE PCT PROGRESS
162 PARENT/R 0.00% 2/0(1) VXRECOVER
164 162 ATCOPY/R 01.68% 0/20971520/352256 PLXATT oradatavol oradatavol-02 oradatadg
Disk group: oradatadg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
pl oradatavol-01 oradatavol ENABLED 20971520 - ACTIVE - -
pl oradatavol-02 oradatavol ENABLED 20971520 - STALE ATT -
pl oradatavol_dcl-01 oradatavol_dcl ENABLED 1712 - ACTIVE - -
pl oradatavol_dcl-02 oradatavol_dcl ENABLED 1712 - ACTIVE - -
Disk group: ocrvote
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
pl ocrvotevol-01 ocrvotevol ENABLED 4194304 - ACTIVE - -
pl ocrvotevol-02 ocrvotevol ENABLED 4194304 - ACTIVE - -
pl ocrvotevol_dcl-01 ocrvotevol_dcl ENABLED 560 - ACTIVE - -
pl ocrvotevol_dcl-02 ocrvotevol_dcl ENABLED 560 - ACTIVE - -
racibm231# vxtask list
TASKID PTID TYPE/STATE PCT PROGRESS
196 PARENT/R 50.00% 2/1(1) VXRECOVER
198 196 ATCOPY/R 16.45% 0/20971520/3448832 PLXATT oradatavol oradatavol-02 oradatadg