Create a DM data source to enable Dataphin to read business data from or write data to DM.
Background information
DM is an OLTP database integrated into business systems. It combines the benefits of distributed systems, elastic computing, and cloud computing, and features flexibility, ease of use, reliability, and high security. To export Dataphin data to DM, you must first create a DM data source.
Permission requirements
Only users with the Create Data Source permission in a custom global role, or users with the super administrator, project administrator, domain architect, or datasource administrator system role can create data sources.
Procedure
-
In the top navigation bar of the Dataphin homepage, choose Management Center > Datasource Management.
-
On the Datasource page, click +Create Data Source.
-
On the Create Data Source page, select DM in the Relational Database section.
If you have recently used DM, you can also select DM in the Recently Used section. You can also enter the keyword DM in the search box to quickly find it.
-
On the Create DM Data Source page, configure the connection parameters.
-
Configure the basic information of the data source.
Parameter
Description
Datasource Name
The name must meet the following requirements:
-
It can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).
-
It cannot exceed 64 characters in length.
Datasource Code
After you configure the data source code, you can reference tables in the data source in Flink_SQL tasks by using the format
data_source_code.table_nameordata_source_code.schema.table_name. If you need to automatically access the data source in the corresponding environment based on the current environment, use the variable format${data_source_code}.tableor${data_source_code}.schema.table. For more information, see Dataphin data source table development method.ImportantThe data source code cannot be modified after it is configured.
You can preview data on the object details page in the asset directory and asset checklist only after the data source code is configured.
In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, SelectDB, and GaussDB data warehouse service (DWS) data sources are currently supported.
Data Source Description
A brief description of the data source. It cannot exceed 128 characters in length.
Data Source Configuration
Select the data source that you want to configure:
If your business data source distinguishes between production and development data sources, select Production + Development Data Source.
If your business data source does not distinguish between production and development data sources, select Production Data Source.
Tag
You can categorize and tag data sources using labels. For information on how to create tags, see Manage data source tags.
-
-
Configure the connection parameters between the data source and Dataphin.
If you selected Production + Development data source, configure the connection information for both environments. If you selected Production data source, configure only the production connection information.
NoteWe recommend configuring separate production and development data sources for environment isolation. However, Dataphin also supports using the same data source with identical parameter values for both environments.
Parameter
Description
Connection Method
Supports Single Server and Load Balancing connection methods. Select the appropriate method based on your DM data source deployment.
JDBC URL
The JDBC URL of the data source.
-
Single Server: The default format is
jdbc:dm://{server_address}:{port}/{database_name}. -
Load Balancing: If your DM data source is in cluster mode, you can enter the cluster mode address. The format is
jdbc:dm://servicename?servicename=({server_address}:{port},{server_address}:{port})&LOGIN_MODE={login_mode_code}.
Schema
Required. In a DM database, each user has a default schema with the same name as the username, as well as any manually created schemas.
Username, Password
The username and password used to log on to the database.
SSL Encryption
To establish an SSL-encrypted connection, Enable SSL encryption, Upload A Keystore Certificate, and enter the Keystore Certificate Password.
-
-
Configure advanced settings for the data source.
Parameter
Description
connectTimeout
The database connection timeout in milliseconds. Default: 900,000 milliseconds (15 minutes).
Note-
If you have included a connectTimeout configuration in the JDBC URL, the connectTimeout value from the JDBC URL will be used.
-
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, which means no timeout limit.
socketTimeout
The database socket timeout in milliseconds. Default: 1,800,000 milliseconds (30 minutes).
Note-
If you have included a socketTimeout configuration in the JDBC URL, the socketTimeout value from the JDBC URL will be used.
-
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, which means no timeout limit.
Connection Retry Count
If the database connection times out, the system automatically retries until the specified count is reached. If the connection still fails after all retries, it is considered failed.
Note-
The default retry count is 1. You can configure a value between 0 and 10.
-
The connection retry count will be applied by default to offline integration tasks and global quality (requires the Asset Quality feature module to be enabled). In offline integration tasks, you can configure task-level retry counts separately.
-
-
-
Select a Default Resource Group that will be used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.
-
Click Test Connection or directly click OK to save and complete the creation of the DM data source.
Clicking Test Connection tests whether the data source can connect to Dataphin. If you click OK directly, the system tests the connection for all selected clusters automatically. The data source is created even if all clusters fail the connection test.