Create a PolarDB-X data source to allow Dataphin to read business data from or write data to PolarDB-X.
Background information
PolarDB-X (upgraded version of DRDS) is a cloud-native distributed database developed by Alibaba Cloud. It provides high throughput, large storage capacity, low latency, easy scalability, and ultra-high availability for cloud-era workloads. To connect PolarDB-X to Dataphin for data development, you must first create a PolarDB-X data source.
Limits
Only PolarDB-X 1.0 data sources are supported.
Permission description
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
-
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, in the Relational Database section, select PolarDB-X (formerly DRDS).
If you have recently used PolarDB-X, you can also select PolarDB-X in the Recently Used section. You can also enter PolarDB-X keywords in the search box to quickly filter.
-
On the Create PolarDB-X (formerly DRDS) Data Source page, configure the parameters for connecting to the data source.
-
Configure the basic information of the data source.
Parameter
Description
Datasource Name
Enter a name for the data source. 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 access Dataphin data source tables in Flink_SQL tasks or through the Dataphin JDBC client by using the format
data source code.table nameordata source code.schema.table namefor quick consumption. To automatically switch data sources based on the task execution 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 brief description of the data source. Maximum length: 128 characters.
Data Source Configuration
Select the data source configuration type:
-
If the business data source uses separate production and development environments, select Production + Development Data Source.
-
If the business data source does not use separate environments, select Production Data Source.
Tag
You can categorize data sources by 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 Data Source Configuration, you need to configure the connection information for both environments. If you select Production Data Source, you only need to configure the connection information for the production environment.
NoteWe recommend that you configure the production and development data sources as different data sources to isolate the development environment from the production environment. However, Dataphin also supports configuring them as the same data source with identical parameter values.
Parameter
Description
JDBC URL
The connection address format is
jdbc:mysql://host:port/dbname.Username, Password
The username and password used to log in to the database.
-
Configure advanced settings for the data source.
Parameter
Description
connectTimeout
The connection timeout duration in milliseconds. Default value: 900000 (15 minutes).
Note-
If a connectTimeout value is specified in the JDBC URL, that value takes precedence.
-
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, indicating no timeout limit.
socketTimeout
The socket timeout duration in milliseconds. Default value: 1800000 (30 minutes).
Note-
If a socketTimeout value is specified in the JDBC URL, that value takes precedence.
-
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, indicating no timeout limit.
Connection Retries
When a database connection times out, Dataphin automatically retries until the configured retry limit is reached. If the connection still fails after all retries, the connection attempt fails.
Note-
The default retry count is 1. Valid values: 0 to 10.
-
Connection retries apply by default to offline integration tasks and global quality (requires the asset quality module to be enabled). In offline integration tasks, you can configure task-level retry counts separately.
-
-
-
Select Default Resource Group, which is used to run tasks related to the current data source, including database SQL, offline full database migration, data preview, and more.
-
Perform a Test Connection or directly click OK to save and complete the creation of the PolarDB-X data source.
Click Test Connection to verify whether the data source can connect to Dataphin. If you click OK directly, the system automatically tests the connection for all selected clusters. Even if all clusters fail the connection test, the data source can still be created.
Test Connection tests the connection for the Default Cluster or Registered Scheduling Clusters that have been registered in Dataphin and are in normal use. The Default Cluster is selected by default and cannot be deselected. If there are no resource groups under a Registered Scheduling Cluster, connection testing is not supported. You need to create a resource group first before testing the connection.
-
The selected clusters are used only to test network connectivity and are not used for running tasks.
-
The test connection usually completes within 2 minutes. If it times out, click the
icon to view the reason and retry. -
Regardless of the test result (Connection Failed, Connection Successful, or Succeeded With Warning), the system records the timestamp of the final result.
NoteOnly the test results for the Default Cluster include three connection statuses: Succeeded With Warning, Connection Successful, and Connection Failed. The test results for Registered Scheduling Clusters in Dataphin only include two connection statuses: Connection Successful and Connection Failed.
-
When the test result is Connection Failed, click the
icon to view the failure reason. -
When the test result is Succeeded With Warning, the application cluster connection succeeded but the scheduling cluster connection failed. The data source cannot be used for data development and integration. Click the
icon to view the log information.
-