Create an openGauss data source to enable Dataphin to read business data from or write data to openGauss.
Permission requirements
Only users who have the Create Data Source permission in a custom global role and users who have the super administrator, data source administrator, domain architect, or project administrator system role can create data sources.
Procedure
-
On the Dataphin homepage, choose Management Hub > 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 openGauss.
You can also select openGauss from the Recently Used section, or enter keywords in the search box to find it quickly.
-
On the Create OpenGauss 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:
-
The name can contain only Chinese characters, letters, digits, underscores (_), and hyphens (-).
-
The name 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
data source code.table nameordata source code.schema.table nameformat. 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 description of the data source. Maximum length: 128 characters.
Data Source Configuration
Select a configuration mode based on whether your business separates production and development data sources:
-
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 parameters for connecting the data source to Dataphin.
If you selected Production + Development data source, configure connection information for both environments. If you selected Production data source, configure connection information for the production environment only.
NoteWe recommend that you configure separate data sources for production and development to isolate the two environments. However, Dataphin also supports using the same data source with identical parameter values for both.
For Configuration Method, select JDBC URL or Host. The default is JDBC URL.
JDBC URL configuration method
Parameter
Description
JDBC URL
The format of the connection URL is
jdbc:opengauss://host:port/dbname. Example:jdbc:opengauss://192.168.**.1:5432/dataphin.Username And 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 extra IP addresses and port numbers. At least one set must be retained.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.
A custom parameter name can contain only letters, digits, periods (.), underscores (_), and hyphens (-).
-
Parameter value: When a parameter name is selected, the parameter value is required. The parameter value can contain only letters, digits, periods (.), underscores (_), and hyphens (-), and cannot exceed 256 characters in length.
NoteYou can click +Add Parameter to add multiple parameters, and click the
icon to delete extra parameters. You can add a maximum of 30 parameters.Username, Password
The username and password used to log on to the openGauss database.
-
NoteIf you select Host as the configuration method and complete the creation of the data source, and then switch to the JDBC URL configuration method, the system will concatenate the IP address and port number of the server to form a JDBC URL.
-
-
Configure advanced settings for connecting the data source to Dataphin.
Parameter
Description
Connection Retry Count
If the database connection times out, the system automatically retries until the specified retry count is reached. If all retries fail, the connection attempt fails.
Note-
The default number of retries is 1. You can set a value between 0 and 10.
-
The connection retry count applies to offline integration tasks and global quality (requires the asset quality feature to be enabled). You can separately configure the retry count at the task level in offline integration tasks.
-
NoteRules for duplicate parameters:
-
If a parameter exists in the JDBC URL, Advanced Settings parameters, and Host configuration method's parameter configuration, the value in the JDBC URL takes precedence.
-
If a parameter exists in both the JDBC URL and Advanced Settings parameters, the value in the JDBC URL takes precedence.
-
If a parameter exists in both the Advanced Settings parameters and Host configuration method's parameter configuration, the value in the Advanced Settings parameters takes precedence.
-
-
Select a Default Resource Group. This resource group is used to run tasks related to the current data source, including database SQL, offline database migration, and data preview.
-
Click Test Connection or directly click OK to save and complete the creation of the openGauss data source.
Clicking Test Connection verifies 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.