Create an E-HPC cluster with CPFS storage
This topic describes how to create a high-performance computing cluster with CPFS shared storage that provides high IOPS, high throughput, and low latency.
Background
CPFS (Cloud Paralleled File System) is a high-performance parallel file system designed for high-performance computing scenarios such as AI training and E-HPC, supporting throughput of up to tens of GB/s. Data in CPFS is stored on multiple data nodes and can be accessed by multiple clients simultaneously. This allows CPFS to provide high IOPS, high throughput, and low-latency data storage services for large-scale E-HPC clusters. For more information, see What is General-purpose CPFS?.
CPFS supports two billing methods: pay-as-you-go and resource plan. For more information, see Billing overview.
CPFS supports two mount methods: CPFS-NFS and CPFS-POSIX.
-
(Recommended) CPFS-NFS
CPFS supports access over the NFSv3 protocol. The NFS protocol provides excellent operating system compatibility and compute elasticity while delivering the powerful throughput of CPFS. For more information, see Quick start (CPFS-NFS) (Recommended).
-
CPFS-POSIX
CPFS supports access over the POSIX protocol. A POSIX client can connect to multiple storage nodes simultaneously and provides standard POSIX and MPI-IO interfaces for upper-layer applications. This delivers better performance and application interface compatibility. For more information, see Quick start (CPFS-POSIX).
For more information about the differences between the two methods, see Mount and access.
Limitations
|
Mount method |
Limitations |
|
CPFS-NFS |
The CPFS-NFS client is supported only on CentOS 7.x, CentOS 8.x, Ubuntu, Alibaba Cloud Linux 2, and Alibaba Cloud Linux 3 operating systems. |
|
CPFS-POSIX |
|
Procedure
Choose a method to mount the CPFS file system based on your business requirements.
CPFS-NFS
Step 1: Prepare resources
Activate CPFS, and then create a CPFS file system, a protocol service, and an export directory.
Step 2: Create a cluster and mount CPFS
-
Create an E-HPC cluster that mounts the CPFS file system.
For more information about how to create an E-HPC cluster, see Create a cluster by using the wizard.
When you create the cluster, take note of the following parameters:
-
Shared storage
-
File System Type: Select CPFS-NFS.
-
File System ID and Mount Target: Select the CPFS file system and mount point that you created.
-
-
Image:
-
Image type: Select Public image.
-
Image: Select an operating system image that is supported by the CPFS-NFS client.
-
-
-
After the cluster is created, log in to the cluster and verify that the CPFS file system is mounted.
-
Log in to the E-HPC cluster. For more information, see Log on to a cluster.
-
Run the
df -hcommand to check whether the CPFS file system is mounted.Output similar to the following indicates that the CPFS file system is mounted.
[root@manager ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 3.9G 34G 11% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 0 1.8G 0% /dev/shm tmpfs 1.8G 520K 1.8G 1% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup cpfs-022241b19f01c84b-02629599ec xxx.cn-shenzhen.cpfs.aliyuncs.com:/share/ 3.6T 432M 3.6T 1% /ehpcdata cpfs-022241b19f01c84b-02629599ec xxx.cn-shenzhen.cpfs.aliyuncs.com:/share/ehpc-sz-L5Vxxx/opt 3.6T 432M 3.6T 1% /opt cpfs-022241b19f01c84b-02629599ec xxx.cn-shenzhen.cpfs.aliyuncs.com:/share/ehpc-sz-L5Vxxx/home 3.6T 432M 3.6T 1% /home tmpfs 365M 0 365M 0% /run/user/0
-
CPFS-POSIX
Step 1: Prepare resources
-
Activate CPFS, create a CPFS file system, and add a mount point.
-
Create an ECS instance. For more information, see Create an instance by using the wizard.
This ECS instance is used to create a custom image that includes the CPFS-POSIX client. You can then use this custom image to create cluster nodes that automatically mount the CPFS file system.
NoteAfter the custom image is created, you can release the ECS instance.
When you create the ECS instance, take note of the following parameters:
-
Instance type: Select an instance type with at least 2 vCPUs and 4 GiB of memory to ensure that the CPFS-POSIX client runs properly.
-
Image: Select a CentOS 7.2, 7.3, 7.4, or 7.6 operating system, which the CPFS-POSIX client supports.
-
Network: The VPC and vSwitch must match those of the CPFS file system.
-
Public IP: Assign a public IPv4 address.
-
Security group: The security group must match that of the CPFS file system.
-
Step 2: Create a custom image
-
Log in to the ECS instance that you will use to create the custom image. For more information, see Log on to a Linux instance by using Workbench.
-
On the ECS instance, install the client and its dependencies.
-
Download and decompress the RPM (Red Hat Package Manager) packages.
mkdir /tmp/rpms cd /tmp/rpms wget https://gpfs-rpms.oss-cn-beijing.aliyuncs.com/CPFS2.2-CentOS.tar.gz tar xvfz CPFS2.2-CentOS.tar.gz -
Install the dependencies for the CPFS-POSIX client.
yum install -y cpp gcc gcc-c++ binutils ksh elfutils elfutils-devel rpm-build -
If the ECS instance runs CentOS 7.2, 7.3, or 7.4, install the corresponding version of kernel-devel.
-
Run the
uname -rcommand to view the kernel version.The following is a sample output:
Welcome to Alibaba Cloud Elastic Compute Service ! [root@iZbp xxx]# uname -r 3.10.0-514.26.2.el7.x86_64 -
Download the kernel-devel RPM package that corresponds to your kernel version from the CentOS website.
The following command is an example. Replace the package version based on your requirements.
wget https://buildlogs.centos.org/c7.1611.u/kernel/20170704132018/3.10.0-514.26.2.el7.x86_64/kernel-devel-3.10.0-514.26.2.el7.x86_64.rpm -
Install kernel-devel.
yum install kernel-devel-3.10.0-514.26.2.el7.x86_64.rpm -y
-
-
Run the following command to install the CPFS-POSIX client.
cd /tmp/rpms/CentOS/CentOS7 yum install -y gpfs.adv-*.x86_64.rpm gpfs.base-*.x86_64.rpm gpfs.docs-*.noarch.rpm gpfs.gpl-*.noarch.rpm gpfs.gskit-*.x86_64.rpm gpfs.gss.pmsensors-*.x86_64.rpm gpfs.license.dm-*.x86_64.rpm gpfs.msg.en_US-*.noarch.rpm
-
-
Run the following command to build the system.
/usr/lpp/mmfs/bin/mmbuildgplThe following output indicates a successful build. If no output is returned, run the command again.
make InstallImages ... -------------------------------------------------------------- mmbuildgpl: Building GPL module completed successfully at Tue May 23 11:08:22 CST 2023. -------------------------------------------------------------- -
Log in to the CPFS management node and obtain the relevant content from the /etc/hosts file.
-
Log in to the CPFS management node.
On the File System List page of the NAS console, click the ID of your CPFS file system to open its details page. Then, click POSIX Mounting to view the CPFS-POSIX client management nodes. By default, the name of the first ECS instance is in the format of
<CPFS file system ID>-000001-qr-001, for example,cpfs-027cc4bb7902****-000001-qr-001. This instance is the CPFS management node.In the table in the Client management nodes section, you can view the ECS instance ID, Private IP, and Initial password for each management node. Use these values to log in to the target management node.
-
Obtain the relevant content from the
/etc/hostsfile.cat /etc/hostsThe following is a sample output. Copy the first five lines.
[root@cpfs-027cc4 -qr-001 ~]# cat /etc/hosts 192.168.xxx cpfs-contact-node2 cpfs-contact-node2 #CPFS_192_168_0_210_MAGIC 192.168.xxx cpfs-contact-node1 cpfs-contact-node1 #CPFS_192_168_0_209_MAGIC 192.168.xxx cpfs-027cc4bb79xxx xxx001-qr-003 cpfs-027cc4bb7xxx xxx0001-qr-003 #CPFS_192_168_0_xxx_MAGIC 192.168.xxx cpfs-027cc4bb79xxx xxx001-qr-002 cpfs-027cc4bb7xxx xxx0001-qr-002 #CPFS_192_168_0_xxx_MAGIC 192.168.xxx cpfs-027cc4bb79xxx xxx001-qr-001 cpfs-027cc4bb7xxx xxx0001-qr-001 #CPFS_192_168_0_xxx_MAGIC ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.xxx localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.xxx cpfs-quorum-image-v2.0.02 cpfs-quorum-image-v2.0.02 192.168.xxx cpfs-027cc4bb79 xxx0001-qr-001 cpfs-027cc4bb7902 xxx001-qr-001 192.168.xxx cpfs-027cc4bb79 xxx0001-qr-001 cpfs-027cc4bb7902 xxx001-qr-001_MAGICTAG 192.168.xxx cpfs-027cc4bb79 xxx0001-qr-002 cpfs-027cc4bb7902 xxx001-qr-002_MAGICTAG 192.168.xxx cpfs-027cc4bb79 xxx0001-qr-003 cpfs-027cc4bb7902 xxx001-qr-003_MAGICTAG
-
-
On the ECS instance from which you want to create an image, run the following command to add the content retrieved from the CPFS management node to the /etc/hosts file.
vim /etc/hostsThe following is a sample of the content:
192.168.xxx.xxx cpfs-contact-node2 cpfs-contact-node2 #CPFS_192_168 MAGIC 192.168.xxx.xxx cpfs-contact-node1 cpfs-contact-node1 #CPFS_192_168 MAGIC 192.168.xxx.xxx cpfs-027cc4bl 001-qr-003 cpfs-027cc4bb7 3001-qr-003 #CPFS_192_168 MAGIC 192.168.xxx.xxx cpfs-027cc4bl 001-qr-002 cpfs-027cc4bb7 3001-qr-002 #CPFS_192_168 MAGIC 192.168.xxx.xxx cpfs-027cc4bl 001-qr-001 cpfs-027cc4bb7 3001-qr-001 #CPFS_192_168 MAGIC ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.x localhost localhost.localdomain localhost4 localhost4.localdomain4 -
Set up passwordless logon for the CPFS-POSIX client node.
-
Modify the configuration in the
/etc/ssh/ssh_configfile of the CPFS management node.vim /etc/ssh/ssh_configSet
StrictHostKeyCheckingtono. The following is an example:# Host * # ForwardAgent no # ForwardX11 no # PasswordAuthentication yes # HostbasedAuthentication no # GSSAPIAuthentication no # GSSAPIDelegateCredentials no # GSSAPIKeyExchange no # GSSAPITrustDNS no # BatchMode no # CheckHostIP yes # AddressFamily any # ConnectTimeout 0 StrictHostKeyChecking no # IdentityFile ~/.ssh/id_rsa # IdentityFile ~/.ssh/id_dsa # IdentityFile ~/.ssh/id_ecdsa -
Run the following command to copy the public key to the ECS instance from which you want to create the image.
In the command, replace
192.168.XX.XXwith the private IP address of the ECS instance.ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.XX.XX
-
-
Verify that the CPFS file system can be mounted on the ECS instance.
-
Log in to the CPFS management node and add the IP address and hostname of the ECS instance to the
/etc/hostsfile.vim /etc/hostsThe following is an example:
192.168.xxx cpfs-contact-node2 cpfs-contact-node2 #CPFS_192_168_xxx_MAGIC 192.168.xxx cpfs-contact-node1 cpfs-contact-node1 #CPFS_192_168_xxx_MAGIC 192.168.xxx cpfs-027cc4bb79xx 3001-qr-003 cpfs-027cc4bb79xx 001-qr-003 #CPFS_192_168_xxx_MAGIC 192.168.xxx cpfs-027cc4bb79xx 3001-qr-002 cpfs-027cc4bb79xx 001-qr-002 #CPFS_192_168_xxx_MAGIC 192.168.xxx cpfs-027cc4bb79xx 3001-qr-001 cpfs-027cc4bb79xx 001-qr-001 #CPFS_192_168_xxx_MAGIC ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.xxx cpfs-quorum-image-v2.0.02 cpfs-quorum-image-v2.0.02 192.168.xxx cpfs-027cc4bb79xx 01-qr-001 cpfs-027cc4bb7902x 001-qr-001 192.168.xxx cpfs-027cc4bb79xx 01-qr-001 cpfs-027cc4bb7902x 001-qr-001_MAGICTAG 192.168.xxx cpfs-027cc4bb79xx 01-qr-002 cpfs-027cc4bb7902x 001-qr-002_MAGICTAG 192.168.xxx cpfs-027cc4bb79xx 01-qr-003 cpfs-027cc4bb7902x 001-qr-003_MAGICTAG # The following is the added hostname mapping for the ECS instance 192.168.xxx iZwz97jbxifkjxxx -
On the CPFS management node, run the following commands to mount the CPFS file system on the ECS instance.
In the following commands, replace
192.168.XX.XXwith the private IP address of the ECS instance.mmaddnode -N 192.168.XX.XX mmchlicense client --accept -N 192.168.XX.XX mmchnode -N 192.168.XX.XX --perfmon mmstartup -N 192.168.XX.XX mmmount all -N 192.168.XX.XX -
Log in to the ECS instance and run the
df -hcommand to check whether the CPFS file system is mounted.Output similar to the following confirms the CPFS file system is mounted on the ECS instance. The instance environment is now ready for custom image creation.
[root@iZwz97jb* ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 3.4G 35G 9% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 0 1.8G 0% /dev/shm tmpfs 1.8G 416K 1.8G 1% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup 027cc4bb790276dd-000001 3.6T 496M 3.6T 1% /cpfs/027cc4lxxx...xxxjd-000001 tmpfs 365M 0 365M 0% /run/user/0
-
-
Unmount the CPFS file system before you create the custom image.
-
Log in to the CPFS management node and run the following commands to unmount the CPFS file system from the ECS instance.
In the following commands, replace
192.168.XX.XXwith the private IP address of the ECS instance.mmshutdown -N 192.168.XX.XX mmdelnode -N 192.168.XX.XX -
On the CPFS management node, delete the IP address and hostname of the ECS instance that you added to the
/etc/hostsfile. -
Log in to the ECS instance and run the
df -hcommand to confirm that the CPFS file system is unmounted.
-
-
Create a custom image from the ECS instance. For more information, see Create a custom image from an instance.
Step 3: Create a cluster and mount CPFS
-
Create an E-HPC cluster that mounts the CPFS file system.
For more information about how to create an E-HPC cluster, see Create a cluster by using the wizard.
When you create the cluster, take note of the following parameters:
-
Shared storage
-
File System Type: Select CPFS-POSIX.
-
File System ID and Mount Target: Select the CPFS file system and mount point that you created.
-
-
Image:
-
Image type: Select Custom image.
-
Image: Select the custom image that you created in the previous step.
-
-
-
After the cluster is created, log in to the cluster and verify that the CPFS file system is mounted.
-
Log in to the E-HPC cluster. For more information, see Log on to a cluster.
-
Run the
df -hcommand to check whether the CPFS file system is mounted.Output similar to the following indicates that the CPFS file system is mounted.
[root@manager ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/vda1 40G 4.9G 33G 13% / devtmpfs 1.8G 0 1.8G 0% /dev tmpfs 1.8G 0 1.8G 0% /dev/shm tmpfs 1.8G 500K 1.8G 1% /run tmpfs 1.8G 0 1.8G 0% /sys/fs/cgroup 327cc4bb790276dd-000001 3.6T 620M 3.6T 1% /opt tmpfs 365M 0 365M 0% /run/user/0
-