Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a CentOS 6.3 client that needs to access NFS storage. There are two NFS servers that serve up the same content stored on a SAN with a clustered filesystem. How do I set up CentOS to failover to the backup NFS server if needed? When I Google, I keep reading that Linux does not support this, but that would be strange since there is plenty of information out there on how to set up a clustered Linux NFS server farm...

share|improve this question
3  
Would using Heartbeat and a floating virtual IP help you out? It's not limited to NFS, but a more general approach. see for example Arch Linux wiki: Simple IP Failover with Heartbeat. –  gertvdijk Dec 19 '12 at 23:52
1  
I second the comment by @gertvdijk. You might be able to configure active/passive failover by configuring the same IP address and hostname on the main server and the failover server. That is how commercial NFS filers work such as EMC VG-2 storage gateway. –  Dmitri Chubarov Dec 20 '12 at 8:49
    
heartbeat would work but this is a strange particular situation. The NFS server is a OS X 10.8 Xsan setup and they removed heartbeat in 10.8 (10.7 had it). –  Doug Jan 4 '13 at 3:07
add comment

2 Answers

up vote 1 down vote accepted

That sounds like a job for the automount(8) daemon. See the autofs(5) man page (from the autofs rpm) under "Replicated Server". I believe if you add a line like

fileserv host1,host2:/server/export/point

to /etc/auto.misc on your client and (re-)start the autofs service, your NFS storage will show up under /misc/fileserv. You could add -ro as mount options if you want to mount read only (or other mount options of course).

share|improve this answer
    
that did it sure enough! thanks. It would be cool if it could revert back to the main server when its back online, but this works well enough to get the job done. –  Doug Jan 4 '13 at 3:05
add comment

The Right Way(tm) to do this is with GlusterFS, which is a scale out filesystem that runs in userspace atop an underlying filesystem like NFS or CIFS.

All this sounds impressive and complicated, but it's actually really simple to set up. It honestly should take you less than 15 minutes. You'd have two servers, each with a "brick" (unit of storage) defined. A volume would then be defined within this server pool. Replication of the data between the servers happens automatically, as does failover on the client if one of the servers dies.

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.