LINUX ISCSI Target 服务器搭建与windows 客户端连接.docx
1.inuxISCSI服务器搭建与客户机ISeSl连接ISCSI简介:iSCSI技术是一种由IBM公司探讨开发的,是一个供硬件设法运用的可以在IP协议的上层运行的SCSI指令集,这种指令集合可以实现在IP网络上运行SCSI协议,使其能州在诸如高速千兆以太网上进行路由选择.iSCSI技术是一种新谛存技术.该技术是将现有SCSl接口与以太网络任thernet)技术结合,使服务器可与运用IP用络的储存袋置相互交换资料,网络拓扑;CentOS6.3ISCSIServerTargetIP:192,168.2.54CentOS6.3Tindovsserver2012ISCSIInitiatorISCSIInitatorIP:192.168.2.55IP:192,168.2.230试验环境:ISCSIInitator:windowISCSITarget的搭建:1.iISCSItarget服务器上添加一块新的硬盘JfjT-ISCSITarget存谛.IrooteiSCSITargetDesktop#fdisklDiskdevsda:l.7GB,173741824bytes255heads,63sectorstrackr13G5cylindersUnits=cylindersof1665512=822528bytesSectorsize(IogicaVphysical):512bytes/512bytesI/Osize(RiiniMaZoptiMl):512bytes/512bytesDiskidentifier:x9c2d6DeviceBootStartEndBlocksIdSysteadevsdal164512808831.inuxPartition1doesnotendoncylinderboundary.devsda264138699727368e1.inux1.VMBkdevsdb:8589Mr8589934592bytes55heads,63SeCtorS/track,144cylindersnitscylindersof1665512822528。bytesectorsize(IogicaVphysical):512bytes/512bytes/0size(niniBiMi/optiBdl):512bytes/512bytesiskidentifier:创建1.VM.在此详细操作略掉.操作结果如下图:分别为liu×iscsiinitator.Windowsserver2012创建逻为卷IvlinuxIvwindowsr大小都为2GB的容量。(rootISCSITargetDesktop*root0ISCSITargetDesktop#pvcreatedevsdbWritingphysicalvolumedatatodisk-devsdb-PhysicalVOlUeedevsdbsuccessfullycreatedrootISCSITargetDesktop#vgcreate-s32NvgldevsdbVolumegroupvgl"successfullycreatedroot0ISCSITargetDesktop#Ivcreate-1.2648H-nIvUnuxvgl1.ogicalvolume-lvlinuxcreatedrootISCSITargetDesktop#Ivcreate-1.248M1windowsvgllogicalvolume-Ivwindows-createdroot0ISCSITargetDesktop#logicalvolnc1.VPathdevvgllvUxVGHjm1.VUUIDIVWriteAccess1.VCreationhost,tineIVStatus*open1.VSizeCurrentIBSegmentsAllocationReadaheadsectorscurrentlysettoBlockdeviceVgld4d01.jXWA0-u0Zf6FbQfHIAPlC2-t2ElRreadwriteISCSITarget,213-M-211:34:47÷M8eavailablee2.OGlB641inheritauto25253:2I1.VPathI1.VXjtcdevvgllvwindows"ndosI1.VUUID1.VWriteAccess1.VCreationhost,tife1.VStatus,open1.VSizeCurrent1.ESegmentsAUocetlonReadaheadsectorscurrentlysettoBlockdevicep3aC6-Bkv2cAGnsw2Ss5kl00juWWETVreadwflteISCSITarget,2ei3M6211:35:624MWavailablee2.66GiB641inheritauto2S6253:3在CentOS上安装iscs"arg式,在这里我采纳YUM的安装方式,“.4*V”«y*««(rootfIS<S11argetDwktcpJfElistIgrtvscslIMSlUltlatorUtlU.xM64.2.8V62xi<>-initiator-uH-develxMM.2.911-2.fUIsscsl.86M.2>2.el6ZxS产Mjgi<0din9lrrorpt«efroc(ZdtmtfileSettleupInstallProcesstetolvi1190pMFl>MrUngtrar4tlc<1ce<k>Pj<h*9eKSl-Or9ettlls.MMeu.M3.<l64MillMUstaUtU>"MQ,1MC*e*Mency99)vtlUforpMe*l-tM9et*vtlU-l.24->.eU<.>tW*ro<essigZpeMwuy:t«rl(Cenfig:General>forpKU;e»«1targetutil*1.e.24J.el4,«MM->XRrdmy:UU4bk.%0.1(NM*(Ml.)IMbk(f*pf:%Cti-t4r9*t-utiUi.0243.14.1M64KocdMHkMrKyUMfcveOs.W.1(IB,WBS1.DIWMtIt“a"se:sc51-UrQet-utlB-l.eN3.l4.mMM»rr0ctMi9C*«Mtncy:UMbWf.M.nier4RMl.)IMbi(fr(U(*)e:SCSl-Ur*tutiU-l.e.243.¼4.xMM!>,0<<Min9C*epeMencyso.HI(Mtilt)Urpck*esol-Uet-vt&b-l924).H4.M4*ro<<Ml9KeyMeuy:UUMm.M.l<>(64K)forc*ack>Qe:s«itrpetutXU1.243.eU4.UM>Kmr>l119tr411%ticnck<k->PM*WIlbltwerviXWM!l.l.-5,elwlUXIwtalled*P4c9eUbfdMOB.aMM。:l.6.l,.glt3乂<*.l6willbeinstalled>P<c>eerl-Cn*lfe*rat,09r<h9:2M-EeUwlUXIStaIlE>PJC*jes3utlU.>8W觥l.X4.el6VnlteIwtaUeil>fiaihdOrdn<yRr%lvt4.修改ISCSlTARGET的配置文件,配置文件为etctgttargets.conf,运用VimI:具修改配置文件:分别为Iinux客户端和windowsserver2012客户端it立两个target<Iinuxtargetwindowstarget),将两个target关联到之前创建的IV上,并且配置.用户名和密码认证(用户名和密码都为test),同时限制只有相应IP地址的客户端才能访问iscsitarget.如图:IroOtISCSITargetDesktop#vimetctgttargets.conf添加target:VtargetIqnAinux.targets*backing-storedevvgllvlinuxIncoraingusertesttestl23456789initiator-address192.168.2.55<target><targetiqn.windows.targets>backing-storedevvgllvlinuxinitiator-address192.168.2.23incomingusertesttestl23456789<target>5 .启动iscsitarget服务root0ISCSITargetDesktop#etcinit.dtgtdstartStartingSCSItargetdaemon:OKroot0ISCSITargetDesktop#6 .配置iscistarget,H务零开机启动:rootISCSITargetDesktop#Chkconfigtgtdonroot0ISCSITargetDesktop#7 .查?i"当前iscistarget的运行状态:IrOOt1SCSITarqetDeSktop#ITOTSffSystemno11natonDriver:iscsiState:readyITnexusinformation:1.UNinformation:1.UN:0Type:controllerSCSIID:IET1OSCSISN:beafl8Size:MB,Blocksize:1Online:YesRemovablemedia:NoPreventremoval:NoReadonly:NoBackingstoretype:nullBackingstorepath:NoneBackingstoreflags:Type:diskSCSIID:IET1O1SCSISN:beafllSize:2147mb.Blocksize:512Online:YesRemovablemedia:NoPreventremoval:NoReadonly:NoBackingstoretype:rdwrBackingstorepath:devvgl八VIinUXOeehiR99>ReHms:Accountinformation:testAC1.information:192.168.2.55SysteniInTonnationTDriver:iscsi到此ISCSl己充汽完成,并旦可以查看到当前target的状态是正常的二.ISCSIInitiator连接I