2

I have been managing a small local Linux cluster for my lab, consisting about two dozens of Ubuntu Linux servers - half of those are headless servers (rack/tower), and the other half are used as desktops by my students.

I have setup an LDAP server for centralized account management and setup nfs/autofs mounts for shared file systems - including everyone's home directory. This setup has been running well over the last 8 years and I have been growing my servers over the time.

A few times of a year, I found that when the nfs server exporting the home directory or the LDAP server went offline for various reasons, the entire cluster hanged. I am trying to build some redundancy to the system so that when this happens, I have a fallback plan.

In a recent test, I noticed that my autofs configured autofs-ldap auto.direct mount to /homes directory, exported from server B, and the /etc/fstab configured nfs mount to /homes dir, exported from server A, can both be mounted, when typing df, this is what I saw

serverA:/local_mount/fstab/mount/export  ... 50% /homes
serverB:/local_mount/auto/direct/export  ... 50% /homes

serverA is configured in /etc/fstab, while serverB is configured in my LDAP system with auto.direct, both pointing to /homes.

I found that when the system reboot, /etc/fstab first mount serverA to /homes, then, when autofs service starts, serverB's mount became active and shadows the fstab mount.

My question is

  1. does this configuration have any risk to use such folder with double-mounts?
  2. does this configuration offers any redundancy to my /home dir mounts? for example, if serverB is down, but serverA is up, or vice versa, will my users still have a usable home dir without hanging?

1 Answer 1

1

A few times of a year, I found that when the nfs server exporting the home directory or the LDAP server went offline for various reasons, the entire cluster hanged. I am trying to build some redundancy to the system so that when this happens, I have a fallback plan.

Every LDAP service has replication capabilities. Even if you're not able to set up a redundant storage cluster (which I believe would be possible with autofs listing multiple NFS servers within the same map entry, or maybe with pNFS?), you should at least set up Syncrepl to have two LDAP servers for redundancy.

does this configuration have any risk to use such folder with double-mounts?

The risk is that half of your configuration is made useless – if the mount configured from /etc/fstab is always shadowed, then it has no purpose being there; and if your autofs mount is always shadowed by fstab, then autofs has no reason to exist.

Other than that: As long as both mounts are actually made from the same source NFS share, it's fine (only the topmost mount will be used), but if they're made from different sources, then there's potential for confusion if things happen in an unpredictable order between reboots (e.g. server A is on top today, server B will be on top tomorrow).

does this configuration offers any redundancy to my /home dir mounts? for example, if serverB is down, but serverA is up, or vice versa, will my users still have a usable home dir without hanging?

It offers no redundancy whatsoever. Mounts do not mix or interleave; they overlap, with the last (topmost) mount being the only one that's visible. With autofs this is important because even while the actual NFS share is not yet mounted, the same path still has the special autofs 'trigger' mount, so if the fstab entry is underneath, it will never be visible – even when LDAP is down.

(Which is to say, with autofs it's normal to have two mounts overlapping, and your /etc/fstab entry would actually be the third mount.)

This probably means you should have an autofs map with individual mounts per-user, rather than one large /homes mount; that'll also make it easier to balance storage across multiple servers (if you don't yet have any kind of "storage cluster" set up and are using just standalone NFS servers).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .