This topic describes how to install a Cloud Paralleled File System (CPFS) agent on Ubuntu and CentOS. It also describes how to mount a CPFS file system.

Background information

POSIX-based APIs are available for CPFS file systems. You can use one or more of these APIs to mount a CPFS file system. You can install tailored CPFS agents on Ubuntu or CentOS.

Preparations

Before you install a CPFS agent on Ubuntu and CentOS, complete the following preparations.

  • If you want to install a CPFS agent on CentOS, complete the following preparations.
    1. Install dependency packages in the following order: make, gcc, libyaml-devel, libtool, zlib-devel, glibc-headers, and kernel-devel.
      yum install -y make gcc libyaml-devel libtool zlib-devel glibc-headers dkms expect
    2. Install the kernel-devel dependency package.
      yum install -y kernel-devel-`uname -r`
      Note
      • Ensure that the version of the kernel-devel package to be installed is the same as that of the kernel.
      • In yum repositories, if all the kernel-devel packages whose versions are different from that of the kernel, use the uname -r command to confirm the kernel version. Then, visit the Official CentOS website to download the required kernel-devel package.
  • If you want to install a CPFS agent on Ubuntu, complete the following preparations.
    1. Verify that the kernelheader tool is installed.
      dpkg -l | grep 'linux-headers'  |grep `uname -r`

      If the version number of the linux-headers tool is returned, it indicates that the kernelheader tool is installed.

    2. Update the dkms tool.
      apt-get update
      apt-get install -y dkms
    3. Install dependency packages.
      apt-get install -y libyaml-dev libsnmp-dev

      If a message showing The following packages have unmet dependencies is returned, use the apt --fix-broken install command to fix the issue.

    4. Uninstall lustre-related packages.

      If the lustre tool is installed, uninstall the tool.

      dpkg -l | grep lustre
      dpkg -e <lustre pkg>

      After the tool is uninstalled, use the following command to check whether the lustre directory exists.

      ls /lib/modules/`uname -r`/kernel/drivers/staging/lustre

      If the directory exits, use the mv /lib/modules/`uname -r`/kernel/drivers/staging/lustre ~/backup command to delete the directory.

CentOS

  1. Use the following command to download a CPFS agent.
    wget https://cpfs-client.oss-cn-beijing.aliyuncs.com/centos/cpfs-client-latest.el7.tar.gz
  2. Use the following commands to install a CPFS agent.
    tar -zxvf cpfs-client-latest.el7.tar.gz
    rpm -ivh cpfs-client-dkms-*.el7.noarch.rpm
    rpm -ivh cpfs-client-2.10.8-*.el7.x86_64.rpm

    After the installation is complete, use the dkms status command to view the status.

    Note If the WARNING message is returned from the dkms status command, contact Alibaba Cloud Technical Support for further assistance.
  3. Use the vim /etc/cpfs/cpfs-mounts.conf command to edit the cpfs-mounts.conf configuration file. Add the following information about the file system and local directory on which you want to mount the file system to the configuration file.
    cpfs-xxx.cn-shanghai.cpfs.nas.aliyuncs.com@tcp:cpfs-xxx.cn-shanghai.cpfs.nas.aliyuncs.com@tcp:/xxx /mnt localflock

    In the configuration file, each line contains the information about a mount target for a file system and a local directory on which you want to mount the file system. You can obtain the details of a mount target from the Apsara File Storage NAS console and specify a local directory on which you want to mount a file system. In most cases, specify a subdirectory that resides in the /mnt directory.

  4. Use the service cpfs-client start command to start the CPFS service.
    Note
    • View the status of the CPFS service: service cpfs-client status
    • Stop the CPFS service: service cpfs-client stop
    • If you no longer use CPFS, use the service cpfs-client stop command to stop the CPFS service on an Elastic Compute Service (ECS) instance. Then, use the rpm -e cpfs-client and rpm -e cpfs-client-dkms commands to uninstall the CPFS agent.

Ubuntu

  1. Download the installation package from the official website.
    • If Ubuntu16.04 is running, use the following command to download the package.
      wget https://cpfs-client.oss-cn-beijing.aliyuncs.com/ubuntu/cpfs-client-ubuntu1604_amd64_latest.tar.gz
    • If Ubuntu 18.04 is running, use the following command to download the package.
      wget https://cpfs-client.oss-cn-beijing.aliyuncs.com/ubuntu/cpfs-client-ubuntu1804_amd64_latest.tar.gz
  2. Decompress the package.
    • If Ubuntu16.04 is running, use the following command to decompress the package.
      tar -xf cpfs-client-ubuntu1604_amd64_latest.tar.gz
    • If Ubuntu 18.04 is running, use the following command to decompress the package.
      tar -xf cpfs-client-ubuntu1804_amd64_latest.tar.gz
  3. Install the cpfs-client-dkms package.
    dpkg -i cpfs-client-dkms_*_amd64.deb

    After the installation is complete, use the dkms status command to view the status.

    Note If the WARNING message is returned from the dkms status command, contact Alibaba Cloud Technical Support for further assistance.
  4. Use the following command to install the cpfs-client package.
    dpkg -i cpfs-client_*_amd64.deb
  5. Use the vim /etc/cpfs/cpfs-mounts.conf command to edit the cpfs-mounts.conf configuration file. Add the following information about the file system and local directory on which you want to mount the file system to the configuration file.
    cpfs-xxx.cn-shanghai.cpfs.nas.aliyuncs.com@tcp:cpfs-xxx.cn-shanghai.cpfs.nas.aliyuncs.com@tcp:/xxx /mnt localflock

    In the configuration file, each line contains the information about a mount target for a file system and a local directory on which you want to mount the file system. Obtain the details of a mount target from the Apsara File Storage NAS console and specify a local directory on which you want to mount a file system. In most cases, specify a subdirectory that resides in the /mnt directory.

  6. Use the service cpfs-client start command to start the CPFS service.
    Note
    • View the status of the CPFS service: service cpfs-client status
    • Stop the CPFS service: service cpfs-client stop
    • If you no longer use CPFS, use the service cpfs-client stop command to stop the CPFS service on an ECS instance. Then, use the rpm -e cpfs-client and rpm -e cpfs-client-dkms commands to uninstall the CPFS agent.