At server side I have:
CentOS 7 updated Kernel 4.13.12-1.el7.elrepo.x86_64 nfs-utils-1.3.0-0.48.el7_4.x86_64 libnfsidmap-0.25-17.el7.x86_64
At clients side, exactly same environment.
We have a iptables, but it allow any comunication between clients and server (any port with any protocol).
Most of clients can connect and mount an exported NFS share directory normally, without any problem. They have exactly same environment with exactly same iptable rules.
Some of them can not mount NFS share and I have no logs about that.
Calling one of that problematic client as CLIENT-A, if I try to mount NFS manually, I have no error or warning or any kind of log:
[root@]# mount -vvv -t nfs MYSERVER:/home/shared/ /home/shared/
Sometimes that command hang the terminal, sometimes not. If I cancel that command or do a new ssh and try to do ls in /home, terminal will hang:
[root@]# ls /home/sha
(when I pressed TAB it crashed with no error). Even if I try write manually and press enter, I will get same situation. It will only stop crash after reboot the server. "lsof" command will hang too.
And in both situations above there is no timeout error. They never finish. I already tried reboot and try again, with no success. And I repeat: They have exactly same environment. You can think as a clone with different hardware and IP, but same software. Yes, it not guarantee equally results, but in general the idea of softwares are show same result.
I can create a tcp connection with NFS server manually:
[root@localhost]# telnet MYSERVER 2049 Trying MYSERVERIP... Connected to MYSERVER. Escape character is '^]'.
I have no logs in both sides about what is happening. I think they are trying to create a connection with nfs 4.1 version (last version of that module). I have tried version 3 manually with no success.
I executed "rpcinfo -p localhost" at server side and I found a curious question: Some clients are using version 4, some of them 3, 2 or 1 (2 or 1????!!!).
[root@ ~]# rpcinfo -p localhost program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100000 2 tcp 111 portmapper 100000 4 udp 111 portmapper 100000 3 udp 111 portmapper 100000 2 udp 111 portmapper 100024 1 udp 59356 status 100024 1 tcp 50117 status 100005 1 udp 20048 mountd 100005 1 tcp 20048 mountd 100005 2 udp 20048 mountd 100005 2 tcp 20048 mountd 100005 3 udp 20048 mountd 100005 3 tcp 20048 mountd 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 3 tcp 2049 nfs_acl 100003 3 udp 2049 nfs 100227 3 udp 2049 nfs_acl 100021 1 udp 58205 nlockmgr 100021 3 udp 58205 nlockmgr 100021 4 udp 58205 nlockmgr 100021 1 tcp 38641 nlockmgr 100021 3 tcp 38641 nlockmgr 100021 4 tcp 38641 nlockmgr
So I found one client that are using NFSV3 and I did:
[root@ ~]# mount -vvv -t nfs -o vers=4 MYSERVER:/home/shared/ /home/shared/ mount.nfs: timeout set for Sun Nov 12 14:03:02 2017 mount.nfs: trying text-based options 'vers=4.1,addr=MYSERVER,clientaddr=MYCLIENTIP'
It hangs. But if I try vers=3, it works.
[root@ ~]# mount -vvv -t nfs -o vers=3 MYSERVER:/home/shared/ /home/shared/ mount.nfs: timeout set for Sun Nov 12 14:03:12 2017 mount.nfs: trying text-based options 'vers=3,addr=MYSERVERIP' mount.nfs: prog 100003, trying vers=3, prot=6 mount.nfs: trying MYSERVERIP prog 100003 vers 3 prot TCP port 2049 mount.nfs: prog 100005, trying vers=3, prot=17 mount.nfs: trying MYSERVERIP prog 100005 vers 3 prot UDP port 20048
At server side, the directory are exported line-by-line to different IPs with same parameters:
Returning at CLIENT-A question, I tried to log every new connection from tcp and udp ports from CLIENT-A in server side. I can see CLIENT-A trying to open ports. And it tries a lot. So I think the problem is not with clients. Maybe.
So my questions are:
- How to troubleshooting from now? I only have logs at server side from RPC when remote mount get success.
- Why rpcinfo -p show all versions about nfs4?
- Why (maybe relationated with (1)) server equally configured broke in nfs v4.1 and not with 3? OK, I know about stability questions, but with no logs about errors is the major question.
Thank you for your time :)