在RHEL 5上安装并配置iSCSI Initiator软件文档格式.docx
- 文档编号:5227999
- 上传时间:2023-05-04
- 格式:DOCX
- 页数:16
- 大小:142.08KB
在RHEL 5上安装并配置iSCSI Initiator软件文档格式.docx
《在RHEL 5上安装并配置iSCSI Initiator软件文档格式.docx》由会员分享,可在线阅读,更多相关《在RHEL 5上安装并配置iSCSI Initiator软件文档格式.docx(16页珍藏版)》请在冰点文库上搜索。
用serviceiscsistart启动iSCSI服务。
root@pe03Server]#serviceiscsidstart
Turningoffnetworkshutdown.StartingiSCSIdaemon:
[OK]
[OK]
用serviceiscsistatus及serviceiscsidstatus查看iscsi相关服务的运行状态
[root@pe03Server]#serviceiscsistatus
iscsid(pid36973696)isrunning...
[root@pe03Server]#serviceiscsidstatus
4.执行target的发现
RHEL5上当前的iSCSIInitiator版本只支持sendtargets的发现方式,不支持SLP和iSNS
假设后端存储为IX5000,iSCSI业务IP地址为200.200.10.200,则使用下面的命令执行target的发现:
[root@pe03Server]#iscsiadm-mdiscovery-tsendtargets-p200.200.10.200:
3260
如果之前没有在IX5000上创建改initiator并分配卷,则这个命令执行成功后没有任何输出,但是此时到IX5000上会查看到有新的initiator生成。
在IX5000上把卷分配给initiator后再次执行target的发现:
iscsiadm:
unexpectedSendTargetsdata:
200.200.10.200:
3260,1iqn.2007-:
h3c:
200realm.rhel5
此时发现了一个新的target,target名称为iqn.2007-:
5.登录target
[root@pe03Server]#iscsiadm-mnode-Tiqn.2007-:
200realm.rhel5-p200.200.10.200:
3260-l
这里-T后面跟target名字,最后的l是L的小写,不是数字1
用iscsiadm-msession–i查看iscsisession信息
[root@pe03~]#iscsiadm-msession-i
iscsiadmversion2.0-742
************************************
Session(sid0)usingmoduletcp:
TargetName:
iqn.2007-:
PortalGroupTag:
1
NetworkPortal:
200.200.10.200:
iSCSIConnectionState:
LOGGEDIN
InternaliscsidSessionState:
NOCHANGE
************************
NegotiatediSCSIparams:
HeaderDigest:
None
DataDigest:
MaxRecvDataSegmentLength:
65536
MaxXmitDataSegmentLength:
FirstBurstLength:
MaxBurstLength:
262144
ImmediateData:
No
InitialR2T:
Yes
MaxOutstandingR2T:
AttachedSCSIdevices:
HostNumber:
3State:
running
scsi3Channel00Id0Lun:
0
AttachedscsidisksdbState:
6.对新发现的磁盘进行分区并创建文件系统
先用fdisk–l查看新的磁盘名称,这里我们发现了一个100GB的磁盘,设备名为/dev/sdb
[root@pe03Server]#fdisk-l
..............................
Disk/dev/sdb:
107.3GB,107373133824bytes
255heads,63sectors/track,13054cylinders
Units=cylindersof16065*512=8225280bytes
Disk/dev/sdbdoesn'
tcontainavalidpartitiontable
用fdisk/dev/sdb进行分区,本例中我们把整个磁盘分成一个主分区/dev/sdb1
[root@pe03Server]#fdisk/dev/sdb
DevicecontainsneitheravalidDOSpartitiontable,norSun,SGIorOSFdisklabel
BuildinganewDOSdisklabel.Changeswillremaininmemoryonly,
untilyoudecidetowritethem.Afterthat,ofcourse,theprevious
contentwon'
tberecoverable.
Thenumberofcylindersforthisdiskissetto13054.
Thereisnothingwrongwiththat,butthisislargerthan1024,
andcouldincertainsetupscauseproblemswith:
1)softwarethatrunsatboottime(e.g.,oldversionsofLILO)
2)bootingandpartitioningsoftwarefromotherOSs
(e.g.,DOSFDISK,OS/2FDISK)
Warning:
invalidflag0x0000ofpartitiontable4willbecorrectedbyw(rite)
Command(mforhelp):
n
Commandaction
eextended
pprimarypartition(1-4)
p
Partitionnumber(1-4):
Firstcylinder(1-13054,default1):
Usingdefaultvalue1
Lastcylinderor+sizeor+sizeMor+sizeK(1-13054,default13054):
Usingdefaultvalue13054
w
Thepartitiontablehasbeenaltered!
Callingioctl()tore-readpartitiontable.
Syncingdisks.
用mkfs命令在/dev/sdb1上创建ext3文件系统
[root@pe03Server]#mkfs-text3/dev/sdb1
mke2fs1.39(29-May-2006)
Filesystemlabel=
OStype:
Linux
Blocksize=4096(log=2)
Fragmentsize=4096(log=2)
13107200inodes,26214055blocks
1310702blocks(5.00%)reservedforthesuperuser
Firstdatablock=0
Maximumfilesystemblocks=0
800blockgroups
32768blockspergroup,32768fragmentspergroup
16384inodespergroup
Superblockbackupsstoredonblocks:
32768,98304,163840,229376,294912,819200,884736,1605632,2654208,
4096000,7962624,11239424,20480000,23887872
Writinginodetables:
done
Creatingjournal(32768blocks):
done
Writingsuperblocksandfilesystemaccountinginformation:
Thisfilesystemwillbeautomaticallycheckedevery35mountsor
180days,whichevercomesfirst.Usetune2fs-cor-itooverride.
用tune2fs修改文件系统的属性,去掉自动检查的属性:
[root@pe03Server]#tune2fs-c-1-i0/dev/sdb1
tune2fs1.39(29-May-2006)
Settingmaximalmountcountto-1
Settingintervalbetweenchecksto0seconds
7.设定文件系统的自动挂载
本例中我们将要把/dev/sdb1挂载到/data目录下
手动创建一个目录/data
[root@pe03Server]#mkdir/data
用tune2fs查找文件系统的UUID:
[root@pe03Server]#tune2fs-l/dev/sdb1
Filesystemvolumename:
<
none>
Lastmountedon:
notavailable>
FilesystemUUID:
3f0a00b7-4939-4ad2-a592-0821bb79f7c6
Filesystemmagicnumber:
0xEF53
Filesystemrevision#:
1(dynamic)
Filesystemfeatures:
has_journalresize_inodedir_indexfiletypesparse_superlarge_file
....................
用vi编辑/etc/fstab文件,设置自动挂载:
[root@pe03Server]#vi/etc/fstab
在/etc/fstab文件中增加下面蓝色的一行文字:
/dev/VolGroup00/LogVol00/ext3defaults11
LABEL=/boot/bootext3defaults12
devpts/dev/ptsdevptsgid=5,mode=62000
tmpfs/dev/shmtmpfsdefaults00
proc/procprocdefaults00
sysfs/syssysfsdefaults00
/dev/VolGroup00/LogVol01swapswapdefaults00
UUID=3f0a00b7-4939-4ad2-a592-0821bb79f7c6/dataext3_netdev00
注意,挂载的选项使用的是“_netdev”
用mount–a挂载文件系统
[root@pe03Server]#mount–a
用df查看文件系统已经挂载成功
[root@pe03/]#df-Th
FilesystemTypeSizeUsedAvailUse%Mountedon
/dev/mapper/VolGroup00-LogVol00
ext365G2.4G59G4%/
/dev/sda1ext399M12M82M13%/boot
tmpfstmpfs471M0471M0%/dev/shm
/dev/sdb1ext399G188M94G1%/data
8.重新启动系统并用df命令确认文件系统自动挂载成功。
附:
Open-iSCSImodules
README文件
1.InThisRelease
==================
ThisfiledescribestheLinux*Open-iSCSIInitiator.
1.1.Features
-highlyoptimizedandverysmall-footprintdatapath;
-persistentconfigurationdatabase;
-SendTargetsdiscovery;
-CHAP;
-PDUheaderDigest;
-multiplesessions;
Forthemostrecentlistoffeaturespleasereferto:
http:
//www.open-iscsi.org
2.Introduction
===============
Open-iSCSIprojectisahigh-performance,transportindependent,
multi-platformimplementationofRFC3720iSCSI.
Open-iSCSIispartitionedintouserandkernelparts.
ThekernelportionofOpen-iSCSIisafrom-scratchcodelicensedunderGPL.ThekernelpartimplementsiSCSIdatapath(thatis,iSCSIReadandiSCSIWrite),andconsistsofthreeloadablemodules:
scsi_transport_iscsi.ko,libiscsi.koandiscsi_tcp.ko.
Userspacecontainstheentirecontrolplane:
configurationmanager,iSCSIDiscovery,LoginandLogoutprocessing,connection-levelerrorprocessing,Nop-InandNop-Outhandling,and(inthefuture:
)Textprocessing,iSNS,SLP,Radius,etc.
TheuserspaceOpen-iSCSIconsistsofadaemonprocesscallediscsid,andamanagementutilityiscsiadm.
3.Installation
ToinstalltheiSCSItoolsrun:
rpm-ivhiscsi-initiator-utils-<
yourversion>
.rpm
Thiswillinstalliscsidandiscsiadmto/sbin.Itwillalsoinstall
defaultconfigfilesto/etc/iscsi:
/etc/iscsi/iscsid.conf-Allnewsessionwillinheritsettingsfrom
thisfilewhentheyarefirstdiscovered.Tooverrideavalueforaspecific
targetseetheiscsiadmopcommandbelowandintheiscsiadmmanpage.
SeeConfigurationsectionbelow.
/etc/iscsi/initiatorname.iscsi-Thedefaultinitaitornameforsoftware
iSCSIinitiator.
4.Open-iSCSIdaemon
====================
ThedaemonimplementscontrolpathofiSCSIprotocol,plussomemanagementfacilities.Forexample,thedaemoncouldbeconfiguredtoautomaticallyre-startdiscoveryatstartup,basedonthecontentsofpersistentiSCSIdatabase(seenextsection).
Forhelp,run:
./iscsid--help
Usage:
iscsid[OPTION]
-c,--config=[path]Executeintheconfigfile(/etc/iscsi/iscsid.conf).
-f,--foregroundruniscsidintheforeground
-d,--debugdebuglevelprintdebugginginformation
-u,--uid=uidrunasuid,defaultiscurrentuser
-g,--gid=gidrunasgid,defaultiscurrentusergroup
-h,--helpdisplaythishelpandexit
-v,--versiondisplayversionandexit
5.Open-iSCSIConfigurationUtility
===================================
Open-iSCSIpersistentconfigurationisimplementedasasetofiSCSIdatabasefiles.
-Discovery(/var/lib/iscsi/send_targets);
-Node(/var/lib/iscsi/nodes).
Theiscsiadmutilityisacommand-linetooltomanage(update,delete,insert,query)thepersistentdatabase.
TheutilitypresentsasetofoperationsthatausercanperformoniSCSInodes,sessions,connections,anddiscoveryrecords.
NotethatsomeoftheiSCSINodeandiSCSIDiscoveryoperationsdonotrequireiSCSIdaemon(iscsid)loaded.
./iscsiadm--help
iscsiadm[OPTION]
-m,--mode<
op>
specifyoperationalmodeop=<
discovery|node>
-mdiscovery--type=[type]--porta
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 在RHEL 5上安装并配置iSCSI Initiator软件 RHEL 安装 配置 iSCSI Initiator 软件
![提示](https://static.bingdoc.com/images/bang_tan.gif)