Help Center/ Scalable File Service Turbo/ Getting Started/ Mounting an SFS Turbo File System on Linux ECSs and Using It
Updated on 2024-11-05 GMT+08:00

Mounting an SFS Turbo File System on Linux ECSs and Using It

Scenarios

To use an SFS Turbo file system for file sharing, you need to create an SFS Turbo file system and mount it on multiple cloud servers.

This section describes how to create an NFS file system on the SFS Turbo console and mount it to Linux ECSs for file upload and download.

Operation Process

Procedure

Description

Making Preparations

Sign up for a HUAWEI ID, complete real-name authentication, enable Huawei Cloud services, and top up your account. Then, create a VPC and ECSs.

Step 1: Creating an SFS Turbo File System

Create an SFS Turbo file system.

Step 2: Mounting the SFS Turbo File System

Mount the SFS Turbo file system to the ECSs.

Step 3: Using the SFS Turbo File System

Use the SFS Turbo file system for file upload and download.

Making Preparations

  1. Sign up for Huawei Cloud and complete real-name authentication.

    Sign up for a HUAWEI ID, enable Huawei Cloud services, and complete real-name authentication.

    If you have enabled Huawei Cloud services and completed real-name authentication, skip this step.

  2. Top up your account.

    Ensure that your account has sufficient balance. For details, see Topping Up an Account.

  3. Check whether a VPC and ECSs need to be created.

    Before creating an SFS Turbo file system, check whether a VPC and ECSs are available, and whether the ECSs are in this VPC. If the ECSs are not in the available VPC, you can establish communication between SFS Turbo and ECSs using VPC peering connections.

  4. Create a VPC.

    Create a VPC by referring to Creating a VPC in the Virtual Private Cloud User Guide.

  5. Create ECSs.

    Create ECSs in the available VPC by referring to Purchasing and Logging In to a Linux ECS.

Step 1: Creating an SFS Turbo File System

File systems are containers that store files in SFS Turbo. You need to create an SFS Turbo file system before storing data in it.

This example only covers some key parameters settings. Retain the default values for other parameters. For more information, see Creating a File System.

  1. Log in to SFS Turbo console SFS Turbo console.
  2. Select the region where the ECSs are deployed. A file system can only be mounted to an ECS when they are in the same region and VPC. Select CN-Hong Kong.

    1. Assume that your company has already purchased ECSs in the CN-Hong Kong region.
    2. Assume that all the company's ECSs are in the vpc-3114 VPC.
    3. For the detailed creation procedure, see Creating a File System.

  3. Click Create File System.

  4. Configure the file system parameters, which are described in the following table.

    Parameter

    Example Value

    Description

    Billing Mode

    Pay-per-use

    Select a billing mode, Yearly/Monthly or Pay-per-use. For the detailed billing standards, see Product Pricing Details.

    Region

    CN-Hong Kong

    Region of the tenant. Select a region from the drop-down list in the upper left corner of the page.

    Select the region where the ECSs reside.

    AZ

    AZ1

    An AZ is a geographical area with an independent network and an independent power supply.

    For low network latency, you are advised to select the same AZ where the ECSs reside.

    Type

    40 MB/s/TiB

    The following types are supported:

    • Standard
    • Standard-Enhanced (Discontinued)
    • Performance
    • Performance-Enhanced (Discontinued)
    • 20 MB/s/TiB
    • 40 MB/s/TiB
    • 125 MB/s/TiB
    • 250 MB/s/TiB
    • 500 MB/s/TiB
    • 1,000 MB/s/TiB
    NOTE:

    After a file system is created, its type cannot be changed. If you want to change the type, you need to create another file system. So, plan the file system type in advance.

    Capacity (TB)

    3.6

    Maximum capacity allowed for a single file system. When the used capacity of a file system reaches this value, no more data can be written to the file system. You need to expand the file system capacity. The capacity of an SFS Turbo file system cannot be reduced. Set an appropriate file system capacity based on your service needs.

    Supported ranges:
    • Standard: 500 GB to 32 TB
    • Performance: 500 GB to 32 TB
    • Standard-Enhanced (Discontinued): 10 TB to 320 TB
    • Performance-Enhanced (Discontinued): 10 TB to 320 TB
    • 20 MB/s/TiB: 3.6 TB to 1 PB
    • 40 MB/s/TiB: 1.2 TB to 1 PB
    • 125 MB/s/TiB: 1.2 TB to 1 PB
    • 250 MB/s/TiB: 1.2 TB to 1 PB
    • 500 MB/s/TiB: 1.2 TB to 1 PB
    • 1,000 MB/s/TiB: 1.2 TB to 1 PB

    Bandwidth (MB/s)

    150

    Defines the cache bandwidth, which is recommended for workloads with frequent reads but infrequent writes. The higher the bandwidth, the larger the capacity required.

    • If you select the 20 MB/s/TiB, 40 MB/s/TiB, 125 MB/s/TiB, 250 MB/s/TiB, 500 MB/s/TiB, or 1,000 MB/s/TiB file system type, this parameter and its value will show up. Bandwidth size = Capacity x Bandwidth density (type value). The minimum bandwidth is 150 MB/s. If the calculated bandwidth is less than 150, 150 MB/s will be used. For the maximum bandwidths, see File System Types.
    • If you select the Standard-Enhanced (Discontinued), Standard, Performance-Enhanced (Discontinued), or Performance type, this parameter will not show up.
    NOTE:

    The read/write speed is affected by the number of clients that mount the file system. For details, see How Do I Make the Most Out of My SFS Turbo File System?

    VPC

    -

    Select a VPC and a subnet.

    • VPC: An ECS cannot access file systems in a different VPC. Select the VPC to which the ECSs reside.
    • Subnet: A subnet is a unique IP address range in a VPC. A subnet provides dedicated network resources that are logically isolated from other networks to improve network security.
    NOTE:

    To achieve the optimal network performance, select the VPC where your ECSs reside. You can also use VPC peering connections to connect two or more VPCs to share files between VPCs.

    When a file system is accessed across VPCs, the latency, bandwidth, and IOPS loss may be high. Therefore, intra-VPC access is recommended.

    For details about VPC peering connections, see VPC Peering Connection.

    Enterprise Project

    default

    This function is provided for enterprise users. When creating a file system, you can add the file system to an existing enterprise project.

    An enterprise project makes it easy to manage projects and groups of cloud resources and users. Use the default enterprise project or create one.

    Select an enterprise project from the drop-down list.

    Name

    sfs-turbo-b6a6

    User-defined file system name.

    NOTE:

    The name must start with a letter and can contain only letters, digits, underscores (_), and hyphens (-). It must contain more than four characters but no more than 64 characters.

  5. Click Create Now.
  6. Confirm the file system information and click Submit.
  7. When the creation is complete, go back to the file system list. If the status of the created file system is Available, the file system has been created. If the status is Creation failed, contact the administrator.

Step 2: Mounting the SFS Turbo File System

After creating an SFS Turbo file system, you need to mount it to ECSs so that they can share the file system.

  1. Log in to the ECS as user root. You can log in to an ECS using the console or a remote access tool (such as PuTTY).

  2. Install the NFS client.

    1. Install the NFS client.
      1. Check whether the NFS software package is installed in the system (CentOS is used in this example).
        rpm -qa|grep nfs
        If information similar to the following is displayed, the NFS software package has been installed and you can go to 3. If not, go to 2.a.ii.
        libnfsidmap
        nfs-utils

      2. Install the client.
        sudo yum -y install nfs-utils

        The commands require that the ECSs be connected to the Internet. Or, the installation will fail.

  3. Check whether the domain name in the file system shared path can be resolved.

    nslookup File system domain name
    • The file system domain name is in the format of xxx.sfsturbo.internal (variable xxx is the file system ID). You can obtain the file system domain name from the file system shared path.
    • If the nslookup command cannot be used, you can run yum install bind-utils to install the bind-utils software package.
    • If the resolution succeeds, go to 4.
    • If the resolution fails, configure the DNS server IP address and then mount the file system. For details, see Configuring DNS.

  4. Create a local path for mounting the file system.

    mkdir Local path

    If any other resources, such as a disk, have been mounted on the local path, create a new path. (NFS clients do not refuse repeated mounts. If there are repeated mounts, information of the last successful mount is displayed.)

  5. Mount the file system to the ECSs in the same VPC as the file system. You can mount the file system to Linux ECSs using NFSv3 only.

    Run the following command to mount an SFS Turbo file system:

    mount -t nfs -o vers=3,timeo=600,noresvport,nolock,tcp Shared path Local path

    Parameter

    Example Value

    Description

    vers

    3

    File system version. Only NFSv3 is supported currently.

    timeo

    600

    Waiting time before the NFS client retransmits a request. The unit is 0.1 second.

    noresvport

    -

    Whether the NFS client uses a new TCP port when it re-establishes a network connection to the NFS server.

    It is strongly recommended that you specify noresvport, which ensures that your file system remains uninterrupted after a network reconnection or recovery.

    lock/nolock

    -

    Whether to use the NLM protocol to lock files on the server. If nolock is specified, the lock is valid only for applications on the same host. It is invalid for applications on any other hosts. The recommended value is nolock. If this parameter is not specified, lock is used by default. Then, other servers cannot write data to the file system.

    proto

    tcp

    Protocol used by NFS clients to send requests to the server. You can use either UDP or TCP.

    General Purpose File System does not support UDP. Therefore, you need to set proto to tcp for General Purpose File Systems.

    Shared path

    xxx.sfsturbo.internal:/

    For a Standard-Enhanced, Standard, Performance-Enhanced, or Performance file system, the format is File system IP address:/, for example, 192.168.0.0:/.

    For a 20 MB/s/TiB, 40 MB/s/TiB, 125 MB/s/TiB, 250 MB/s/TiB, 500 MB/s/TiB, or 1,000 MB/s/TiB file system, the format is File System domain name:/, for example, xxx.sfsturbo.internal:/.

    NOTE:
    • Variable x is a digit or letter.
    • If the shared path is too long to display completely, you can adjust the column width.

    Local path

    /local_path

    Local path on the ECS used to mount the file system.

  6. View the mounted file system.

    mount -l
    If the command output contains the following information, the file system has been mounted.
    Shared path on /local_path type nfs (rw,vers=3,timeo=600,nolock,addr=)

For the detailed mount procedure, see Mounting an NFS File System to ECSs (Linux).

Step 3: Using the SFS Turbo File System

After the file system is mounted, you can use it on the ECS as if using an ordinary directory, for example, read data from or write data to the file system.

  1. Remotely connect to the ECS and run the following commands to write data to the SFS Turbo file system:

    # /mnt/sfs is the local mount point (local path).
    mkdir /mnt/sfs/dir1
    touch /mnt/sfs/file1
    echo 'hello sfs' > /mnt/sfs/file2

  2. Remotely connect to the ECS and run the following command to read data from the SFS Turbo file system:

    ls /mnt/sfs

    If information similar to the following is displayed, the SFS Turbo file system can be accessed using NFS.

Helpful Links

After creating and mounting an SFS Turbo file system, you can use the following functions as needed:

  • Backup: You can back up SFS Turbo file systems using CBR. If your file system fails or encounters a logical error (like accidental deletion, hacker attack, and virus), you can use file system backups to quickly restore data.
  • Capacity expansion: If your file system capacity is insufficient, you can increase the file system size by expanding capacity.