You can create an AnalyticDB for MySQL node and use SQL statements to develop data for the AnalyticDB for MySQL data source. This topic describes how to create and use an AnalyticDB for MySQL node.

Prerequisites

  • DataWorks of the required edition is activated, the required data source is purchased, and an AnalyticDB for MySQL compute engine instance is associated with the workspace.
    • DataWorks Standard Edition or a more advanced edition is activated. For more information, see DataWorks advanced editions.
    • An AnalyticDB for MySQL cluster is created. For more information, see Create a cluster.
    • An AnalyticDB for MySQL compute engine instance is associated with the workspace on the Workspace Management page. For more information, see Configure a workspace.
  • A resource group is created.

    An exclusive resource group for scheduling is created. For more information, see Create an exclusive resource group for scheduling.

  • A data source is prepared.

    An AnalyticDB for MySQL data source is added. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

Background information

AnalyticDB for MySQL is an analytical database of Alibaba Cloud. For more information, see What is AnalyticDB for MySQL?

Limits

  • An AnalyticDB for MySQL compute engine instance can be associated only with a DataWorks workspace of the Standard Edition or a more advanced edition.
  • AnalyticDB for MySQL nodes can run only on exclusive resource groups for scheduling.
  • An AnalyticDB for MySQL node can be used to develop data for an AnalyticDB for MySQL data source that is added by using the connection string mode or by associating an AnalyticDB for MySQL compute engine instance with a workspace. You can go to the Data Source page, find the desired data source, and then click Edit in the Operation column to view the mode that was used to add the data source. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

Create an AnalyticDB for MySQL node and use the node to develop data

  1. Go to the DataStudio page.
    1. Log on to the DataWorks console.
    2. In the left-side navigation pane, click Workspaces.
    3. In the top navigation bar, select the region where your workspace resides, find the workspace, and then click Data Analytics in the Actions column.
  2. Create a workflow.
    If you have a workflow, skip this step.
    1. Move the pointer over the Create icon and select Workflow.
    2. In the Create Workflow dialog box, set the Workflow Name parameter.
    3. Click Create.
  3. Create an AnalyticDB for MySQL node.
    1. On the DataStudio page, move the pointer over the Create icon and choose AnalyticDB for MySQL > ADB for MySQL.
      You can also find the newly created workflow, right-click the workflow name, and then choose Create > AnalyticDB for MySQL > ADB for MySQL.
    2. In the Create Node dialog box, set the Node Name, Node Type, and Location parameters.
      Note The node name must be 1 to 128 characters in length and can contain letters, digits, underscores (_), and periods (.).
    3. Click Commit. Then, the configuration tab of the AnalyticDB for MySQL node appears.
  4. Use the AnalyticDB for MySQL node to develop data.
    1. Select a data source.
      Select the desired AnalyticDB for MySQL data source from the Select Data Source drop-down list. If no AnalyticDB for MySQL data source is available, click Add Data Source and add an AnalyticDB for MySQL data source on the Data Source page. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.
      Note
      • If you associate an AnalyticDB for MySQL compute engine instance with a workspace, the system automatically creates an AnalyticDB for MySQL data source. The system uses the data source to develop data by default. You can also select the desired data source.
      • An AnalyticDB for MySQL node can be used to develop data for an AnalyticDB for MySQL data source that is added by using the connection string mode or by associating an AnalyticDB for MySQL compute engine instance with a workspace. You can go to the Data Source page, find the desired data source, and then click Edit in the Operation column to view the mode that was used to add the data source. For more information, see Configure an AnalyticDB for MySQL 3.0 connection.

    2. Use SQL statements to create a task.
      1. Enter SQL statements in the SQL editor to create a task. SQL editorIn this example, the following statement is used to query tables in the data source. You can enter SQL statements that you want to execute based on the syntax supported by AnalyticDB for MySQL and your business requirements.
        show tables;
      2. Select a resource group.
        In the top toolbar, click the Run with Parameters icon. In the Parameters dialog box, select the created exclusive resource group for scheduling.
        Note
        • You must use an exclusive resource group for scheduling that is connected to the data source. For more information, see Select a network connectivity solution.
        • If you want to change the resource group in subsequent operations, you can also perform the change in the Parameters dialog box.
      3. Save and execute the SQL statement.

        In the top toolbar, click the Save icon to save the compiled SQL statement. Then, click the Run icon to execute the SQL statement.

        The following figure shows the results. Results
  5. Configure properties for the AnalyticDB for MySQL node.
    If you want the system to periodically run the AnalyticDB for MySQL node, you can click Properties in the right-side navigation pane to configure properties for the node based on your business requirements.
  6. Commit and deploy the MySQL node.
    1. Click the Save icon in the top toolbar to save the node.
    2. Click the Submit icon in the top toolbar to commit the node.
    3. In the Commit Node dialog box, enter your comments in the Change description field.
    4. Click OK.
    If you use a workspace in standard mode, you must deploy the node in the production environment after you commit the node. Click Deploy in the upper-right corner. For more information, see Deploy nodes.
  7. View the MySQL node.
    1. On the editing tab of the MySQL node, click Operation Center in the upper-right corner to go to Operation Center.
    2. View the scheduled MySQL node. For more information, see View auto triggered nodes.