Updated on 2022-09-23 GMT+08:00

Link to a Database Shard

Sharding refers to the link to multiple backend data sources at the same time. The link can be used as the job source to migrate data from multiple data sources to other data sources. Table 1 lists the link parameters.
Table 1 Parameters for a link to a database shard

Parameter

Description

Example Value

Name

Link name, which should be defined based on the data source type, so it is easier to remember what the link is for

my_link

Username

Username used for accessing the database

For a backend database A, this configuration takes effect only when no username and password are configured for A in the data source list. For a backend database B that has configured the username and password, this configuration does not takes effect.

cdm

Password

Password used for accessing the database.

For a backend database A, this configuration takes effect only when no username and password are configured for A in the data source list. For a backend database B that has configured the username and password, this configuration does not takes effect.

-

Use Agent

Whether to extract data from the data source through an agent

Yes

Agent

Click Select and select the agent created in Managing Agents.

-

backendDatasource

Enter the type of the backend database. Currently, only MySQL is supported.

MySQL

Data Source List

Enter the IP address, port number, database name, account name, and password of the backend database, and separate them with colons (:). That is, ip:port:dbs:username:password. You can leave username:password empty. In this case, the username and password are used.

If there are multiple backend databases, ensure that the table structures are the same and use vertical bars (|) to separate data sources. If the password contains a vertical bar (|) or colon (:), use a backslash (\) to escape the vertical bar.

For example, 192.168.2.1:3306:cdm|192.168.2.2:3306:cdm:user:password indicates that the IP address of the first backend database is 192.168.2.1, the port number is 3306, the database name is cdm, and the account name and password are configured in user and password. The IP address of the second backend database is 192.168.2.2, the port number is 3306, the database name is cdm, the account name is user and the password is password.

192.168.2.1:3306:cdm|192.168.2.2:3306:cdm:user:password

Fetch Size

(Optional) Displayed when you click Show Advanced Attributes.

Number of rows obtained by each request. Set this parameter based on the data source and the job's data size. If the value is either too large or too small, the job may run for a long time.

1000

Link Attributes

(Optional) Click Add to add the JDBC connector attributes of multiple specified data sources. For details, see the JDBC connector document of the corresponding database.

sslmode=require

Reference Sign

(Optional) Delimiter between the names of the referenced tables or columns. For details, see the product documentation of the corresponding database.

'