LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   autofs: Best option for usecase where one need to group servers (https://www.linuxquestions.org/questions/linux-server-73/autofs-best-option-for-usecase-where-one-need-to-group-servers-4175474984/)

kenneho 08-28-2013 03:30 AM

autofs: Best option for usecase where one need to group servers
 
Hi,


We have a great number of RHEL-servers exporting NFS-shares, which we today mount using traditional NFS mounting in /etc/fstab.

Most of the shares are accessed only once in a while, so I though we'd migrate to autofs. We have frequent problems of NFS shares hanging, so it's important that we try to reduce this issue.

We need to mount the shares in a folder structure such as:
/somewhere/environment/servername/share1
/somewhere/environment/servername/share2

example:
Code:

/var/www/html/environment1/server1/share1
/var/www/html/environment1/server1/share2
/var/www/html/environment2/server2/share1

Using autofs' hostmap-feature (i.e. "/somewhere -hosts") would be great, as we wouldn't need to manually tell autofs about every share exported from each server. But this option would, as far as I can tell, allow us to group servers into environments (or at least enforce this to avoid servers being added to wrong environments).

So to my knowledge the best option would be to use regular direct mounts, which is very close to how /etc/fstab works.

Any thoughts on this approach?

And any thought on how to reduce NFS share hang issues - maybe setting a really low retry value?


Best regards,
kenneho

lleb 08-28-2013 09:48 PM

i prefer autofs to standard fstab for mounting NFS shares for the simple facts you mentioned. keep in mind to add a few options to your autofs files:

Code:

$ cat /etc/auto.NFS
Shares        -rw,soft,intr,bg,rsize=8192,wsize=8192        server:/exports/

the key is the bg option as that sets the mount option to the background and does not cause the system to hang if something drops connection or other connection issues with the NFS share/mount point.


All times are GMT -5. The time now is 07:41 PM.