Step |
Description |
Reference |
---|---|---|
Create an elastic resource pool |
Create an elastic resource pool and configure basic information, such as the billing mode, CU range, and CIDR block. |
|
Add a queue to the elastic resource pool |
Add the queue where your jobs will run on to the elastic resource pool. The operations are as follows:
|
|
(Optional) Create an enhanced datasource connection. |
If a job needs to access data from other data sources, for example, GaussDB(DWS) and RDS, you need to create a datasource connection. The created datasource connection must be bound to the elastic resource pool. |
|
Run a job. |
Create and submit the job as you need. |
For details about how to create an elastic resource pool, see Creating an Elastic Resource Pool.
For SQL: The queue is used to run Spark SQL jobs.
For general purpose: The queue is used to run Flink and Spark Jar jobs.
In this example, a datasource connection is required to connect to RDS. You need to create a datasource connection. If your job does not need to connect to an external data source, skip this step.
CREATE TABLE `tabletest2` ( `id` int(11) unsigned, `name` VARCHAR(32) ) ENGINE = InnoDB DEFAULT CHARACTER SET = utf8mb4;
Click OK. The security group rule is added.
If you cannot decide the elastic resource pool in this step, you can skip this parameter, go to the Enhanced tab, and click More > Bind Resource Pool in the Operation column of the row that contains this datasource connection after it is created.
Click OK. Click the name of the created datasource connection to view its status. You can perform subsequent steps only after the connection status changes to Active.
Run a Flink SQL jab on a queue in an elastic resource pool.
CREATE SINK STREAM car_info (id INT, name STRING) WITH ( type = "rds", region = "", /* Change the value to the current region ID. */ 'pwd_auth_name'="xxxxx", // Name of the datasource authentication of the password type created on DLI. If datasource authentication is used, you do not need to set the username and password for the job. db_url = "mysql://192.168.x.x:3306/test2", /* The format is mysql://floating IP address:port number of the RDS database/database name. */ table_name = "tabletest2" /* Table name in RDS database */ ); INSERT INTO car_info SELECT 13, 'abc';