Failover using Solstice Disksuite


Copyright 2002, 2003 Andy Barclay
OpenContent License (OPL)

To use ODS to create a failover
================================

In order to use metasets for high availability failover, both Sun systems
MUST be connected to the same set of disks. When doing this with a common
disk pack, one of the nodes MUST change the scsi-initiator-id (SCSI target of
the controller card). There is a separate document that details this.

First, install SUNWmd and SUNWmdg

Next, crate the metaset for the two hosts:
# /usr/opt/SUNWmd/sbin/metaset -s failover -a -h ushqseng25 ushqseng27

If you get a permission denied error, then you must create a /.rhosts with
the other machine's hostname. The other machines hostname MUST match the
reverse lookup for that host. So, if you have  "hosts: files dns" in your
nsswitch.conf, then if the remote host has an entry in your local /etc/hosts,
then you should add that name, otherwise put the dns reverse lookup name
(probably a fully qualified name) in that file.

You should NOT need rsh capability turned on, just the /.rhosts.

Now, add the disks to the metaset.

# /usr/opt/SUNWmd/sbin/metaset -s failover -a c1t0d0 c1t1d0 c1t2d0 \
	c1t3d0 c1t4d0 c1t5d0

The goal is for a 3 way mirror of stripes (RAID 0+1), so create 3 x 2
disk stripes by adding the following lines to /etc/opt/SUWNmd/md.tab
----------------------
failover/d1 1 2 c1t0d0s0 c1t1d0s0
failover/d2 1 2 c1t2d0s0 c1t3d0s0
failover/d3 1 2 c1t4d0s0 c1t5d0s0
---------------------

Then add the entries to create the three way mirror
--------------------
failover/d123	-m failover/d1 failover/d2 failover/d3
--------------------

Take ownership of the metaset
# metaset -s failover -t

Create all the metadevices
#  metainit  -a -s failover

Make a new file system on the device
# newfs /dev/md/failover/rdsk/d123

Add the file system to the /etc/vfstab on BOTH nodes
(probably want mount_at_boot set to NO)
----------------------------------------------
/dev/md/failover/dsk/d123	/dev/md/failover/rdsk/d123	/legato	ufs	1	no	-
----------------------------------------------

Create a startup script on BOTH nodes
-------------------------------
#!/bin/sh

case "$1" in
	start)
		# acquire the diskset
		/usr/opt/SUNWmd/sbin/metaset -s failover -t
		mount /legato
		;;

	stop)
		umount /legato
		/usr/opt/SUNWmd/sbin/metaset -s failover -r
		;;
	force)
		# acquire the diskset
		/usr/opt/SUNWmd/sbin/metaset -s failover -t -f
		mount /legato
		;;

	*)
		echo "Usage: $0 { start | stop | force }" >&2
		exit 1
		;;
esac
exit 0
-------------------------------

Link the startup script into /etc/rc3.d/S50mountlegato and
/etc/rc0.d/K50mountlegato ONLY on the node which will normally have the
databases running.

The other node's failover software will have to force mount the file system
if it should fail.