PoC: ZFS fail-over with HAST + carp(4) + devd

Nikolay Denev ndenev at gmail.com
Thu Mar 4 07:49:40 UTC 2010


On Mar 3, 2010, at 7:13 PM, Freddie Cash wrote:

> [Not sure if this should go to just fs@ or possibly current@ as well.  I'll
> start with just fs at .]
> 
> Thought I'd pass this along.  It's a proof-of-concept setup I've been using
> to test HAST fail-over of a ZFS pool, using devd and carp(4).  The original
> impetus for doing this was that ucarp doesn't work (for me) within a
> VirtualBox VM.  Just hangs the VM.  And, I prefer to use FreeBSD base tools
> whenever possible, so I thought I'd try and get it to work with carp(4).
> 
> I know this isn't perfect as it (currently) relies on a "magic constant" and
> doesn't cover all the possible failure modes, but thought I'd pass it along
> to get your input, comments, criticisms, suggestions, etc.  With a bit more
> work, it could be generalised a bit more to, for example, pull the resources
> list from /etc/hast.conf, and to work with non-ZFS setups.  Perhaps someday
> it could be useful an an example in the HAST samples/ directory.?.
> 
> With this setup, I can pull the plug on carp0 on the master node, and the
> hast devices and ZFS pool fail-over to the slave.  And if I pull the plug on
> carp0 on the slave, everything fails over to the master again.  And it works
> nicely with carp preempt enabled on the master node.
> 
> 
> Add the following stanzas to /etc/devd.conf:
> notify 10 {
>        match "system"          "IFNET";
>        match "subsystem"       "carp0";
>        match "type"            "LINK_UP";
>        action                  "/usr/local/bin/carp-hast-switch master";
> };
> 
> notify 10 {
>        match "system"          "IFNET";
>        match "subsystem"       "carp0";
>        match "type"            "LINK_DOWN";
>        action                  "/usr/local/bin/carp-hast-switch slave";
> };
> 
> 

Hi,

It's a bit offtopic for fs-, but I'm just curious what FreeBSD version are you using with this?
My experience with 7.* is that LINK_UP/DOWN events are not generated for carp interfaces,
and I have just tested this in my devd.conf and it does nothing. I guess this is fixed in 8 or -CURRENT?

Regards,
Niki Denev


More information about the freebsd-fs mailing list