I have a pair of web servers running GlusterFS 3.3.0 providing a single replicated volume. Clients connect via NFS, and the web servers are also clients. Gluster gets very unhappy if the files it serves are written via the 'back door' (i.e. local file access), so I need to go through the NFS stack to go in through the 'front door'. Each server has an autofs config that is set to mount the volume from localhost. These are my config files:
#+auto.master /- /etc/auto.nfs
/var/lib/sitedata -fstype=nfs,vers=3,hard,noexec,nosuid,nodev,rsize=32768,wsize=32768,intr,noatime,mountproto=tcp 127.0.0.1:/shared
(These mount values are what are suggested for gluster NFS clients, in particular the forcing of TCP; a more minimal config doesn't work either)
The problem I'm running into is that autofs (or NFS) seems to say "Hey, this is pointing at localhost so I can shortcut it by doing a local bind remount instead!", as if I had said
mount --bind /shared /var/lib/sitedata. Unfortunately that fails completely as it's not the same thing at all.
This seems to be specific to localhost because a remote server connecting to one of these hosts doesn't have a problem with the same autofs config. I don't want each web server to mount the other - performance is bad enough already without introducing new failure modes!
How can I force autofs' NFS mount to go via TCP?