How to do client side NFS failover in Linux?
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).
Related videos on Youtube
Doug
Updated on September 18, 2022Comments
-
Doug almost 2 years
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...
-
gertvdijk over 11 yearsWould 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.
-
Zachw6 over 11 yearsI 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.
-
Doug over 11 yearsheartbeat 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 over 11 yearsthat 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.
-
Snowball almost 10 yearsAnother Right Way is Ceph RBD.
-
TechGeek about 6 yearsYou can use MooseFS. It's open source and fault-tolerant distributed file system.
-
uav almost 4 yearsCeph is slow on VMs. Gluster/Heketi also and it is not yet suitable for many small files and/or many write operations, e.g. databases or Redis - I have learned through pain. I have not tried MooseFS yet. I am now back to NFS, autofs and lsyncd.