Search Docs...
⌘ K
OverviewDeploymentManagementOperationReference
    AFS 1.1.1
  • Managing file storage>
  • Configuring a Linux client to access file storage

Configuring a Linux client

To use the file system, you need to complete the environment setup on the Linux client.

Prerequisite

  • Make sure the file storage cluster has a file system, and that the file system is in the Online state. If not, you should create a file system or take a file system online.
  • Ensure that the network of the Linux client is connected to the file access network.

Installing NFS client

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

Configuring the firewall

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

Configuring unique identifier (NFS v4.1 only)

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:

  1. Viewing the nfs4_unique_id of the NFS client:

    sudo systool -v -m nfs | grep -i nfs4_unique

    Output example

    nfs4_unique_id = ""
  2. 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
  3. Restarting the NFS client.

    sudo reboot
  4. 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"