I had previously been able to configure an NFS server on a computer running CentOS 6.6, and to mount the file system in a Virtual Machine with the same OS and using autofs
.
Last week I did a fresh install of all the OSs I had, and now for some reason I cannot get it to work. The server computer still runs CentOS 6.6, and the Virtual Machine is now running CentOS 7 (I also tried it with another Virtual Machine running Debian Wheezy, but it still didn't work).
The server (centosserv
) is running on 192.168.1.89, and the client (centoscli
, the CentOS 7 one) on 192.168.1.100.
The file system I want to share is /NFSSHARE
and /NFSSHARE/mydir
, and as such the /etc/exports
file on the server contains the following:
/NFSSHARE 192.168.1.100(fsid=0,rw,sync,no_subtree_check,root_squash,anonuid=1000,anongid=1000)
/NFSSHARE/mydir 192.168.1.100(ro,sync,no_subtree_check)
If I run showmount -e
I get this:
[root@centosserv ~]# showmount -e
Export list for centosserv:
/NFSSHARE/mydir 192.168.1.100
/NFSSHARE 192.168.1.100
So everything looks good so far.
On the client side, I edited the /etc/auto.master
to include the following line:
/mnt/nfs /etc/auto.nfs-share --timeout=90
And then created the /etc/auto.nfs-share
file with the following contents:
[root@centoscli ~]# cat /etc/auto.nfs-share
writeable_share -rw 192.168.1.89:/
non_writeable_share -ro 192.168.1.89:/mydir
This also seems to be working, given the below output:
[root@centoscli ~]# mount | grep nfs-share
/etc/auto.nfs-share on /mnt/nfs type autofs (rw,relatime,fd=18,pgrp=2401,timeout=90,minproto=5,maxproto=5,indirect)
At this point, /mnt/nfs/writeable_share
and /mnt/nfs/non_writeable_share
are not mounted, unless I try to access them directly, as per this tutorial (which is the same I had followed the last time I set up the NFS server*). So only after I tried ls -l /mnt/nfs/writeable_share
should it be mounted. But the output I get is:
[root@centoscli ~]# ls -l /mnt/nfs/writeable_share
ls: cannot access /mnt/nfs/writeable_share: No such file or directory
I ping
ed the server from the client and vice versa, just to check that they could both reach each other, and they seem to do.
I did everything exactly the same way I had done the first time round, yet for some reason I cannot get it to work this time. I have tried doing this by editing the /etc/fstab
file on the client side and manually instead of using autofs
, but it doesn't seem to work that way either. Disabling iptables
on the server side makes it work with fstab
and manually, but not with autofs
yet.
What else can I check, or where I have gone wrong?
*With the exception of the first three steps, since I have neither a service called nfs-common
neither a /etc/default/nfs-common
file.
EDIT
I was checking out this tutorial on a CentOS group on FB that, after the server side is supposedly settled and we're ready to start configuring the client side, says this:
Test if you can see NFS server:
showmount -e
So I'm guessing that using showmount -e
on the client I should be able to get some info on the server, or it at least some acknowledgement that I can mount file systems from that server on this client. However, I tried using showmount -e 192.168.1.89
on the client side, and the only message I got was this:
clnt_create: RPC: Port mapper failure - Unable to receive: errno113 (No route to host)
I'm guessing this could be the problem, but I'm not sure what it means.
Aucun commentaire:
Enregistrer un commentaire