linuxstorageiscsidisk-partitioning

map 1 iscsi disk to see two hosts I throw files to one machine, the other doesn't have to reboot the machine. will see


I map 1 iscsi disk to see two hosts, what else do I need to set? For linux, now all I can do is see both disks the same, but when I throw files to one machine, the other doesn't have to reboot the machine. will see


Solution

  • Is this what you're trying to do? Two machines connected to the same LUN via iSCSI?

    host A -- iscsi --\
                       >-- LUN
    host B -- iscsi --/
    

    If that's the case, you will need what is called a "clustered file system" to make it work without data corruption. As you've seen, it will appear to work, sort of, with a sync mounted Linux filesystem like ext4, or one with a tight flush period. But eventually the uncoordinated updates from the two hosts are going to corrupt the filesystem and the data it holds.

    Wikipedia has a page on clustered filesystems here: https://en.wikipedia.org/wiki/Clustered_file_system.

    VMware VMFS is an example of a clustered filesystem. Modern versions of VMware use SCSI COMPARE AND WRITE commands (essentially, atomic test and set) to coordinate access to different areas of the shared LUN. Older versions used SCSI reservations.