请教iSCSI的target端多用户同时访问的问题
目前 ,我在Linux端建立了一个 target software (用的open-source的iSCSI Enterprise Target) ,我在Linux上挂了两块硬盘, 一个是系统盘, 另外一个 data盘被shared 了(全是ntfs格式的)
我用两台PC (WindowsXP)做测试 , 当都用Microsoft Initiator 2.03 连接这个target成功后, 并分别 auto-mount Linux端shared那个盘后, 当两台PC同时要在mounted的盘上创建目录的时候, 我发现 ,当时两台PC是都成功的创建目录了。 但是 当他们 umount的时候, 再重新连接的时候, 发现只有一个 用户的创建的目录还在 ,另外一个用户创建的目录丢失了。
我对iSCSI也不是太熟悉 。
下面是我参加国外论坛一个人回的:
[align=left][font=Courier New][size=2][color=#0000ff]iSCSI really is just the handling of data blocks to and from the hard disk. Think of it as an extension of the hard disk that goes across the wire.[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=#0000ff][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=#0000ff]If you have multiple servers connected to a volume it is exactly like having a shared SCSI bus between multiple hosts. There is nothing in the SCSI controllers to prevent you from corrupting your shared volumes. This kind of control needs to come from the operating system. The OS needs to know the volume is shared and either a special file-system or special handling needs to take place. I don't know of a shared file-system in Windows, but Microsoft Cluster Services allow one server at a time access to a shared volume using SCSI Reserve/Release.[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=#0000ff][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=#0000ff]iSCSI must follow the SCSI protocol and the only function available to aid in shared access is SCSI RESERVE/RELEASE, which is a form of mutex.[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=#0000ff][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=#0000ff]-Ross[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=black][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=black]看他的意思, SCSI 是无能为力的, 它本身控制不了并发访问,必须由OS来控制[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=black][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=black]请问由别人做过的吗? 我需要额外 加上软件吗?还是要购买跟SAN有关的卡 或者设备什么的呢?[/color][/size][/font][/align][align=left][font=Courier New][size=2][color=#0000ff][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=#0000ff]谢谢我的mail是 [email=bob_zhang2004@163.com]bob_zhang2004@163.com[/email] [/color][/size][/font][/align][align=left][font=Courier New][size=2][color=#0000ff][/color][/size][/font] [/align][align=left][font=Courier New][size=2][color=#0000ff]kernelChina.cublog.cn 欢迎讨论。 谢谢了。 [/color][/size][/font][/align]
2007-2-2 13:17 冬瓜头
这位老外说得没错。
多os共享卷,要么ha,要么clusterfs。
2007-2-2 15:39 bob_zhang2004
回复 #2 冬瓜头 的帖子
如果 我想实现多个initiator 同时访问 同一个target device , 我是不是只需要安装 GFS 就可以了呢? 因为我也搜索了GFS 的东西, 好像要用 Redhat AS 4 ,利用rpm命令装好多个软件包, 因为我是把它移植到arm上的, flash 就 12M啊 。
另外 , GFS 的概念 是和 ntfs ,或者 ext3 同一级别的概念吗?
如果linux端用GFS 的话, 那我的Initiator 又是 WindowsXP ‘s MS Initiator 我怎么mount 呢?
我看windows 端也有一个 叫 cluser service的什么咚咚, 可以和 GFS 兼容吗?
下面我们mailing list的进一步讨论:
> -----Original Message-----
> From: Bob Zhang [mailto:bob_zhang2004@163.com]
> Sent: Thursday, February 01, 2007 11:51 PM
> To: Ross S. W. Walker
> Cc: Scott Kaelin; [email=blackmagic02881@gmail.com][color=#0000ff]blackmagic02881@gmail.com[/color][/email];
> [email=iscsitarget-devel@lists.sourceforge.net][color=#0000ff]iscsitarget-devel@lists.sourceforge.net[/color][/email]
> Subject: RE: [Iscsitarget-devel] about mutex between
> multi-users to write a same target disk ? for example ,
> multi-users write a same directory of /dev/hdb1 at the same time
>
>
>
> >
> > iSCSI really is just the handling of data blocks to and from the
> > hard disk. Think of it as an extension of the hard disk that goes
> > across the wire.
> >
> > If you have multiple servers connected to a volume it is exactly
> > like having a shared SCSI bus between multiple hosts. There is
> > nothing in the SCSI controllers to prevent you from corrupting your
> > shared volumes. This kind of control needs to come from the
> > operating system. The OS needs to know the volume is shared and
> > either a special file-system or special handling needs to take
> > place. I don't know of a shared file-system in Windows, but
> > Microsoft Cluster Services allow one server at a time access to a
> > shared volume using SCSI Reserve/Release.
>
> First ,thanks very much for your replying !
> As far as you know , maybe can I buy a card or Adapter to
> solve the mutex issue ?
> These two days , I am browsing some productions related with
> SAN which looks that no this problem .
> Do you know how SAN solve this problem ? software or hardware ?
>
> Another , during developing IET ,how are you testing this case ?
> only single-user accessing a same target disk device ?
An iSCSI HBA follows the same iSCSI protocol standards as MS Initiator,
it just does it faster with lower CPU overhead.
> >
> > iSCSI must follow the SCSI protocol and the only function available
> > to aid in shared access is SCSI RESERVE/RELEASE, which is a form of
> > mutex.
> >
> > -Ross
> Excuse me ,i am really a newbie for SCSI , can you tell me
> some detailed infomation ? How can I modify the Linux Kernel
> ? currently ,is there some open-source to implement it ? or
> some related document or URL ?
>
You must use a service that allows multi-user access to a shared disk.
Think of it as a disk and you will have a better picture. The iSCSI
volume you connect to is a disk drive for all intensive purposes and
what would happen if you connect one disk drive to two computers and try
to use it from both machines at the same time? Well if you have ever
tried it you would see you would get a corrupt file-system. Same thing
goes for iSCSI.
Now there exists software packages here and there that will allow you to
use a shared disk drive from multiple systems at the same time. You need
to research what those software packages are and find one that fits your
needs best.
-Ross
[[i] 本帖最后由 bob_zhang2004 于 2007-2-2 15:42 编辑 [/i]]
2007-2-2 16:27 冬瓜头
gfs是可以,但是好像没有windows版,想让windows和unix共享卷,我看只能用nfs了。
gfs其后端实际的fs可以是ext2、3等等,gfs大致等于=nfs+优化的cluster实现。
mount gfs和mount nfs差不多。
2007-2-2 18:19 bob_zhang2004
回复 #2 冬瓜头 的帖子
>> 多os共享卷,要么ha,要么clusterfs。
你所说的 ha是什么意思? 另外windows 下面有 cluster file system 吗?
我只要事先把 一个磁盘 format成 Windows版本的cluster file system ,然后再插到Linux上shared ,你看这样行吗?
2007-2-4 20:58 chinakkee
小弟,强烈推荐用OCFS,这样两台windows可以同时访问共享卷。算我开玩笑了:lol:
2007-2-5 11:11 wings_song
回复 #1 bob_zhang2004 的帖子
使用BWFS,这是一款clusterfs
2007-2-12 16:08 baisb
stornext