By creating a DM data source, you can enable Dataphin to read business data from DM or write data to DM. This topic describes how to create a DM data source.
Background information
DM is an OLTP database that is integrated into business systems. The DM database incorporates advanced technical concepts and advantages of mainstream database products, combining the benefits of distributed systems, elastic computing, and cloud computing. It features flexibility, ease of use, reliability, and high security. If you use DM and want to export Dataphin data to DM, you need to first create a DM data source.
Permission requirements
Only users who have the Create Data Source permission point in a custom global role or users who have 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 successfully.
After the data source code is configured successfully, you can preview data on the object details page in the asset directory and asset inventory.
In Flink SQL, only MySQL, Hologres, MaxCompute, Oracle, StarRocks, Hive, and SelectDB 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 select Production + Development data source for your data source configuration, you need to configure the connection information for the Production + Development data source. If your data source is configured as Production data source, you only need to configure the connection information for the Production data source.
NoteTypically, production and development data sources should be configured as separate data sources to achieve environment isolation and reduce the impact of development activities on production. However, Dataphin also supports configuring them as the same data source with identical parameter values.
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
Enter the JDBC URL address 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
Schema is required. In a DM database, a user has both a default schema with the same name as the username and manually created schemas.
Username, Password
The username and password used to log on to the database.
SSL Encryption
If you need to establish an encrypted connection using SSL, you need to 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 duration in milliseconds. The default is 900,000 milliseconds (15 minutes).
NoteIf 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 duration in milliseconds. The default is 1,800,000 milliseconds (30 minutes).
NoteIf 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 will automatically retry the connection until the specified retry count is reached. If the connection still fails after the maximum number of retries, the connection is considered failed.
NoteThe 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.
When you click Test Connection, the system tests whether the data source can connect to Dataphin properly. If you directly click OK, the system automatically tests the connection for all selected clusters. However, even if all selected clusters fail the connection test, the data source can still be created normally.