David Ramsden – Network engineer, general geek, petrol + drum and bass head
2Jan/12

Creating a HA iSCSI Target Using Linux

Some time ago I created a High Availability iSCSI target using Ubuntu Linux, iscsi-target, DRBD and heartbeat. The HA cluster consisted of two nodes and the iSCSI initiators were Windows Server 2008. I was able to mount the LUN and copy a video to it, play it back and then pull the power from the primary iSCSI target. A few seconds later the second iSCSI target took over and video continued to play.

Pretty cool, huh?

Here is my guide if you want to try this. Although I've not gone back through the guide to make sure it's correct. But if you spot anything that's wrong or not very clear, please leave a comment.

Tagged as: , , Leave a comment
Comments (8) Trackbacks (0)
  1. Have you tried this with Windows Server 2008 R2 with Hyper-V cluster?

    Thanks

  2. Hi Jason,

    No, I didn’t get that far. I got as far as attaching LUNs to a Server 2008 initiator, expanding the LUNs on the iSCSI target and growing the file system on the initiator. Trying Hyper-V was the next step.

    But if you try it, please let me know. I’d be interested to know how well it performs.

  3. Hi David,

    I used your “ask me stuff” link to send you a question and then after reading over your post over and over again trying to work out this problem I’m having I saw your comment field and thought I might leave a comment.

    I’m stuck on the part after you create the bond0 and reboot to check connectivity. After I rebooted, my nodes aren’t getting any network connectivity via the bond’d connections? Am I missing something basic here? did you run into any issues like this?

    Cheers,
    Aron

  4. Everything works, except for two issues. I have had to manually create ” /dev/vg01/iscsi-config” to get DRBD rocking and rolling.

    Finally, I have never been able to get the clustering going. The cluster IP stays on for only about 10-15 seconds then, it goes off. Never been able to attach to the iSCSI from any initiator.

    Thanks,

    Chris

  5. Update: I am able to get the cluster IP working now. I cannot get a Windows 7 iSCSI initiator to work, but shall try a Linux agent later.

    (Cluster IP started working once I had “portblock” patched according to your method and not the ‘Debian’ method, which had the parameters transposed.)

    Thank you very much for all your efforts, David.

    Chris

  6. Just tried iSCSI initiator from another Linux box without success. The iSCSI target does not seem to be working. Everything else works as expect.

    Thanks,

    Chris

  7. This is what I’ve finally came up with (this works for me):

    (/etc/ha.d/haresources)
    san01-n1 drbddisk::iscsi.config Filesystem::/dev/drbd0::/srv/iscsi-config::ext4 iscsi_target_unblock
    san01-n1 IPaddr2::172.16.254.100/24/bond0 drbddisk::iscsi.lun.storage iscsi_target_block iscsitarget iscsi_target_unblock

    (iscsi_target_block)
    ptables -A INPUT -p tcp –dport 3260 -j DROP
    exit 0
    iptables -A INPUT -p tcp –dport 3260 -j DROP
    exit 0

    (iscsi_target_unblock)
    #! /bin/sh
    iptables -D INPUT -p tcp –dport 3260 -j DROP
    exit 0

    Yes, very inartful solution, but it’s what it takes to make it work. Though I have not thoroughly tested to see if the port block is necessary to make the target switch smoother–seems to help, especially when play videos with Media Player.

    Thanks,

    Chris

  8. oops,

    (iscsi_target_block)
    #! /bin/sh
    iptables -A INPUT -p tcp –dport 3260 -j DROP
    exit 0

    Thanks,

    Chris


Leave a comment

No trackbacks yet.