VxVM基本应用.docx
《VxVM基本应用.docx》由会员分享,可在线阅读,更多相关《VxVM基本应用.docx(13页珍藏版)》请在冰豆网上搜索。
VxVM基本应用
VXVM的使用
一.安装VXVM
在solaris系统中解压VRTS_SF_HA_Solutions_5.1_Solaris_x64.tar.gz
命令:
tarzxvfVRTS_SF_HA_Solutions_5.1_Solaris_x64.tar.gz
bash-3.2#cddvd2-sol_x64/
bash-3.2#cdvolume_manager/
bash-3.2#ls
EULA_VVR_Ux_5.1.pdfcopyrightdocsinstallvmpkginfo.txttoolsuninstallvm
bash-3.2#./installvm
……………………..
在安装过程中要输入license
二.磁盘和磁盘组
_vxdiskadm——这是“VolumeManager支持操作”菜单界面。
此命令提供磁盘操
作菜单。
主菜单中的每一项通过向您提供信息和提示,帮助您完成特定的任务。
它为
很多问题提供默认应答,因此您可以很容易地选择常用应答。
_vxdiskadd——此命令用于向VolumeManager添加标准磁盘。
vxdiskadd通过显
示信息和提示,帮助您完成初始化新磁盘的过程。
_vxdisk——此命令管理受VxVM控制的磁盘。
vxdisk定义特殊磁盘设备,初始化
存储在磁盘上的信息(VolumeManager用此信息标识和管理磁盘),并执行其它的
特殊操作。
_vxdg——此命令在磁盘组上操作。
vxdg创建新磁盘组并管理现有的磁盘组。
1.初始化磁盘
bash-3.2#vxdiskinitdisk_0
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdisk--online
disk_1auto:
none--onlineinvalid
disk_2auto:
none--onlineinvalid
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
2.创建磁盘组(DG)
bash-3.2#vxdginitdatadgdatadg01=disk_0
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdiskdatadg01datadgonline
disk_1auto:
none--onlineinvalid
disk_2auto:
none--onlineinvalid
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
必须先用(vxdiskinitdisk_1)初始化磁盘,才能将磁盘添加到创建的磁盘组中(vxdginitdatadgdatadg01=disk_0),否则报一下错误。
bash-3.2#vxdginitdata2dgdatadg02=disk_1
VxVMvxdgERRORV-5-1-6478Devicedisk_1cannotbeaddedtoaCDSdiskgroup
3.交互式初始化磁盘并创建(或加入)磁盘组
bash-3.2#vxdiskadddisk_1
Addorinitializedisks
Menu:
VolumeManager/Disk/AddDisks
Hereisthediskselected.Outputformat:
[Device_Name]
disk_1
Continueoperation?
[y,n,q,?
](default:
y)y
Youcanchoosetoaddthisdisktoanexistingdiskgroup,a
newdiskgroup,orleavethediskavailableforusebyfuture
addorreplacementoperations.Tocreateanewdiskgroup,
selectadiskgroupnamethatdoesnotyetexist.Toleave
thediskavailableforfutureuse,specifyadiskgroupname
of"none".
Whichdiskgroup[,none,list,q,?
](default:
none)list
NAMESTATEID
datadgenabled,cds1422090775.11.teamsun
Whichdiskgroup[,none,list,q,?
](default:
none)datadg//可以加入已有的磁盘组,也可以创建新的磁盘组
Useadefaultdisknameforthedisk?
[y,n,q,?
](default:
y)y
Adddiskasasparediskfordatadg?
[y,n,q,?
](default:
n)n
Excludediskfromhot-relocationuse?
[y,n,q,?
](default:
n)n
Addsitetagtodisk?
[y,n,q,?
](default:
n)n
Theselecteddiskswillbeaddedtothediskgroupdatadgwith
defaultdisknames.
disk_1
Continuewithoperation?
[y,n,q,?
](default:
y)y
Initializingdevicedisk_1.
Enterdesiredprivateregionlength
[,q,?
](default:
65536)
VxVMNOTICEV-5-2-88
Addingdiskdevicedisk_1todiskgroupdatadgwithdisk
namedatadg02.
Goodbye.
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdiskdatadg01datadgonline
disk_1auto:
cdsdiskdatadg02datadgonline
disk_2auto:
none--onlineinvalid
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
也可以使用vxdiskadm中的菜单指示完成初始化
4.添加磁盘到磁盘组
bash-3.2#vxdiskinitdisk_2
bash-3.2#vxdg-gdatadgadddiskdatadg03=disk_2
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdiskdatadg01datadgonline
disk_1auto:
cdsdiskdatadg02datadgonline
disk_2auto:
cdsdiskdatadg03datadgonline
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
5.从磁盘组删除磁盘
A.直接删除
bash-3.2#vxdg-gdatadgrmdiskdatadg02
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdiskdatadg01datadgonline
disk_1auto:
cdsdisk--online
disk_2auto:
cdsdisk--online
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
B.vxdiskadm操作
bash-3.2#vxdiskadm
VolumeManagerSupportOperations
Menu:
VolumeManager/Disk
1Addorinitializeoneormoredisks
2Encapsulateoneormoredisks
3Removeadisk
4Removeadiskforreplacement
5Replaceafailedorremoveddisk
6Mirrorvolumesonadisk
7Movevolumesfromadisk
8Enableaccessto(import)adiskgroup
9Removeaccessto(deport)adiskgroup
10Enable(online)adiskdevice
11Disable(offline)adiskdevice
12Markadiskasaspareforadiskgroup
13Turnoffthespareflagonadisk
14Unrelocatesubdisksbacktoadisk
15Excludeadiskfromhot-relocationuse
16Makeadiskavailableforhot-relocationuse
17Preventmultipathing/SuppressdevicesfromVxVM'sview
18Allowmultipathing/UnsuppressdevicesfromVxVM'sview
19Listcurrentlysuppressed/non-multipatheddevices
20Changethedisknamingscheme
21Getthenewlyconnected/zoneddisksinVxVMview
22Change/Displaythedefaultdisklayouts
listListdiskinformation
?
Displayhelpaboutmenu
?
?
Displayhelpaboutthemenuingsystem
qExitfrommenus
Selectanoperationtoperform:
3
Removeadisk
Menu:
VolumeManager/Disk/RemoveDisk
Usethisoperationtoremoveadiskfromadiskgroup.This
operationtakes,asinput,adiskname.Thisisthesamename
thatyougavetothediskwhenyouaddedthedisktothedisk
group.
Enterdiskname[,list,q,?
]list
Diskgroup:
datadg
DMNAMEDEVICETYPEPRIVLENPUBLENSTATE
dmdatadg01disk_0auto6553610403584-
dmdatadg02disk_1auto655364112128-
dmdatadg03disk_2auto655366213376-
Enterdiskname[,list,q,?
]datadg03
VxVMNOTICEV-5-2-284Requestedoperationistoremovediskdatadg03fromgroupdatadg.
Continuewithoperation?
[y,n,q,?
](default:
y)y
VxVMINFOV-5-2-268Removalofdiskdatadg03iscomplete.
Removeanotherdisk?
[y,n,q,?
](default:
n)n
三.Vxmake创建卷
1.创建条带化卷
A.创建VMDisk(dm):
Vx控制下的磁盘被称为VMDisk
bash-3.2#vxdisklist
DEVICETYPEDISKGROUPSTATUS
c0d0s2auto:
none--onlineinvalid
disk_0auto:
cdsdiskdatadg01datadgonline
disk_1auto:
cdsdiskdatadg02datadgonline
disk_2auto:
cdsdisk--online
disk_3auto:
none--onlineinvalid
disk_4auto:
none--onlineinvalid
B.在VMDisk上面创建SubDisk(sd):
在两个磁盘上创建大小为1g的subdisk
bash-3.2#vxmake-gdatadgsddatadg01-01datadg01,0g,1g
-g-----------------------磁盘组的名称
Sd------------------------subdisk的名称
C.在SubDisk(sd)上创建plex(pl):
bash-3.2#vxmake-gdatadgplexvol-raid0-stripelayout=stripencolumn=2stwidth=32ksd=datadg01-01,datadg02-01
-g-----------------------磁盘组的名称
Layout-------------------RAID类型
Ncolumn---------------------磁盘的‘列’数,几块盘
Stwidth-----------------------------存放数据的宽度
Sd-----------------------------------------subdisk的个数
D.用plex组建vol并激活卷
bash-3.2#vxmake-gdatadg-Ufsgenvolvol01-raid0plex=vol-raid0-stripe
-g--------------磁盘组名称
-U-----------------
Vol-----------------卷名称
Plex-----------------组建卷的plex名称
E.激活所创建的条带卷
bash-3.2#vxvol-gdatadgstartvol01-raid0
F.创建文件系统
bash-3.2#newfs/dev/vx/rdsk/datadg/vol01-raid0
G.挂载所创建的条带卷
四.Vxassist创建卷
在数据同步过程中plex状态为TEMP,同步完成后会变为ACTIVE
1.创建简单卷
bash-3.2#vxassist-gdatadgmakesimplevol1g
-u---------------”-U”指定了两种类型的用法:
gen或fsgen。
”gen”是指rawvolume(裸设备卷-字符设备);”fsgen”是指regularvolume(字符设备和块设备)。
-g----------------磁盘组
2.移除简单卷
bash-3.2#vxassist-gdatadgremovevolumesimplevol
volume----------要移除的卷名称
3.创建条带卷
bash-3.2#vxassist-gdatadg-Ufsgenmakestripevol1glayout=stripe
layout----------------指定raid类型
4.创建镜像卷
bash-3.2#vxassist-ufsgen-gdatadgmakemirrorvol3800mlayout=mirror-concat
layout----------------可以选择mirror-concatmirror-stripestripe-mirror,一般默认制作的镜像卷应该是mirror-concat
ncolumns-------------(subDisk的个数)
stwidth---------指定条带读写大小(如果涉及到条带,要加此参数)
nmirror--------指定镜像个数
5.创建raid5卷
至少需要3个vmdisk创建RAID5volume(4个更好)。
其中,3个subdisk用来构建volume本身,1个subdisk会被自动创建为RAID5日志plex。
RAID5日志用于volumemetadata(元数据)和parity(校验位)的日志。