From owner-freebsd-questions@FreeBSD.ORG Mon May 31 00:04:44 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9F13B16A4CE for ; Mon, 31 May 2004 00:04:44 -0700 (PDT) Received: from smtp.infracaninophile.co.uk (happy-idiot-talk.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3436543D1D for ; Mon, 31 May 2004 00:04:43 -0700 (PDT) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i4V747O1050472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 31 May 2004 08:04:07 +0100 (BST) (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i4V747xe050471; Mon, 31 May 2004 08:04:07 +0100 (BST) (envelope-from matthew) Date: Mon, 31 May 2004 08:04:07 +0100 From: Matthew Seaman To: adp Message-ID: <20040531070407.GA50113@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , adp , questions@freebsd.org References: <020501c44619$d44e6250$6501a8c0@yourqqh4336axf> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="xHFwDpU9dbj6ez1V" Content-Disposition: inline In-Reply-To: <020501c44619$d44e6250$6501a8c0@yourqqh4336axf> User-Agent: Mutt/1.5.6i X-Virus-Scanned: clamd / ClamAV version devel-20040525, clamav-milter version 0.71 X-Virus-Status: Clean X-Spam-Status: No, hits=-4.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on happy-idiot-talk.infracaninophile.co.uk cc: questions@freebsd.org Subject: Re: NFS server fail-over - how do you do it? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2004 07:04:44 -0000 --xHFwDpU9dbj6ez1V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 30, 2004 at 02:43:37AM -0500, adp wrote: > I am running a FreeBSD 4.9-REL NFS server. Once every several hours our m= ain > NFS server replicates everything to a backup FreeBSD NFS server. We are o= kay > with the gap in time between replication. What we aren't sure about is how > to automate the fail-over between the primary to the secondary NFS server. > This is for a web cluster. Each client mounts several directories from the > NFS server. >=20 > Let's say that our primary NFS server dies and just goes away. What then? > Are you periodically doing a mount or a file look-up of a mounted filesys= tem > to check if your NFS server died? If so are you just unmounting and > remounting everything using the backup NFS server? >=20 > Just curious how this problem is being solved. If you're mounting those NFS partitions read/write, then there really isn't a good solution for this problem[1] -- you need your NFS server up and running 24x7. If you are NFS mounting those partitions read-only, then you can in principle construct a fail-over system between those servers. Some Unix OSes let you specify a list of servers in fstab(5) (eg. Solaris) and clients will mount from one or other of them. Unfortunately you can't do that with standard NFS mounts under FreeBSD. You could try using VRRP -- see the net/freevrrpd port for example -- but I'm not sure how well that would work if the system failed-over in the middle of an IO transaction. In any case -- certainly if your NFS partitions are read/write, but also for read-only, perhaps the best compromise is to use the automounter amd(8) This certainly does help with the 'nightmare filesystem' scenario, where loss of a server prevents the clients doing anything, even rebooting cleanly. You can create a limited and rudimentary form of failover by using role-base hostnames in your internal DNS -- eg nfsserv.example.com as a CNAME pointing at your main server, and then modify the DNS when you need the failover to occur. It's a bit clunky and needs manual intervention, but it beats having nothing at all. Cheers, Matthew=20 [1] Well, I assume you haven't got the resources to set up a storage array with multiple servers accessing the same disk sets. --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --xHFwDpU9dbj6ez1V Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAutjniD657aJF7eIRAoNEAKCxCNh7pJ2wT2dHhywxrN6J6n/wFQCfYKS9 jwq9xgH6HP3pQUsc25x1/y0= =5EVH -----END PGP SIGNATURE----- --xHFwDpU9dbj6ez1V--