Skip to content

Added persistent port assignments for NFS#149

Merged
hosungsmsft merged 1 commit into
Azure:hs-nfs-hafrom
kermat:mk-nfs-ha
Jun 22, 2018
Merged

Added persistent port assignments for NFS#149
hosungsmsft merged 1 commit into
Azure:hs-nfs-hafrom
kermat:mk-nfs-ha

Conversation

@kermat
Copy link
Copy Markdown
Contributor

@kermat kermat commented Jun 22, 2018

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.
Copy link
Copy Markdown

@hosungsmsft hosungsmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your guiding me on all this!

Comment thread scripts/setup_nfs_ha.sh
cat <<EOF > /etc/sysctl.d/30-nfs-ports.conf
fs.nfs.nlm_tcpport = 2001
fs.nfs.nlm_udpport = 2002
EOF
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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!

@hosungsmsft hosungsmsft merged commit ab2dea5 into Azure:hs-nfs-ha Jun 22, 2018
@kermat kermat deleted the mk-nfs-ha branch June 22, 2018 16:50
naioja pushed a commit that referenced this pull request Dec 29, 2025
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.
vibehero100 pushed a commit to vibehero100/Moodle that referenced this pull request Apr 7, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants