Heartbeat with dual SCSI config

Alan Robertson alanr at unix.sh
Wed Mar 6 11:56:31 MST 2002

Roberto Zini wrote:

> Alan Robertson wrote:
>>Hi Roberto,
>>I've CCed this reply to the linux-ha mailing list.
>>Roberto Zini wrote:
>>>Hi Alan !
>>>In the past few days I tried you heartbeat solution on a couple of
>>>Linux boxes and so far I was impressed by the results I got !
>>>I'm trying to use the HB (heartbeat) solution as to allow a given
>>>process (eg, Apache running several CGI scripts) to operate on a
>>>SCSI disk which is shared between the above 2 boxes. Just to provide
>>>you with some numbers, I'm using a couple of Adaptec 29160 HA (configured as
>>>ID=14 on the first box and ID=13 on the second one) whose secondary bus is
>>>connected to an external SCSI disk configured as ID=5 (the primary SCSI
>>>bus is being used for the boot/root disk).
>>>Let me preface that I'm neither a SCSI expert nor a Linux one but in
>>>my tests I've seen that both boxes are able to access the same
>>>shared HD (which has been prepared with a Linux partition) at the same
>>>time (ie, they can "mount" it without problems) which can lead to data
>>>corruption if both OSes try to write the same chunk of data.
>>>I'm wondering if there is an HW/SW solution which prevents the "failover"
>>>box (from the HB point of view) from mounting the external disk when it's
>>>already being mounted by the primary box.
>>You could write a resource script which removes the /dev entry when the
>>other side has the disk mounted.  Or you could do the equivalent at the
>>kernel level like this:
>>        echo "scsi-remove-single-device A 0 D 0" > /proc/scsi/scsi
>>to make the kernel believe the device is gone, and then also do
>>        echo "scsi-add-single-device A 0 D 0" > /proc/scsi/scsi
>>to make it come back just before takeover.

But, I read the kernel code, and it has warnings surrounding this feature. 
I've written this as a resource script, and have attached it.  It's also in 
CVS.  It worked for me in my (very) limited testing.

READ THE WARNINGS (and tell me how it works if you try it anyway ;-))

	-- Alan Robertson
	   alanr at unix.sh

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: LinuxSCSI.in
URL: <http://lists.linux-ha.org/pipermail/linux-ha/attachments/20020306/6d72895e/attachment.ksh>

More information about the Linux-HA mailing list