Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've been using NFS (and it is the only one i know well in Network Files) for a few years. But still can not able to find out ..

  • How to make NFS Servers in Clustered Design (or Load-balanced?)
  • Or at least to having it deployed on MORE-THEN-ONE Server and to "Automatic Failover".

The major objective is to NOT TO let my single running NFS Server a Single-point-of-Failure.


Since i do not know how to make it properly, so far i have invented on my own is:

  1. NFS on 2 Servers.
  2. RSYNC from 1st (assumed Master) Server to another 2nd Server.
  3. From Application (Web, etc) Servers, put a Shell Script to check the healthy state of NSF-Master Server Mount Point. And then if need, auto-unmount from it (leaving) and then auto-mount from 2nd one.
  4. The main function i used in my automatic Shell Script, is nfsstat -m .. to check the health of mount point.

(I'm using Redhat)

But anyway, i still DO NOT think it is the safe & standard way. Please kindly suggest the best ways as in something like Industrial Standard if there are.

share|improve this question
add comment

3 Answers

You cannot have NFS as active-active cluster as far as I know. Now, for Active-Passive there are certain tools that help you achieve this. I'm more familiar with Solaris OS and Solaris Cluster that provide you the possibility to create a high-availability NFS share/shares depending on your objective.

One thing that you will need is a shared storage that can be moved from Server A to Server B and vice versa in case of need. Ideally iSCSI or SAN Storage. And a IP associated with the NFS share.

The cluster will work like this. In case of failure of Server A, Server B will enable the IP associate with the NFS server and take ownership of the shared disk, mount it and start the NFS server. Same goes in case Server B fails and Server A is up.

If you want to this manually then as basic steps you will need, monitoring scripts and scripts to enable and disable the services automatically.

Take a look here for Redhat

share|improve this answer
add comment

This is just one of the many ways in which NFS sucks.

There is no way to do this just with NFS up to version 3. You are going to have to add on the functionality manually.

This probably means:

  • data replication or some shared storage
  • IP takeover
  • Some sort of heartbeat monitoring
  • Cluster management

There are packages out there to do all of this but you will have to integrate them for your organisation.

The Linux HA project was set up many years ago to implement some of these things. http://www.linux-ha.org/

You should find most of what they have done already packaged in whatever popular distribution you are using.

Worth noting... The single largest cause of failure of a system (by far) is administrative error and HA clusters are by definition a complex system and more prone to admin error.

OK beyond NFS v4, NFS v4 starts to implement some of the scalability, security and availability functionality which AFS has had for 20 years, it isn't by any means fully or widely implemented yet or even entirely compatible with various clients and servers, but if you are using NFS, start with v4 and check out what has been implemented already on your platform.

share|improve this answer
add comment

This tutorial, titled: Smooth Active-Active NFS failover with Heartbeat and Pacemaker shows how to setup a NFS active/active using NFS, Heartbeat, & Pacemaker.

You'll also probably want to take a look at these other links to familiarize yourself with the various technologies and terminologies.

This ServerFault Q&A should also prove helpful, linux clustered Filesystem.

Additional references

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.