Migrating Data from OSS to SFS

Scenario

SFS provides fully hosted file storage with complete share capabilities for ECSs. Compatible with the Network File System protocol, SFS is expandable to the petabyte range while ensuring top performance in data-intensive and bandwidth-intensive applications.

CDM allows you to directly migrate object storage data from a third-party cloud to SFS on HUAWEI CLOUD without forwarding or writing code.

This section describes how to use CDM to migrate data from OSS on Alibaba Cloud to SFS on HUAWEI CLOUD.

Figure 1 Migration principle

Mount the SFS file system to a directory of an ECS or your HPC cluster. CDM accesses the directory through the SFTP port. The procedure is as follows:

  1. Mounting the SFS File System to the ECS
  2. Creating a CDM Cluster and Binding an EIP to the Cluster
  3. Creating an SFTP Link
  4. Creating an OSS Link
  5. Creating a Migration Job
    • The CDM cluster, SFS file system, and ECS to which the SFS file system is mounted must be in the same VPC.
    • Currently, the SFS file system can be mounted to only the Linux ECS through the NFSv3 protocol. Therefore, the ECS must run on a Linux system.

Preparing Data

  • Endpoint for accessing OSS, for example, oss-cn-hangzhou.aliyuncs.com
  • AK, temporary credential, or security token for accessing OSS
  • Intranet access IP address, SFTP port number, username, and password for accessing the ECS

Mounting the SFS File System to the ECS

Run the following command on the ECS to mount the SFS file system to the ECS. For details, see Mounting a File System to ECSs (Linux).

cd /
mkdir sfs
mount -t nfs -o vers=3,timeo=600,nolock Shared path Local path

If the error message "wrong fs type" is displayed during the mount, the nfs-utils package is missing. Run the yum install –y nfs-utils command to install the package.

Creating a CDM Cluster and Binding an EIP to the Cluster

  1. The DGC basic package includes a CDM cluster. If the cluster cannot meet your requirements, you can buy a CDM incremental package to supplement the DGC basic instance. Create a CDM cluster. For details, see Buying a DGC Incremental Package. The key configurations are as follows:

    • Select the instance type based on the amount of data to be migrated. If the data volume is large, you are advised to select a cluster with a large size, for example, cdm.large.
    • The CDM cluster must be in the same VPC as the ECS and SFS file system. The subnet and security group rules ensure that they can communicate with each other.

  2. After the CDM cluster is created, on the Cluster Management page, click Bind EIP in the Operation column to bind an EIP to the cluster. The CDM cluster accesses Alibaba Cloud OSS through the public network.

    Data is uploaded to the cloud. You will not be billed for the uplink traffic. The EIP bandwidth is 10 Mbit/s.

    If SSL encryption is configured for the access channel of a local data source, CDM cannot connect to the data source using the EIP.

Creating an SFTP Link

  1. Click Job Management in the Operation column of the CDM cluster. On the page that is displayed, choose Link Management > Create Link. The page for selecting a connector is displayed. See Figure 2.

    Figure 2 Selecting a connector

  2. Select SFTP and click Next. On the page that is displayed, configure the SFTP link parameters. See Figure 3.

    • Name: Enter a link name.
    • Host Name/IP Address and Port: Set these parameters to the intranet access IP address and port number of the ECS.
    • Username and Password: Enter the username and password for accessing the ECS.
    Figure 3 Creating an SFTP link

  3. Click Save. The Link Management page is displayed.

Creating an OSS Link

  1. On the Link Management tab page, click Create Link. On the page that is displayed, select Alibaba Cloud OSS, click Next, and configure the required link parameters. See Figure 4.

    • Name: Enter a custom link name.
    • OSS Endpoint: Configure the endpoint of the data to be migrated. Select the endpoint based on the region where the bucket resides.
    • Authentication Method: Select an authentication method based on your needs, for example, Access key.
    • AK and SK: Enter the AK and SK used for logging in to OSS.
    • IP and domain Name Mapping: Configure the mapping between IP addresses and domain names.
    Figure 4 Creating an OSS link

  2. Click Save. The Link Management page is displayed.

Creating a Migration Job

  1. Choose Table/File Migration > Create Job to create a job for migrating data from OSS to SFS. See Figure 5.

    Figure 5 Creating a job for migrating data from OSS to SFS
    • Job Name: Enter a job name.
    • Source Job Configuration
      • Source Link Name: Select the OSS link created in Creating an OSS Link.
      • Bucket Name: Enter the name of an OSS bucket.
      • Source Directory/File: Enter an object name or prefix. If you enter an object prefix, all objects with the prefix are migrated.
      • File Format: Select Binary. This setting is used to copy files. To write files to databases, select CSV or JSON.
      • Retain the default values of the optional parameters in Show Advanced Attributes. For details, see Source OBS Parameters.
    • Destination Job Configuration
      • Destination Link Name: Select the SFTP link created in Creating an SFTP Link.
      • Write Directory: Enter the directory of the ECS the SFS file system is mounted to.
      • File Format: Select Binary. The value must be the same as that on the migration source.
      • Duplicate File Processing Method: Select Skip. CDM compares files before migrating them. If a file with the same name and size exists on the migration source and destination, CDM determines that the file is a duplicate file and skips it during the migration.
      • Retain the default values of other optional parameters. For details, see Destination FTP/SFTP/NAS/SFS Parameters.

  2. Click Next and set task parameters. When migrating data from OSS to SFS, you are advised to set Concurrent Extractors to 8, which indicates the number of concurrent jobs. If multiple files are being migrated, modify Concurrent Extractors to improve the migration performance. Retain the default values of other parameters. Retain the default values of other parameters.

    If you increase the value of Concurrent Extractors, you must also increase the maximum number of SSH connections on the ECS.
    1. Change the value of #MaxStartups 10:30:100 in /etc/ssh/sshd_config to MaxStartups 1000.
    2. Change #MaxSessions 10 in /etc/ssh/sshd_config to MaxSessions 1000.
    3. Run the service sshd restart command to restart the sshd process.
    Figure 6 Concurrent Extractors

  3. Click Save and Run. The Job Management page is displayed, on which you can view the job execution progress and result.
  4. After the job is successfully executed, in the Operation column of the job, click Historical Record to view the job's historical execution records and read/write statistics.

    On the Historical Record page, click Log to view the job logs.