Migrating Data from OBS to DLI

Scenario

DLI is a fully hosted big data query service. This section describes how to use CDM to migrate data from OBS to DLI. The procedure includes four steps:

  1. Creating a CDM Cluster
  2. Creating a DLI Link
  3. Creating an OBS Link
  4. Creating a Migration Job

Prerequisites

  • You have subscribed to OBS and DLI.
  • You have created resource queues, databases, and tables on DLI.

Creating a CDM Cluster

Select operation parameters according to the actual conditions.

  • If you already have a DGC cluster that meets the requirement, click Job Management in the row of the cluster and create links on the page that is displayed.
  • If you do not have a cluster that meets the requirement, you can buy DGC incremental packages for batch migration to supplement the basic packages. See for details.See Buying an Incremental Package for details.

    In this scenario, if the CDM cluster is used only to migrate data from OBS to DLI and does not need to migrate data of other data sources, there is no special requirements on the VPC, subnet, and security group of the CDM cluster. You can specify them based on your needs. CDM accesses DLI and OBS through the intranet. CDM accesses DLI and OBS through the intranet. The flavor of the CDM cluster is selected based on the amount of data to be migrated. Generally, cdm.medium meets the requirements of most migration scenarios.

Creating a DLI 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 1.

    Figure 1 Selecting a connector

  2. Select Data Lake Insight, click Next, and configure the DLI link parameters. See Figure 2.

    Figure 2 Creating a DLI link

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

Creating an OBS Link

  1. On the Link Management tab page, click Create Link. On the page displayed, select HUAWEI CLOUD OBS, click Next, and configure the required link parameters. See Figure 3.

    • Name: Enter a custom link name, for example, obslink.
    • OBS Server and Port: Enter the actual OBS address information.
    • AK and SK: Enter the AK and SK used for logging in to OBS.
    Figure 3 Creating an OBS 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 OBS to DLI. See Figure 4.

    Figure 4 Creating a job for migrating data from OBS to DLI
    • Job Name: Enter a custom job name.
    • Source Link Name: Select the obslink link created in Creating an OBS Link.
      • Bucket Name: Select the bucket the data will be migrated from.
      • Source Directory/File: Set this parameter to the path where the data to be migrated is.
      • File Format: Select CSV or JSON for transferring files to a data table.
      • Retain the default values of the optional parameters in Show Advanced Attributes. For details, see Source OBS Parameters.
    • Destination Link Name: Select the dlilink link created in Creating a DLI Link.
      • Resource Queue: Enter the resource queue the destination table belongs to.
      • Database Name: Enter the name of the database the data will be written to.
      • Table Name: Enter the name of the table the data will be written to. CDM cannot automatically create tables on DLI. The table must be created on DLI in advance, and the field types and formats of the table must be consistent with those of the data to be migrated.
      • Clear Before Importing Data: Choose whether to clear data in the destination table before data import. In this example, the default value is retained.

  2. Click Next. The Map Field page is displayed. CDM automatically matches the source and destination fields.

    • If the field mapping is incorrect, you can drag the fields to adjust the mapping.
    • CDM supports field conversion during the migration. For details, see Field Conversion.

  3. Click Next and set task parameters. Generally, you can retain the default values for all parameters.

    In this step, you can configure the following optional functions:
    • Retry Upon Failure: If the job fails, you can determine whether to automatically retry the job. Retain the default value Never.
    • Group: Select which group the job belongs to. The default group is DEFAULT. On the Job Management page, jobs can be displayed, started, or exported by group.
    • Schedule Execution: To configure scheduled jobs, see Scheduling Job Execution. Retain the default value No.
    • Concurrent Extractors: Enter the number of extractors to be executed concurrently. Retain the default value 1. The maximum number of concurrent extractors in a single job is 500.
    • Write Dirty Data: Specify this parameter if data that fails to be processed or filtered out during job execution needs to be written to OBS for future viewing. Before writing dirty data, create an OBS link. Retain the default value No so that dirty data is not recorded.
    • Delete Job After Completion: Retain the default value Do not delete.

  4. Click Save and Run. The Job Management page is displayed, on which you can view the job execution progress and result.
  5. 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.