I have three Raspberry Pis running Raspbian. One is serving as an NFS NAS, the other two are load-balanced web servers running NGINX. The configuration is like this:
On the NAS (10.34.0.40):
root@nas:~# cat /etc/exports
/drupal 10.34.0.10(rw,sync,no_root_squash,no_subtree_check) 10.34.0.20(rw,sync,no_root_squash,no_subtree_check,fsid=0)
/wordpress 10.34.0.10(rw,sync,no_root_squash,no_subtree_check) 10.34.0.20(rw,sync,no_root_squash,no_subtree_check,fsid=0)
On the WEB1 (10.34.0.10) server:
root@web1:~# cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
nas:/drupal /usr/share/nginx/html/drupal nfs hard,intr 0 0
nas:/wordpress /usr/share/nginx/html/wordpress nfs hard,intr 0 0
On the WEB2 (10.34.0.20) server:
root@web2:~# cat /etc/fstab
proc /proc proc defaults 0 0
/dev/mmcblk0p1 /boot vfat defaults 0 2
/dev/mmcblk0p2 / ext4 defaults,noatime 0 1
nas:/drupal /usr/share/nginx/html/drupal nfs hard,intr 0 0
nas:/wordpress /usr/share/nginx/html/wordpress nfs hard,intr 0 0
The two fstabs are identical (in fact,the two web servers have identical configurations provisioned with ansible). However, while WEB1 mounts the two mountpoints correctly, WEB2 mounts the nas:/drupal directory to both /usr/share/nginx/html/drupal and /usr/share/nginx/html/wordpress. In other words, when I do an ls /usr/share/nginx/html/wordpress, I get the contents on nas:/drupal, not nas:/wordpress.
If I do a df on both systems I get:
WEB1:
root@web1:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 4.8G 24G 18% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 0 463M 0% /dev/shm
tmpfs 463M 6.3M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p1 60M 21M 40M 35% /boot
nas:/drupal 15G 3.8G 11G 28% /usr/share/nginx/html/drupal
nas:/wordpress 15G 3.8G 11G 28% /usr/share/nginx/html/wordpress
tmpfs 93M 0 93M 0% /run/user/1001
WEB2:
root@web2:~# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/root 30G 3.2G 25G 12% /
devtmpfs 459M 0 459M 0% /dev
tmpfs 463M 0 463M 0% /dev/shm
tmpfs 463M 6.3M 457M 2% /run
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
tmpfs 463M 0 463M 0% /sys/fs/cgroup
/dev/mmcblk0p1 60M 21M 40M 35% /boot
nas:/drupal 15G 3.8G 11G 28% /usr/share/nginx/html/drupal
tmpfs 93M 0 93M 0% /run/user/1001
So it looks like WEB2 is not mounting the nas:/wordpress share.
I should note that both nas:/drupal and nas:/wordpress have exactly the same permissions.
Can anyone tell me what is going on here?
ls -ld /usr/share/nginx/html/wordpress
on web2 ? Is it a symlink? – Mark Plotnick Aug 24 '16 at 15:49fsid=0
in the exports for both filesystems only for web2, but they are probably different filesystems. – meuh Aug 24 '16 at 16:04