This topic describes how to configure the source and destination connections in DataWorks to synchronize data.

Procedure

  1. Log on to the DataWorks console. In the left-side navigation pane, click Workspaces. On the page that appears, click Data Analytics in the Actions column corresponding to the target workspace.
  2. On the Data Analytics page, right-click Business Flow, and then select Create Workflow to create a workflow.
    Create a workflow
  3. Click the name of the created workflow, and then choose Data Integration > Batch Synchronization to create a data synchronization node.
    Create a node
  4. Double-click the created node. Configure parameters for Source (Reader) and Target (Writer) in the Connections section, and configure parameters in the Mappings and the Channel sections.
    Type Parameter Description
    Source Connection Select MySQL from the drop-down list. The connection name that you set when you Configure an ApsaraDB RDS for MySQL connection appears in the right-side drop-down list.
    Table Select a table in the ApsaraDB RDS for MySQL database.
    Filter The filter conditions for data synchronization. Filtering based on the limit keyword is not supported.
    Shard Key Specify the primary key of the ApsaraDB RDS for MySQL table as the shard key.
    Target Connection Select AnalyticDB for MySQL from the drop-down list. The connection name that you set when you Configure an AnalyticDB for MySQL connection appears in the right-side drop-down list.
    Table Select a table in the AnalyticDB for MySQL database to synchronize the data in the ApsaraDB RDS for MySQL table to this table.
    Statement Run Before Writing Enter the SQL statement to be executed before data synchronization.
    Statement Run After Writing Enter the SQL statement to be executed after data synchronization.
    Solution to Primary Key Violation Specify the data processing solution if the imported data conflicts with the primary key.
    Note Ensure that the field type is compatible with the data type when you map columns.
    Parameter Description
    Map Fields in the Same Line Automatically maps each source field to the destination field in the same row.
    Auto Layout After the mapping relationship is set, the fields are displayed in order.
    Parameter Description
    Expected Maximum Concurrency -
    Bandwidth Throttling Specifies whether to enable bandwidth throttling. You can enable this feature and set a maximum transmission rate to prevent heavy read pressure on the source database. We recommend that you enable bandwidth throttling and set the maximum transmission rate to an appropriate value.
    Dirty Data Records Allowed Automatically ends the data synchronization task if the number of dirty data entries exceeds the specified value.
    Resource Group -
  5. Click the Save icon and the Submit icon. Click the Properties tab to configure the parameters. For more information, see Configure recurrence and dependencies for a node.
  6. After you configure parameters on the Properties tab, click the Save icon and the Submit icon. Then, click the Run icon to start data synchronization.
  7. Log on to the AnalyticDB for MySQL console.
  8. Connect to the cluster and view the data synchronized from ApsaraDB RDS for MySQL. For more information, see Use DMS to connect to AnalyticDB for MySQL.

    After the data is imported to the AnalyticDB for MySQL database, you can use AnalyticDB for MySQL to analyze the data.