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

5 Answers 5

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

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
    
I set up an active/active NFS cluster using a load balancer, CentOS, DRBD, GFS2, and Pacemaker. See my answer for more info. –  doublesharp Feb 9 at 19:10

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

I set up a redundant pair of NFS file servers in an "dual primary" active/active configuration using a load balancer, CentOS, NFS, DRBD (replication), GFS2 (clustered file system) and Pacemaker (cluster management).

Here is a guide for this implementation at RackSpace, but it would be similar in any other environment.

Howto setup Dual Primary DRBD on CentOS 6: GFS2 & Pacemaker.

share|improve this answer

This is ultra nice and simple how-to,tried and works fine.

https://www.howtoforge.com/high_availability_nfs_drbd_heartbeat

Personally i prefer lvs because combine ha with load balance,but i have tried with nfs+gfs2+drbd and works really bad. Maybe i need some how to,but i can't find none about lvs+nfs ha

share|improve this answer
    
But how do i Virtual IP as mentioned there, over the Servers? (I don't know) –  夏期劇場 Feb 9 at 10:48
    
I'm setup atm a lvs server,for create a virtualip you need lvs,and if you want there is a nice web interface called pirahna gui for create virtualip.Read this pdf for example guug.de/lokal/hamburg/talks/Linux-Terminal-Cluster-UNIHH.pdf –  elbarna Feb 9 at 15:11
    
I'm tryng now to setup lvs,virtualip..is near impossible,when nfs is mounted from a remote,and one server is down,nfs is blocked even in the last server and in remote client. –  elbarna Feb 10 at 21:22
    
No way,is impossible active/active cluster with nfs –  elbarna Feb 11 at 11:00
    
But fortunately we can have pnfs –  elbarna Feb 11 at 16:06

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.