Step 2: Creating Links

Description

Before migrating the local MySQL database to DWS, create two links:

  1. MySQL link: used to connect to the on-premises MySQL database.
  2. DWS link: used to connect to the DWS database.

CDM needs to access the on-premises data source. Therefore, before creating a link, bind an EIP to the CDM cluster.

Prerequisites

  • Your on-premises MySQL database can be accessed using the public IP address.
  • You have sufficient EIP quota.
  • You have obtained the IP address, port number, database name, username, and password for connecting to the MySQL database. In addition, the user must have the read, write, and delete permissions on the MySQL database.
  • You have a DWS instance and have obtained the IP address, port number, database name, username, and password for accessing DWS. Additionally, the account has the read, write, and delete permissions for the DWS database.

Creating a MySQL Link

  1. Log in to the CDM management console.
  2. In the left navigation pane, click Cluster Management. Locate the cdm-aff1 cluster created in Step 1: Creating a Cluster.
  3. In the Operation column, click Bind EIP, and select and bind an EIP to the cluster.

    Figure 1 Binding an EIP

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

  4. 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

  1. Select MySQL and click Next. On the page that is displayed, configure MySQL link parameters.

    Figure 3 Creating a MySQL link

    Click Show Advanced Attributes to display optional parameters. For details, see Link to Relational Databases. Retain the default values of the optional parameters and configure the mandatory parameters according to Table 1.

    Table 1 MySQL link parameters

    Parameter

    Description

    Example Value

    Name

    Unique link name

    mysqllink

    Database Server

    IP address or domain name of the MySQL database server

    192.168.0.1

    Port

    MySQL database port

    3306

    Database Name

    Name of the MySQL database

    sqoop

    Username

    User who has the read, write, and delete permissions on the MySQL database

    admin

    Password

    Password of the user

    -

    Use Agent

    Whether to extract data from the data source through an agent

    Yes

    Agent

    Click Select and select the agent created in Connecting to an Agent.

    -

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

    If an error occurs during the saving, the security settings of the MySQL database are incorrect. In this case, you need to enable the EIP of the CDM cluster to access the MySQL database.

Creating a DWS Link

  1. On the Link Management tab page, click Create Link and select Data Warehouse Service to create a DWS link.
  2. Click Next. The page for configuring the DWS link parameters is displayed. Configure the mandatory parameters according to Table 2 and retain the default values of the optional parameters.

    Table 2 DWS link parameters

    Parameter

    Description

    Example Value

    Name

    Unique link name

    dwslink

    Database Server

    IP address or domain name of the DWS database server

    192.168.0.3

    Port

    DWS database port

    8000

    Database Name

    Name of the DWS database

    db_demo

    Username

    User who has the read, write, and delete permissions on the DWS database

    dbadmin

    Password

    Password of the user

    -

    Use Agent

    Whether to extract data from the data source through an agent

    Yes

    Agent

    Click Select and select the agent created in Connecting to an Agent.

    -

    Import Mode

    COPY: Migrate the source data to the DWS management node and then copy the data to DataNodes. To access DWS through the Internet, select COPY.

    Copy

  3. Click Save.