Open NFS ports in ARO
SharedV4 volumes utilize NFS services, and they therefore require specific open NFS ports to allow for communication between nodes in your cluster. Depending on how your cluster nodes are configured, your firewall may block some of these ports, or your NFS ports may differ from the defaults. To solve these issues, you may need to manually assign NFS ports and ensure that your firewall or ACL allows them to communicate.
Portworx supports the following types of ReadWriteMany volumes:
If a PersistentVolumeClaim (PVC) has ReadWriteMany (RWX) access mode, Portworx creates a sharedv4 service volume by default. Sharedv4 service volumes use NFSv4 by default, which means only port 2049 needs to be opened. However, sharedv4 volumes use NFSv3 by default. If your volumes use another port, see the Manually assign and open NFS ports section.
This document provides instructions for detecting and opening NFS ports according to various cluster configurations that you may have.
Prerequisites
All of the use-cases in this document will require that the mandatory Portworx network port ranges are open between nodes in the cluster, as documented here.
Determine which ports to open
First, check what the existing NFS port configuration is for your nodes to see if they need to be remapped.
Enter the following command to find which ports NFS is using on your node:
rpcinfo -p
SharedV4 volumes communicate on the following standard ports/services:
- PortMapper: tcp/udp 111 (default on most Linux distributions)
- NFSd: tcp/udp 2049 (default on most Linux distributions)
- MountD: tcp/udp 20048 (depends on the Linux distribution)
If the ports listed from the above rpcinfo
output on your nodes match these standard ports, proceed to Open standard NFS ports (most Linux distributions).
If the NFS ports on your OS do not match these ports, or your OS randomly chooses the ports for these services, proceed to Manually assign and open NFS ports.
Open standard NFS ports (most Linux distributions)
If your Linux distribution uses the standard ports identified in the previous section, you do not need to manually assign any ports for NFS, but you may need to open them.
Ensure that your ports are open on any firewalls and your ACL by entering the following commands:
iptables -I INPUT -p tcp -m tcp --match multiport --dports 111,2049,20048 -j ACCEPT
iptables -I OUTPUT -p tcp -m tcp --match multiport --dports 111,2049,20048 -j ACCEPT
Once you've determined that your hosts are using the standard ports and that you have opened those ports, you can start using SharedV4 volumes.
Manually assign and open NFS ports
For certain Linux distributions, the OS chooses the mountd
port randomly every time the node reboots. To solve this, you must manually assign NFS ports, and how you accomplish this depends on your OS.
Only perform the steps in one of the following sections if one of the following is true:
- The
mountd
port is not fixed (and not the standard port of 20048) and is chosen at random by your Linux distribution. - You wish to open a contiguous range of ports for Portworx and want to shift the default NFS ports to your Portworx port range.
In order to manually assign and open NFS ports, follow the steps in the section that applies for your OS.
Assign NFS ports on the RedHat family of Linux (RHEL, CentOS, Fedora, etc)
-
Modify the
/etc/sysconfig/nfs
file, uncommenting or adding the following fields and assigning the associated values:- LOCKD_TCPPORT=9023
- LOCKD_UDPPORT=9024
- MOUNTD_PORT=9025
- STATD_PORT=9026
-
Enter the following command to restart the NFS server:
systemctl restart nfs-server
-
Open the newly assigned NFS ports on your access control list:
iptables -I INPUT -p tcp -m tcp --match multiport --dports 111,2049,9023,9025,9026 -j ACCEPT
iptables -I OUTPUT -p tcp -m tcp --match multiport --dports 111,2049,9023,9025,9026 -j ACCEPT
iptables -I INPUT -p udp -m udp --dport 9024 -j ACCEPT
iptables -I OUTPUT -p udp -m udp --dport 9024 -j ACCEPT