Create a GaussDB(DWS) data source to enable Dataphin to read business data from or write data to GaussDB(DWS).
Permissions
Only custom global roles with the Create Data Source permission and system roles such as super administrator, data source administrator, domain architect, and project administrator can create data sources.
Procedure
-
On the Dataphin homepage, choose Management Center > Datasource Management from the top navigation bar.
-
On the Datasource page, click +Create Data Source.
-
In the Relational Database section of the Create Data Source page, select GaussDB(DWS).
If you have recently used GaussDB(DWS), you can also select GaussDB(DWS) in the Recently Used section. You can also quickly search for GaussDB(DWS) by entering keywords in the search box.
-
On the Create GaussDB(DWS) Data Source page, configure the parameters for connecting to the data source.
-
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 directly access Dataphin data source tables in the format of
data_source_code.tableordata_source_code.schema.tablewhen creating Flink SQL tasks or using the Dataphin JDBC client for quick consumption. If you need to automatically switch data sources based on the task execution environment, access them in the format of${ds_code}.tableor${ds_code}.table.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 description of the data source. Maximum length: 128 characters.
Data Source Configuration
Select whether the business data source separates production and development environments:
-
If the business data source distinguishes between production and development data sources, select Production + Development Data Source.
-
If the business data source does not distinguish between production and development data sources, select Production Data Source.
Tag
You can categorize and tag data sources based on tags. For information about 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, configure the connection information for both environments. If you select Production Data Source, configure the connection information for the production environment only.
NoteWe recommend that you configure separate data sources for production and development to achieve environment isolation. However, Dataphin also supports using the same data source with identical parameter values for both environments.
For Configuration Method, you can choose either JDBC URL or Host. The default selection is JDBC URL.
JDBC URL configuration method
Parameter
Description
JDBC URL
The format of the connection URL is
jdbc:opengauss://host:port/dbname. For example:jdbc:opengauss://192.168.**.1:5432/dataphin.Schema
Enter the schema associated with the username.
Username, Password
The username and password used to log on to the database.
Host configuration method
-
Host configuration method
Parameter
Description
Server Address
Enter the IP address and port number of the server.
You can click +Add to add multiple sets of IP addresses and port numbers, and click the
icon to delete excess IP addresses and port numbers, but you must keep at least one set.dbname
Enter the database name.
-
Parameter configuration
Parameter
Description
Parameter
-
Parameter name: You can select an existing parameter name or enter a custom parameter name.
Custom parameter names can only contain letters, digits, periods (.), underscores (_), and hyphens (-).
-
Parameter value: When a parameter name is selected, the parameter value is required. It can only contain letters, digits, periods (.), underscores (_), and hyphens (-), and cannot exceed 256 characters in length.
NoteYou can add multiple parameters by clicking +Add Parameter, and delete excess parameters by clicking the
icon. You can add up to 30 parameters.Schema
Enter the schema associated with the username.
Username, Password
The username and password used to log on to the GaussDB database.
-
NoteIf you switch from the Host configuration method to the JDBC URL method after data source creation, the system automatically concatenates the server IP address and port number into a JDBC URL.
-
-
Configure advanced settings for the connection between the data source and Dataphin.
Parameter
Description
connectTimeout
The connection timeout period in seconds. Default value: 900 (15 minutes).
Note-
If you have a connectTimeout configuration in the JDBC URL, the connectTimeout will be the timeout period configured in the JDBC URL.
-
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, which means no timeout limit.
socketTimeout
The socket timeout period in seconds. Default value: 1800 (30 minutes).
Note-
If you have a socketTimeout configuration in the JDBC URL, the socketTimeout will be the timeout period configured in the JDBC URL.
-
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, which means no timeout limit.
Connection Retry Count
The number of automatic retries when a database connection times out. If the maximum retry count is reached and the connection still fails, the task reports a connection failure.
Note-
The default retry count is 1, and 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 function module to be enabled). In offline integration tasks, you can configure task-level retry counts separately.
-
NoteRules for duplicate parameter values:
-
If a parameter exists simultaneously in JDBC URL, Advanced Settings parameters, and Host Configuration method's parameter configuration, the value in the JDBC URL takes precedence.
-
If a parameter exists simultaneously in JDBC URL and Advanced Settings parameters, the value in the JDBC URL takes precedence.
-
If a parameter exists simultaneously in Advanced Settings parameters and Host Configuration method's parameter configuration, the value in the Advanced Settings parameters takes precedence.
-
-
Select a Default Resource Group, which is used to run tasks related to the current data source, including database SQL, offline database migration, data preview, and more.
-
Perform a Test Connection or directly click OK to save and complete the creation of the GaussDB(DWS) data source.
Click Test Connection to verify connectivity between the data source and Dataphin. If you click OK directly, the system tests the connection for all selected clusters automatically. The data source is created even if the connection test fails.