iSCSI 技术,顾名思义,即internet SCSI,这样就比较容易理解和记忆,是IETF制订的一项标准,用于将SCSI数据块映射成以太网数据包。这样就可以使用iSCSI协议通过IP网络来传输SCSI数据块,使我们可以用以太网来构建IP存储局域网。通过网友的张图,可以更清晰的理解这种存储架构了

现在iscsi也有开源社区的支持,使我们可以利用软件的方式体验这种技术了
官方网站是:http://iscsitarget.sourceforge.net/
需要用到的软件iscsi-target包也需要在这里下载,貌似,连接已经实效,
大家用svn直接download源代码下来编译也是一样的。
官方要求linux系统内核版本必须是>=2.6.14,做试验就用Centos 5,RHEL5,FC8,FC9吧,这些系统内核都支持
解压,然后编译和安装
这里“两个端”要搞清楚一个是Target,存储设备端(理解为“服务器端”);一个是Initiator(理解为“客户端”)。
下面配置target端
编译/etc/ietd.conf文件
其他的不用看,就看这段
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz 这个每台机器都不一样,可以修改,简称主机Iqn,即iSCSI Qualified Name
Lun 0 Path=/dev/sdb,Type=fileio 这里设定存储设备和名称
设定完了 启动
设定开机自动启动
这样,我说的target端(“服务端") 就配置完了
客户端,如果是win,可以到这里去下载iSCSI Initiator支持软件
http://www.microsoft.com/WindowsServer2003/technologies/storage/iscsi/default.mspx
安装完了,设置一下就可以使用了
我这里主要是做一下linux做为Initiator端的使用方法,
这里假设target端IP为 192.168.0.30
先来查找
以上信息,表明找到
下面重启客户端
然后查看是否已经挂过来了
[root@localhost ~]# fdisk -l
这样客户端下就有target端共享出来的存储设备sdb了!
接下来是杀是剐就由你控制了,^_^^_^
现在iscsi也有开源社区的支持,使我们可以利用软件的方式体验这种技术了
官方网站是:http://iscsitarget.sourceforge.net/
需要用到的软件iscsi-target包也需要在这里下载,貌似,连接已经实效,
大家用svn直接download源代码下来编译也是一样的。
官方要求linux系统内核版本必须是>=2.6.14,做试验就用Centos 5,RHEL5,FC8,FC9吧,这些系统内核都支持
解压,然后编译和安装
Quotation
[root@localhost ~]# make
[root@localhost ~]# make install
[root@localhost ~]# make install
这里“两个端”要搞清楚一个是Target,存储设备端(理解为“服务器端”);一个是Initiator(理解为“客户端”)。
下面配置target端
编译/etc/ietd.conf文件
其他的不用看,就看这段
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz
# Users, who can access this target. The same rules as for discovery
# users apply here.
# Leave them alone if you don't want to use authentication.
#IncomingUser joe secret
#OutgoingUser jim 12charpasswd
# Logical Unit definition
# You must define one logical unit at least.
# Block devices, regular files, LVM, and RAID can be offered
# to the initiators as a block device.
Lun 0 Path=/dev/sdb,Type=fileio
# Alias name for this target
# Alias Test
# various iSCSI parameters
# (not all are used right now, see also iSCSI spec for details)
#MaxConnections 1
#InitialR2T Yes
#ImmediateData No
#MaxRecvDataSegmentLength 8192
# Users, who can access this target. The same rules as for discovery
# users apply here.
# Leave them alone if you don't want to use authentication.
#IncomingUser joe secret
#OutgoingUser jim 12charpasswd
# Logical Unit definition
# You must define one logical unit at least.
# Block devices, regular files, LVM, and RAID can be offered
# to the initiators as a block device.
Lun 0 Path=/dev/sdb,Type=fileio
# Alias name for this target
# Alias Test
# various iSCSI parameters
# (not all are used right now, see also iSCSI spec for details)
#MaxConnections 1
#InitialR2T Yes
#ImmediateData No
#MaxRecvDataSegmentLength 8192
Target iqn.2001-04.com.example:storage.disk2.sys1.xyz 这个每台机器都不一样,可以修改,简称主机Iqn,即iSCSI Qualified Name
Lun 0 Path=/dev/sdb,Type=fileio 这里设定存储设备和名称
设定完了 启动
Quotation
[root@localhost ~]# /etc/init.d/iscsi-target start
设定开机自动启动
Quotation
[root@localhost ~]# chkconfig iscsi-target on
这样,我说的target端(“服务端") 就配置完了
客户端,如果是win,可以到这里去下载iSCSI Initiator支持软件
http://www.microsoft.com/WindowsServer2003/technologies/storage/iscsi/default.mspx
安装完了,设置一下就可以使用了
我这里主要是做一下linux做为Initiator端的使用方法,
这里假设target端IP为 192.168.0.30
先来查找
Quotation
[root@localhost ~]# iscsiadm -m discovery --type sendtargets --portal 192.168.0.30
192.168.0.30:3260,1 iqn.2001-04.com.example:storage.disk2.sys1.xyz
192.168.0.30:3260,1 iqn.2001-04.com.example:storage.disk2.sys1.xyz
下面重启客户端
Quotation
[root@localhost ~]# service iscsi restart
Stopping iSCSI daemon: /etc/init.d/iscsi: line 33: 2436 Killed /etc/init.d/iscsid stop
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2001-04.com.example:storage.disk2.sys1.xyz, portal: 192.168.0.30,3260]
Login to [iface: default, target: iqn.2001-04.com.example:storage.disk2.sys1.xyz, portal: 192.168.0.30,3260]: successful
[ OK ]
iscsid dead but pid file exists
Turning off network shutdown. Starting iSCSI daemon: [ OK ]
[ OK ]
Setting up iSCSI targets: Logging in to [iface: default, target: iqn.2001-04.com.example:storage.disk2.sys1.xyz, portal: 192.168.0.30,3260]
Login to [iface: default, target: iqn.2001-04.com.example:storage.disk2.sys1.xyz, portal: 192.168.0.30,3260]: successful
[ OK ]
然后查看是否已经挂过来了
[root@localhost ~]# fdisk -l
Disk /dev/sdb: 2147 MB, 2147483648 bytes
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
67 heads, 62 sectors/track, 1009 cylinders
Units = cylinders of 4154 * 512 = 2126848 bytes
Disk identifier: 0x00000000
Disk /dev/sdb doesn't contain a valid partition table
这样客户端下就有target端共享出来的存储设备sdb了!
接下来是杀是剐就由你控制了,^_^^_^
相关日志
Linux最强渗透检测发行版BackTrack 4
GPT (GUID Partition Table)
让php支持oracle 10g 数据库
在Freebsd和Linux之间创建IP隧道
飞信机器人在系统监控上的应用
Linux最强渗透检测发行版BackTrack 4
GPT (GUID Partition Table)
让php支持oracle 10g 数据库
在Freebsd和Linux之间创建IP隧道
飞信机器人在系统监控上的应用
作者:askwan@『AskWan』
地址:http://www.askwan.com/post/75/
可以转载,转载时请以链接形式注明作者和原始出处及本声明!
强大的系统风险评估工具nessus
Zeus Web Server和Php的整合

2008/07/15 15:39 | by












iSCSI Cake与网络邻居共享有什么不同?网络邻居是文件级共享,iSCSI是裸设备级共享。网络邻居映射的盘不支持数据库和运行某些游戏,iSCSI支持所有磁盘操作和应用程序。而且iSCSI Cake的性能要高于网络邻居。