advertise
« Behind The Scenes of Google Scalability | Main | Using Google AppEngine for a Little Micro-Scalability »
Tuesday
Apr222008

Simple NFS failover solution with symbolic link?

I've been trying to find a high availability file storage solution without success. I tried GlusterFS which looks very promising but experienced problems with stability and don't want something I can't easily control and rely on. Other solutions are too complicated or have a SPOF.

So I'm thinking of the following setup:

Two NFS servers, a primary and a warm backup. The primary server will be rsynced with the warm backup every minute or two. I can do it so frequently as a PHP script will know which directories have changed recently from a database and only rsync those. Both servers will be NFS mounted on a cluster of web servers as /mnt/nfs-primary (sym linked as /home/websites) and /mnt/nfs-backup.

I'll then use Ucarp (http://www.ucarp.org/project/ucarp) to monitor both NFS servers availability every couple of seconds and when one goes down, the Ucarp up script will be set to change the symbolic link on all web servers for the /home/websites dir from /mnt/nfs-primary to /mnt/nfs-backup

The rsync script will then switch and the backup NFS will become primary and backup to the previous primary when it gets back online.

Can it really be this simple or am I missing something? Just setting up a trial system now but would be interested in feedback. :)

Also, I can't find out whether it's best to use NFS V3 or V4 these days?

Reader Comments (4)

Have you looked at DRBD + Heartbeat? This would be a much better and more reliable approach. The short, short version is that DRBD replaces your rsync script (and more) and Heartbeat replaces your Ucarp/symlink. Here is a nice guide on how to set it up:
http://howtoforge.com/high_availability_nfs_drbd_heartbeat

November 29, 1990 | Unregistered CommenterDave Pirotte

Thanks for your reply Dave. The thing that put me off DRBD was that if there is any corruption, apparently it gets replicated on the other drive. Plus there is a bit more flexibility with rsync, e.g. not deleting files immediately on the backup server.

I'll give it another look though I think.

November 29, 1990 | Unregistered CommenterDigiM

Thanks my firends

November 29, 1990 | Unregistered CommenterYemek Tarifleri

I am trying to look at similar option. Did anybody tried the above symbolic Link option in production? Curious to know if this works or did anybody faced issues with rsync?

December 16, 2011 | Unregistered CommenterRahul

PostPost a New Comment

Enter your information below to add a new comment.
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>