To use the file system, you need to complete the environment setup on the Linux client.
Prerequisite
Please install the NFS client using the following commands based on the client's operating system.
Debian/Ubuntu
apt-get update && apt-get install nfs-common
CentOS/Redhat
yum install nfs-utils
If the NFS client is running in a firewall environment, please configure the firewall rules of the NFS client to allow the following ports traffic in and out according to the version of the NFS protocol:
NFS version | AFS service ports |
---|---|
NFS v3 | 111, 2049, 2050, 2051 |
NFS v4.1 | 2049 |
In the NFS v4.1 protocol, the NFS server maintains the status of the NFS client based on the unique identifier co_ownerid
sent by the NFS client. For more information, refer to NFSv4 client identifier. By default, co_ownerid
starts with "Linux NFS" followed by the client's hostname. If multiple NFS clients‘ hostnames are duplicated, the unique identifiers co_ownerid
of the NFS clients will conflict. When both access the file system, they will interfere with each other, causing file system operations to fail, hang, and other issues, affecting the availability of the file system.
Therefore, when mounting the file system using NFS v4.1, please avoid duplicate hostnames for different NFS clients. If client hostname duplication cannot be avoided, you can customize the nfs module parameter nfs.nfs4_unique_id
to set the uniqueness of co_ownerid
through the following operations:
Viewing the nfs4_unique_id of the NFS client:
sudo systool -v -m nfs | grep -i nfs4_unique
Output example
nfs4_unique_id = ""
Customizing nfs4_unique_id:
sudo
echo options nfs nfs4_unique_id="your_id" > /etc/modprobe.d/nfsclient.conf
Input example
Customize nfs4_unique_id as vm_for_play:
sudo
echo options nfs nfs4_unique_id="vm_for_play" > /etc/modprobe.d/nfsclient.conf
Restarting the NFS client.
sudo reboot
Checking the nfs4_unique_id of the current NFS client again to confirm that the custom value has taken effect:
systool -v -m nfs | grep -i nfs4_unique
Output example
nfs4_unique_id = "vm_for_play"