So I am trying to set up a redundant NFS share in a cloud environment(all links internal, half gig links), and I am looking into using heartbeat for failover, but all the guides seem to be about combining DRBD and heartbeat to create a robust environment. If need be I can do that, but since my content is almost completely static, I would like to avoid the extra overhead and complexity of DRBD if possible, but still be able to fail over if one of the NFS servers fails. Is it possible to use heartbeat with NFS to achieve high-availability without using DRBD to copy the blocks? I am not married to NFSv4, so if NFSv3 over UDP is necessary, that won't be a problem(only a very small number of clients will be connecting to the share)

Any comments are appreciated.

  • Yes, you create a floating IP and have heartbeat attach it to the server that is "up." You want to be sure not to enable auto fall-back and set up a system to ensure the current active NFS server syncs it's changes to the slave as often as needed (rsync is easy for this task). – Mark Wagner Jul 3 '12 at 1:49
  • @MarkWagner that should be an answer, not a comment. – Nils Oct 11 '12 at 21:19

I don't think NFS supports accessing files in the share when the server is offline. If eventual consistency is good enough for your application, you could use a tool like csync2 to synchronize the static files between servers.

In our environment, cron starts csync2 every minute on a pair of web servers to sync the files in /var/apps/nimbus/files. Configuration follows:

group files {
    host    beryllium@beryllium.int;
    host    boron@boron.int;
    key     /etc/csync2_ssl_cert.key;

    include /var/apps/nimbus/files/;

    auto    younger;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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