DolphinScheduler is a distributed and extensible open source workflow orchestration platform with powerful Directed Acyclic Graph (DAG) visual interfaces. DolphinScheduler can help you efficiently run and manage workflows for large amounts of data. You can use DolphinScheduler to schedule XIHE SQL jobs of AnalyticDB for MySQL to improve data processing efficiency.
Prerequisites
DolphinScheduler installed. For more information, see DolphinScheduler documentation.
A MySQL driver of V8.0.0 or later is configured in the installation directory of DolphinScheduler. For information about the download link, see mysql-connector-java.
The IP address of the server that runs DolphinScheduler is added to an IP address whitelist of an AnalyticDB for MySQL cluster. For more information, see IP address whitelists.
Procedure
Create a data source.
Access the DolphinScheduler web interface. In the top navigation bar, click Datasource.
Click Create DataSource. In the Choose DataSource Type dialog box, select MYSQL.
In the CreateDataSource dialog box, configure the parameters that are described in the following table.
Parameter
Description
DataSource
Select MYSQL.
Datasource Name
The name of the data source.
IP
The endpoint of the AnalyticDB for MySQL cluster. You can log on to the AnalyticDB for MySQL console and go to the Cluster Information page to view the endpoint.
Port
The port number of the AnalyticDB for MySQL cluster. Set the value to 3306.
User Name
The name of the database account of the AnalyticDB for MySQL cluster.
Database Name
The name of the database of the AnalyticDB for MySQL cluster.
NoteOther parameters are optional. For more information, see MySQL.
Click Test Connect. After the data source passes the connection test, click Confirm.
Create a project.
In the top navigation bar, click Project.
Click Create Project.
In the Create Project dialog box, configure the parameters such as Project Name and Owned Users. For more information, see Project.
Create a workflow.
Click the name of the created project. In the left-side navigation pane, choose Workflow > Workflow Definition to go to the Workflow Definition page.
Click Create Workflow to go to the workflow DAG edit page.
In the left-side list of the page, select SQL and drag it to the right-side canvas.
In the Current node settings dialog box, configure the parameters that are described in the following table.
Parameter
Description
Datasource types
Select MYSQL.
Datasource instances
Select the data source that is created in Step 1.
SQL Type
The type of the SQL job. Valid values: Query and Non Query.
SQL Statement
The SQL statement.
Click Confirm.
In the upper-right corner of the page, click Save. In the Basic Information dialog box, configure the parameters such as Workflow Name.
Click Confirm.
Run the workflow.
Find the created workflow and click the
icon in the Operation column to publish the workflow.
Click the
icon in the Operation column.
In the Please set the parameters before starting dialog box, configure the parameters.
Click Confirm to run the workflow.
View the details about the workflow.
In the left-side navigation pane, choose Task > Task Instance.
Find the tasks of the workflow and click the
icon in the Operation column to view the execution results and logs of the workflow.