linux网络存储服务器iscsi详细介绍.doc_第1页
linux网络存储服务器iscsi详细介绍.doc_第2页
linux网络存储服务器iscsi详细介绍.doc_第3页
linux网络存储服务器iscsi详细介绍.doc_第4页
linux网络存储服务器iscsi详细介绍.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

一,概述SCSI最初是一种专门为小型计算机系统设计的I/O技术,但由于其架构和协议自身的优点,后被广泛应用于实现DAS以及SAN的底层技术。SCSI的定义:SCSI: Small Computer System InterfaceSCSI是一种I/O技术SCSI规范了一种并行的I/O总线和相关的协议SCSI的数据传输是以块的方式进行的SCSI的特点:设备无关性多设备并行高带宽低系统开销SCSI总线:SCSI总线是SCSI设备之间传输数据的通路SCSI总线又被称作SCSI通道SCSI终结器:SCSI终结器位于SCSI总线的末端,用来减小相互影响的信号,维持SCSI链上的电压恒定SCSI链的最后一个SCSI设备需要使用终结器SCSI链上的中间设备是不需要使用终结器的SCSI控制器:SCSI总线通过SCSI控制器来和硬盘之类的设备进行通信SCSI控制器逻辑上可分为一个任务管理单元和多个逻辑单元(LU)SCSI ID:一个独立的SCSI总线按照规格不同可以支持8或16个SCSI设备,设备的编号需要通过SCSI ID来进行控制,系统中每个SCSI设备都必须有自己唯一的SCSI ID,SCSI ID实际上就是这些设备的地址,窄SCSI总线最多允许8个、宽SCSI总线最多允许16个不同的SCSI设备和它进行连接。LUN:LUN(Logical Unit Number,逻辑单元号)是为了使用和描述更多设备及对象而引进的一个方法,每个SCSI ID上最多有32个LUN,一个LUN对应一个逻辑设备。SCSI连接示意图:二,linux下ISCSI的实现:ISCSI 是基于TCP/IP传输封装的SCSI数据包的块级别的共享,其也为C/S架构模型,服务器端提供客户端所需要的存储设备,客户端只需要进行挂载就可以将其当作自己主机上的存储设备进行分区、格式话使用。实现ISCSI需要的2个角色:iSCSI target(server)存储资源所在的iSCSI服务器被称为“target”。iSCSI target通常是一个硬盘存储设备。当前大部分的主流操作系统都提供了配合iSCSI target使用的客户端软件initiator。iSCSI initiator(client)initiator就是iSCSI传输的服务端。典型的initiator都有共同的目的,就是作为一个SCSI总线的适配器,代替物理上的SCSI设备(类似硬盘或者磁带)。iSCSI initiator通过IP网络传输SCSI命令。实验环境15 CentOS6.4 x86_64 target server16 CentOS 6.4 x86_64 initiator client17 CentOS 6.4 x86_64 initiator client首先在target server上安装scsi-target-utilsroottgtd # yum -y install scsi-target-utilsroottgtd # cp /etc/tgt/targets.conf /etc/tgt/targets.conf.bak编辑target配置文件,定义targetroottgtd # vi /etc/tgt/targets.conf# 添加如下内容 backing-store /dev/sdb initiator-address /24 incominguser luojianlong mypassroottgtd # service tgtd restartbacking-store:指定后端要共享的磁盘编号initiator-address:授权客户端访问的网络地址incominguser:设置登录用户的账号密码启动target并查看roottgtd # tgtadm -L iscsi -m target -o showTarget 1: .luojianlong:target1 System information: Driver: iscsi State: ready I_T nexus information: LUN information: LUN: 0 Type: controller SCSI ID: IET 00010000 SCSI SN: beaf10 Size: 0 MB, Block size: 1 Online: Yes Removable media: No Prevent removal: No Readonly: No Backing store type: null Backing store path: None Backing store flags: LUN: 1 Type: disk SCSI ID: IET 00010001 SCSI SN: beaf11 Size: 2048 MB, Block size: 512 Online: Yes Removable media: No Prevent removal: No Readonly: No Backing store type: rdwr Backing store path: /dev/sdb Backing store flags: Account information: luojianlong ACL information: /24看到新生成的target 1,和自动创建的LUN 1,以及创建的用户认证信息登录客户端,安装scsi-initiator-utilsrootlocalhost # yum -y install iscsi-initiator-utils修改客户端配置文件:rootlocalhost # vi /etc/iscsi/iscsid.conf# 启用如下几项node.session.auth.authmethod = CHAPnode.session.auth.username = luojianlongnode.session.auth.password = mypassrootlocalhost # service iscsid restart客户端使用iscsiadm工具发现设备rootlocalhost # iscsiadm -m discovery -t st -p 1919:3260,1 .luojianlong:target1rootlocalhost # iscsiadm -m node -T .luojianlong:target1 -p 19:3260 -lLogging in to iface: default, target: .luojianlong:target1, portal: 19,3260 (multiple)Login to iface: default, target: .luojianlong:target1, portal: 19,3260 successful.iscsiadm的命令汇总:发现iscsi存储:iscsiadm -m discovery -t st -p ISCSI_IP查看iscsi发现记录: iscsiadm -m node删除iscsi发现记录 iscsiadm -m node -o delete -T LUN_NAME -p ISCSI_IP登录iscsi存储 iscsiadm -m node -T LUN_NAME -p ISCSI_IP -l登出iscsi存储 iscsiadm -m node -T LUN_NAME -p ISCSI_IP -u删除此前登录生成的数据:rm -rf /var/lib/iscsi/node/*rm -rf -rf /var/lib/iscsi/send_targets/*测试设备是否可用rootlocalhost # fdisk -l /dev/sda-zDisk /dev/sda: 32.2 GB, 32212254720 bytes255 heads, 63 sectors/track, 3916 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x000b12a1 Device Boot Start End Blocks Id System/dev/sda1 * 1 64 512000 83 LinuxPartition 1 does not end on cylinder boundary./dev/sda2 64 3917 30944256 8e Linux LVMDisk /dev/sdb: 2147 MB, 2147483648 bytes67 heads, 62 sectors/track, 1009 cylindersUnits = cylinders of 4154 * 512 = 2126848 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000rootlocalhost # fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xd498549c.Changes will remain in memory only, until you decide to write them.After that, of course, the previous content wont be recoverable.Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)WARNING: DOS-compatible mode is deprecated. Its strongly recommended to switch off the mode (command c) and change display units to sectors (command u).Command (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4):Value out of range.Partition number (1-4): 1First cylinder (1-1009, default 1):Using default value 1Last cylinder, +cylinders or +sizeK,M,G (1-1009, default 1009): +1GCommand (m for help): pDisk /dev/sdb: 2147 MB, 2147483648 bytes67 heads, 62 sectors/track, 1009 cylindersUnits = cylinders of 4154 * 512 = 2126848 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0xd498549c Device Boot Start End Blocks Id System/dev/sdb1 1 506 1050931 83 LinuxCommand (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.rootlocalhost # mke2fs -t ext4 /dev/sdb1mke2fs 1.41.12 (17-May-2010)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks65808 inodes, 262732 blocks13136 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=2726297609 block groups32768 blocks per group, 32768 fragments per group7312 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376Writing inode tables: done Creating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 36 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.rootlocalhost # mount

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论