Added persistent port assignments for NFS#149
Conversation
setup_nfs_ha.sh: Added static port assignments to NFS to allow access through a loadbalancer. Ports 111 (TCP/UDP), 2049 (TCP/UDP), 2000 (TCP/UDP), 2001 (TCP), and 2002 (UDP) are the ports required.
hosungsmsft
left a comment
There was a problem hiding this comment.
Thank you very much for your guiding me on all this!
| cat <<EOF > /etc/sysctl.d/30-nfs-ports.conf | ||
| fs.nfs.nlm_tcpport = 2001 | ||
| fs.nfs.nlm_udpport = 2002 | ||
| EOF |
There was a problem hiding this comment.
Thanks so much @kermat for your PR! I've been working on this exactly like this, but I'm stuck at sysctl --system step (according to https://wiki.debian.org/SecuringNFS). Don't we need to do that? Yet, if I do that when nfs-kernel-server is stopped, it doesn't appear to work at all. In fact, sysctl -p /etc/sysctl.d/30-nfs-ports.conf complains that there's no directory /proc/fs/nfs/…. Can you confirm that we don't need to run the sysctl command? Well, I'm just about to do that anyway, so I'll probably find that out. Thanks again!
There was a problem hiding this comment.
I confirmed that creating /etc/sysctl.d/xxx.conf for NFS doesn't work, because the /proc/fs/nfs directory usually doesn't exist when the sysctl --system is run. And I confirmed that creating /etc/modprobe.d/lockd.conf with the static ports assigned does work. So I'll revise this code after accepting/merging your PR. Thanks much!
setup_nfs_ha.sh: Added static port assignments to NFS to allow access through a loadbalancer. Ports 111 (TCP/UDP), 2049 (TCP/UDP), 2000 (TCP/UDP), 2001 (TCP), and 2002 (UDP) are the ports required.
setup_nfs_ha.sh: Added static port assignments to NFS to allow access through a loadbalancer. Ports 111 (TCP/UDP), 2049 (TCP/UDP), 2000 (TCP/UDP), 2001 (TCP), and 2002 (UDP) are the ports required.
setup_nfs_ha.sh: Added static port assignments to NFS to allow access
through a loadbalancer. Ports 111 (TCP/UDP), 2049 (TCP/UDP), 2000
(TCP/UDP), 2001 (TCP), and 2002 (UDP) are the ports required.