歡迎您光臨本站 註冊首頁

【iSCSI + GFS】多initiator併發訪問同一個target device的問題?

目前 ,我在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也不是太熟悉 。

下面是我參加國外論壇一個人回的:

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.


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

看他的意思, SCSI 是無能為力的, 它本身控制不了併發訪問,必須由OS來控制


請問由別人做過的嗎? 我需要額外 加上軟體嗎?還是要購買跟SAN有關的卡 或者設備什麼的呢?


謝謝我的mail是  bob_zhang2004@163.com


kernelChina.cublog.cn 歡迎討論。 謝謝了。

[ 本帖最後由 bob_zhang2004 於 2007-2-2 15:48 編輯 ]
《解決方案》

只需要GFS 就可以實現併發訪問了嗎?

原帖由 bob_zhang2004 於 2007-2-2 15:46 發表於 1樓  
目前 ,我在Linux端建立了一個 target software (用的open-source的iSCSI Enterprise Target) ,我在Linux上掛了兩塊硬碟, 一個是系統盤, 另外一個 data盤被shared 了(全是ntfs格式的)

我用兩台PC ( ...

如果 我想實現多個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
> Sent: Thursday, February 01, 2007 11:51 PM
> To: Ross S. W. Walker
> Cc: Scott Kaelin; blackmagic02881@gmail.com;
> iscsitarget-devel@lists.sourceforge.net
> Subject: RE: 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
《解決方案》

你這個需求,並不是要在target端去實現,而是要initiator端實現,所以你說的arm上面裝gfs沒有什麼意義。
《解決方案》

iSCSI 讓你可以訪問同一個存儲,不代表可以讓你在從不同節點上,併發創建和使用傳統文件系統. 這是最最基本的的集群系統的文件系統概念.

你所創建的文件系統,都是"活"在各自的節點上,這些節點雖然在物理上可以訪問你的iSCSI target, 但是可以訪問和可以創建文件系統且併發訪問是完全兩碼事.

這就是為什麼有了SAN但是當你需要多結點OS對shared storage上的同一個space做併發操作的時候,還是離不開clustered filesystem一樣.

建議你不要走得太快, 慢一點,解決文件系統的考慮先 !
《解決方案》

原帖由 nntp 於 2007-2-4 22:06 發表於 4樓  
iSCSI 讓你可以訪問同一個存儲,不代表可以讓你在從不同節點上,併發創建和使用傳統文件系統. 這是最最基本的的集群系統的文件系統概念.

你所創建的文件系統,都是"活"在各自的節點上,這些節點雖 ...
多謝您的指教,我一直在做NAS , 對SAN的東西不是太熟悉 。 所以可能問的有些問題有點傻 ,^_^。  
總的來說 ,我們group是要實現這個簡單的功能:
在我們的NAS上面多加幾塊harddisk(比如10塊) , 共享出來 , 這樣的話 , 可以有多個用戶同時訪問這幾塊磁碟, 當然有可能出現併發訪問同一個目錄的情況 。
現在只是做產品的研究階段, 我個人覺得對個人用戶來講 ,還是蠻有好處的。比samba來的更底層一些 。


看到您的帖子, 知道您是個高手, 可否推薦什麼書嗎?或者是什麼學習資料? 我好好研究先! 謝謝了。
尤其是 cluster file system 方面可有什麼好書?
多謝

[ 本帖最後由 bob_zhang2004 於 2007-2-5 14:25 編輯 ]
《解決方案》

openAFS 好像可以

搜索了一下 cluster file system , 同時支持Windows和Unix(Linux)的 , 好像只有openAFS (http://www.openafs.org/release/openafs-1.5.14.html )

看起來 ,應該能符合我的要求。 有人用過嗎?

看起來 ,openAFS 不過是NFS的更好的實現而已, 如果openAFS可以實現我的要求的話, 恐怕我都沒有必要用iSCSI 共享磁碟了。 ???

[ 本帖最後由 bob_zhang2004 於 2007-2-5 17:55 編輯 ]
《解決方案》

openAFS is distributed file system NOT cluster file system

原帖由 bob_zhang2004 於 2007-2-5 16:55 發表於 6樓  
搜索了一下 cluster file system , 同時支持Windows和Unix(Linux)的 , 好像只有openAFS (http://www.openafs.org/release/openafs-1.5.14.html )

看起來 ,應該能符合我的要求。 有人用過嗎?

看起 ...

openAFS is distributed file system NOT cluster file system
it is only better NFS
《解決方案》

呵呵,我一開始也是像樓主這麼想的
《解決方案》

try ibm sanergy
《解決方案》

樓主,你的問題解決了么,可以分享下么?我們group也想實現iscsi 集群的共享設備。

[火星人 ] 【iSCSI + GFS】多initiator併發訪問同一個target device的問題?已經有817次圍觀

http://coctec.com/docs/service/show-post-4406.html