By creating a GBase 8a data source, you can enable Dataphin to read business data from GBase 8a or write data to GBase 8a. This topic describes how to create a GBase 8a data source.
Limits
Only custom global roles with the Create Data Source permission and the system roles super administrator, data source administrator, domain architect, and project administrator 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 Create Data Source page, in the Relational Database area, select GBase 8a.
If you have recently used GBase 8a, you can also select GBase 8a in the Recently Used section. You can also quickly search for GBase 8a by entering keywords in the search box.
On the Create GBase 8a 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 reference tables in the data source in a Flink_SQL node 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 Development method for Dataphin data source tables.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 GBase 8a data source. It 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 using 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 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.
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.
For Configuration Method, you can select 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:gbase://hosy:port/dbname. For example:jdbc:gbase://192.168.*.212:5258/dataphin.Username and Password
The username and password that are used to access 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. 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.
Custom parameter names can contain only letters, digits, periods (.), underscores (_), and hyphens (-).
Parameter value: When a parameter name is selected, the parameter value is required. It 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 excess parameters. You can add up to 30 parameters.Username, Password
The username and password used to log on to the GBase 8a database.
NoteWhen the configuration method is set to Host and the data source creation is complete, if you need to switch to the JDBC URL configuration method, the system will concatenate the server IP address and port number into a JDBC URL.
Configure advanced settings for the data source.
Parameter
Description
socketTimeout
The socketTimeout duration of the database in milliseconds. The default value is 1,800,000 milliseconds (30 minutes).
NoteIf you have configured socketTimeout in the JDBC URL, the socketTimeout value in the JDBC URL takes precedence.
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, which indicates no timeout limit.
connectTimeout
The connectTimeout duration of the database in milliseconds. The default value is 900,000 milliseconds (15 minutes).
NoteIf you have configured connectTimeout in the JDBC URL, the connectTimeout value in the JDBC URL takes precedence.
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, which indicates no timeout limit.
Connection Retries
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 configure a value between 0 and 10.
The connection retry count is applied by default to offline integration nodes and global quality (requires the Asset Quality feature module to be enabled). You can separately configure the retry count at the node level for offline integration nodes.
NoteRules for duplicate parameters:
If a parameter exists in the JDBC URL, Advanced Settings, and Host Configuration parameter settings, the value in the JDBC URL takes precedence.
If a parameter exists in both the JDBC URL and Advanced Settings, the value in the JDBC URL takes precedence.
If a parameter exists in both the Advanced Settings and Host Configuration parameter settings, the value in the Advanced Settings 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, data preview, and more.
Click Test Connection or directly click OK to save and complete the creation of the GBase 8a 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.