From owner-freebsd-fs@FreeBSD.ORG Thu Mar 4 07:49:40 2010 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD7AA106566B for ; Thu, 4 Mar 2010 07:49:40 +0000 (UTC) (envelope-from ndenev@gmail.com) Received: from mail-fx0-f223.google.com (mail-fx0-f223.google.com [209.85.220.223]) by mx1.freebsd.org (Postfix) with ESMTP id 493448FC1C for ; Thu, 4 Mar 2010 07:49:39 +0000 (UTC) Received: by fxm23 with SMTP id 23so973261fxm.3 for ; Wed, 03 Mar 2010 23:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:mime-version :content-type:from:in-reply-to:date:cc:content-transfer-encoding :message-id:references:to:x-mailer; bh=Oz3tlAzZxzarjQDk09nVVlR/AN6uxOgsNU817oqsuIw=; b=dmkotipfnZR5wOexd/rfHPSleqqV3Bq95eejXFTglHb5DOsxfiN+nVjPw49SotB1tb DnTbDbHwFjS/Y5TXk29rMGFTgiR7+0BQrUtJuvfUqKR/jDnbDw0F0NALdBB7ikUUTLPy qj8BKbWedfBbOS+tzwI2Kh2AbKiV9GV8HVIDg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; b=nug8jgAkM1SaWcSkXD9NEB734lYvdbg2TT2JQRlz4wiT965FkP8GDhkQPyDpT0jkcp ztzVIHDfO18gtCziskW8SGIY1saAOGb+lHxqc5hvHfkAG7+Je4S89GMAb1wSf7vxIu2V vV1ZeXYglipLwJkTPu7qD0RNl3f44ED0eL4tk= Received: by 10.102.16.15 with SMTP id 15mr858388mup.38.1267687643900; Wed, 03 Mar 2010 23:27:23 -0800 (PST) Received: from [10.32.23.105] ([195.34.111.178]) by mx.google.com with ESMTPS id t10sm1284180muh.59.2010.03.03.23.27.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 03 Mar 2010 23:27:22 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1077) Content-Type: text/plain; charset=us-ascii From: Nikolay Denev In-Reply-To: Date: Thu, 4 Mar 2010 09:27:19 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <7C1E347F-CD36-4F54-814B-90BE4EB67C75@gmail.com> References: To: Freddie Cash X-Mailer: Apple Mail (2.1077) Cc: fs@freebsd.org Subject: Re: PoC: ZFS fail-over with HAST + carp(4) + devd X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 04 Mar 2010 07:49:40 -0000 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@.] >=20 > 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). >=20 > 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.?. >=20 > 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. >=20 >=20 > 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"; > }; >=20 > notify 10 { > match "system" "IFNET"; > match "subsystem" "carp0"; > match "type" "LINK_DOWN"; > action "/usr/local/bin/carp-hast-switch = slave"; > }; >=20 >=20 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=