This topic describes how to install a CPFS-POSIX client and mount a Cloud Parallel File Storage (CPFS) file system in Ubuntu or CentOS.
Prerequisites
You have created a file system. For more information, see Create a file system.
You have added a POSIX mount target. For more information, see Create a POSIX mount target.
You have created one or more Elastic Compute Service (ECS) instances that run Ubuntu or CentOS. The instances must meet the kernel version requirements shown in the following table. The instances must also have at least 2 CPU cores and 4 GiB of memory for proper operation. For more information, see Create an ECS instance.
Operating system type
Distribution
Kernel version
RHEL or CentOS
8.4
4.18.0-305.19.1.el8_4
8.3
4.18.0-240.22.1.el8_3
8.2
4.18.0-193.28.1.el8_2
8.1
4.18.0-147.8.1.el8_1
8.0
4.18.0-80.11.2.el8_0
7.9
3.10.0-1160.42.2.el7
7.8
3.10.0-1127.19.1.el7
7.7
3.10.0-1062.18.1.el7
7.6
3.10.0-957.54.1.el7
7.5
3.10.0-862.14.4.el7
7.4
3.10.0-693.2.2.el7
7.3
3.10.0-514.26.2.el7
7.2
3.10.0-514.26.2.el7
Ubuntu
20.04.3 LTS
5.4.0-86-generic
ImportantIf the kernel version of your operating system is not supported by the POSIX client, use an NFS client to access the CPFS file system. For more information, see Mount a file system on a CPFS-NFS client (Recommended).
For CentOS users: The CentOS project has announced the end of life (EOL) for CentOS Linux. The CentOS Linux public images on Alibaba Cloud are from the CentOS project. After CentOS Linux reaches its EOL, Alibaba Cloud will no longer provide support for the operating system. To prevent business interruptions, we recommend that you replace the operating system. For more information about how to replace an operating system, see Operating system migration.
Background information
In this topic, the destination ECS instances refer to the compute nodes on which you mount and access the CPFS file system.
CPFS is compatible with POSIX-based APIs. You can use CPFS by installing a CPFS-POSIX client and then mounting the file system. The CPFS-POSIX client is a custom service that you can install on the Ubuntu and CentOS operating systems. If you want to access the CPFS file system using the NFS protocol, see Mount a file system on a CPFS-NFS client (Recommended).
After you add a POSIX mount target, CPFS automatically creates three control plane node ECS instances: <FSID>-<GENID>-qr-001, <FSID>-<GENID>-qr-002, and <FSID>-<GENID>-qr-003. The first control plane node ECS instance in the list (<FSID>-<GENID>-qr-001) is the default installation node for the CPFS-POSIX client.
Step 1: Prepare the environment
Complete the following steps to prepare the environment before you install the CPFS-POSIX client.
Ubuntu
Run the following command to install software dependencies:
apt-get -y install linux-headers-`uname -r` cpp gcc binutilsIf the message
Unable to locate packages linux-headersis returned, it indicates that the apt source does not have the required linux-headers package. You can download the package from the official Ubuntu website and install it.Run the following command to check if the linux-headers package version matches the kernel version:
dpkg -l | grep linux-headers-`uname -r`
CentOS
Run the following command to install software dependencies:
yum -y install kernel-devel-`uname -r` cpp gcc gcc-c++ binutilsIf the message
No package kernel-devel availableis returned, it indicates that the Yellowdog Updater, Modified (YUM) source does not have the required kernel-devel package. Run the uname -r command to check the kernel version. Then, download the corresponding kernel-devel package from the official CentOS website and install it.Run the following command to check the kernel version:
uname -rRun the following command to check if the kernel-devel package version matches the kernel version:
rpm -qa | grep kernel-devel-`uname -r`
Step 2: Configure the security group for the destination ECS instance
Obtain the security group information of the CPFS-POSIX control plane node ECS instance.
Log on to the NAS console.
In the navigation pane on the left, choose .
In the upper-left corner of the page, select the resource group and region where the destination file system resides.

Click the destination file system to go to its details page, and then click Mount Target.
In the Client Management node section, click the ID of the first ECS instance in the list to open its details page.
On the Instance Details page, click the Security Groups tab and record the Security Group ID/Name of the CPFS-POSIX control plane node.
The name of the control plane node security group is in the format of <FSID>-<GENID>-qr-sg.
<FSID> is the ID of the CPFS file system. <GENID> is the serial number of the mount target, which increments each time a CPFS mount target is created.
Add the security group of the CPFS-POSIX control plane node ECS instance to the destination ECS instance.
In the navigation pane on the left, choose Instances & Images > Instances.
On the Instances page, click the ID of the ECS instance on which you want to mount the CPFS file system. Click the Security Groups tab, and then click Change Security Group.
In the Change Security Group dialog box, select the security group of the control plane node (<FSID>-<GENID>-qr-sg) that you recorded from the Security Group drop-down list, and then click Confirm.
Step 3: Mount the file system
Connect to the ECS instance where the CPFS-POSIX client is installed. For more information, see Select a tool to connect to an instance.
You can find the ECS instance for the CPFS-POSIX client installation in the Client Management node section. The first ECS instance in the list is the default installation node. For more information, see View the information about a POSIX mount target.
Run the following command to install the CPFS-POSIX client on the destination ECS instances and add them to the client cluster.
cpfs add <Internal IP address of destination ECS 1> <Internal IP address of destination ECS 2> <Internal IP address of destination ECS 3>Example:
cpfs add 192.168.1.249 192.168.1.250 192.168.1.251NoteWhen you add ECS instances, enter their internal IP addresses.
Each client must have a unique hostname.
You can add one or more ECS instances. If you add multiple instances, separate their internal IP addresses with spaces.
The command execution time increases with the number of ECS instances that you add. It takes approximately 2 minutes to add a single ECS instance. We recommend that you run the command in the background using a tool such as screen or nohup.
Run the following command to confirm that the destination ECS instances are included in the node list.
Run the command
mmlsclusterSample output
Node Daemon node name IP address Admin node name Designation --------------------------------------------------------------------------------------------------------- 1 cpfs-001cb78****154e3-000001-qr-001 10.0.2.41 cpfs-001cb78****154e3-000001-qr-001 quorum-manager-perfmon 2 cpfs-001cb78****154e3-000001-qr-002 10.0.2.43 cpfs-001cb78****154e3-000001-qr-002 quorum-manager-perfmon 3 cpfs-001cb78****154e3-000001-qr-003 10.0.2.42 cpfs-001cb78****154e3-000001-qr-003 quorum-manager-perfmon 4 iZbp11iqkys8rl5cwa4**** 10.0.2.44 iZbp11iqkys8rl5cwa4**** perfmon
Optional: Query the default path.
After you add the destination ECS instances to the client control plane node, the file system is automatically mounted to the default path /cpfs/<FSID serial number>. You can run the mmlsfs <FSID serial number>-<GENID> -T command to query the default path.
Sample command
mmlsfs 001cb78****154e3-000001 -TSample output
flag value description ------------------- ------------------------ ----------------------------------- -T /cpfs/001cb78****154e3-000001 Default mount point
You can also run the mount --bind command to access the CPFS file system from a custom path.
mount --bind /cpfs/001cb78****154e3-000001 /mnt/test/cpfs/001cb78****154e3-000001 is the default mount path of the CPFS file system. /mnt/test is the custom mount path.
NoteCustom mount paths are not allowed on the CPFS file system installation node.
Subdirectory mounting is not supported.
After the file system is mounted, you can access it in the same way you access a local directory.
FAQ
For more information about frequently asked questions (FAQs) and solutions for mounting CPFS, see Mounting and access FAQ.