AnalyticDB for MySQL nodes in DataWorks allow you to develop tasks, run them on a schedule, and integrate them with other jobs.
Prerequisites
-
An AnalyticDB for MySQL cluster has been purchased. For more information, see Create a cluster.
-
A workflow has been created.
DataStudio organizes development operations by workflow. Create a workflow before you create a node. For more information, see Create a workflow.
-
An AnalyticDB for MySQL (V3.0) computing resource has been bound to DataStudio.
To access and develop data in your AnalyticDB for MySQL database, add it as a computing resource to DataWorks and bind the resource to DataStudio.
-
A serverless resource group (recommended) or an exclusive resource group for scheduling has been purchased.
Background information
AnalyticDB for MySQL is an analytical database service provided by Alibaba Cloud. For more information, see What is AnalyticDB for MySQL?
Step 1: Create an AnalyticDB for MySQL node
Log on to the DataWorks console. In the target region, click in the left-side navigation pane. Select a workspace from the drop-down list and click Go to Data Development.
-
Right-click the workflow and choose .
-
In the Create Node dialog box, enter a Name for the node and click OK. The node's configuration tab opens, where you can develop and configure the task.
Step 2: Develop an AnalyticDB for MySQL task
Select a computing resource (optional)
If your workspace has multiple AnalyticDB for MySQL computing resources, select the one you want to use on the node configuration tab. If only one is available, it is used by default.
Develop SQL code
Write SQL code in the code editor of the AnalyticDB for MySQL node. Example:
SHOW TABLES;
Step 3: Configure task scheduling
To run the task on a schedule, click Scheduling in the right-side pane of the node configuration tab to configure its scheduling properties. For more information about the configurations, see Configure scheduling properties for a node.
You must set the Rerun attribute and Parent Nodes properties for the node before you commit it.
Step 4: Debug the task code
Debug the code to verify that the task runs as expected.
-
(Optional) Select a resource group for running the task and assign values to custom parameters.
-
Click the
icon in the toolbar. In the Parameter dialog box, select the resource group to use for debugging. -
If your code uses scheduling parameters, assign values to them for debugging. For more information about the value assignment logic, see Debug an auto-triggered node.
-
-
Save and run the SQL statements.
Click the
icon in the toolbar to save the SQL statements, and then click the
icon to run the SQL task. -
(Optional) Perform smoke testing.
To verify that the scheduled task runs as expected in the development environment, you can perform smoke testing when you commit the node or anytime after. For more information, see Perform smoke testing.
Step 5: Commit and deploy the task
After you configure the node, commit and deploy it. Once deployed, the task runs on the schedule defined in its scheduling properties.
-
Click the
icon in the toolbar to save the task. -
Click the
icon in the toolbar to commit the task.In the Submission dialog box, enter a Change Description for the change. You can also specify whether to perform code review after the commit.
Note-
Before committing the task, you must set the node's Rerun attribute and Parent Nodes properties.
-
Code review helps ensure code quality and prevents faulty code from being deployed to the production environment. If you enable code review, a reviewer must approve the committed code before it can be deployed. For more information, see Code review.
-
If your workspace is in standard mode, after committing the task, click Deploy in the upper-right corner of the node configuration tab to deploy it to the production environment. For more information, see Deploy tasks.
Next steps
After a task is deployed, it runs according to its schedule. To view the run status, click O&M Personnel in the upper-right corner of the node configuration tab. For more information, see View and manage auto-triggered tasks.