By creating an openGauss data source, you can enable Dataphin to read business data from openGauss or write data to openGauss. This topic describes how to create an openGauss data source.
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.
If you have recently used openGauss, you can also select openGauss in the Recently Used section. You can also enter keywords in the search box to quickly search for openGauss.
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 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
The description of the openGauss data source. The description cannot exceed 128 characters in length.
Data Source Configuration
Based on whether the business data source distinguishes between 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 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 configuration is Production data source, you only need to configure the connection information for the Production data source.
NoteIn most cases, the production data source and development data source should be configured as different data sources to isolate the development environment from the production environment and reduce the impact of the development data source on the production data source. However, Dataphin also supports configuring them as the same data source with identical parameter values.
For Configuration Method, you can select JDBC URL or Host. The default value 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 the connection until the specified number of retries is reached. If the connection still fails after the maximum number of retries, the connection fails.
NoteThe 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.
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.