By creating an AnalyticDB for MySQL 3.0 data source, you can enable Dataphin to read business data from or write data to AnalyticDB for MySQL 3.0. This topic describes how to create an AnalyticDB for MySQL 3.0 data source.
Background information
AnalyticDB for MySQL (formerly known as AnalyticDB) is a cloud computing service developed by Alibaba for real-time high-concurrency online analysis of massive data. It enables you to perform instant multidimensional analysis and business exploration on trillions of data records in milliseconds. For more information, see AnalyticDB for MySQL - What is AnalyticDB for MySQL.
Permission requirements
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 AnalyticDB for MySQL 3.0.
If you have recently used AnalyticDB for MySQL 3.0, you can also select it from the Recently Used section. You can also enter keywords related to AnalyticDB for MySQL 3.0 in the search box to quickly find it.
On the Create AnalyticDB For MySQL 3.0 Data Source page, enter the data source information.
Configure the connection parameters between the data source and Dataphin.
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 Flink_SQL tasks 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 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
Enter a brief description of the data source. The description cannot exceed 128 characters.
Time Zone
Time format data in integration tasks will be processed based on the current time zone. The default time zone is Asia/Shanghai. Click Modify to select the target time zone. The options are as follows:
GMT: GMT-12:00, GMT-11:00, GMT-10:00, GMT-09:30, GMT-09:00, GMT-08:00, GMT-07:00, GMT-06:00, GMT-05:00, GMT-04:00, GMT-03:00, GMT-03:00, GMT-02:30, GMT-02:00, GMT-01:00, GMT+00:00, GMT+01:00, GMT+02:00, GMT+03:00, GMT+03:30, GMT+04:00, GMT+04:30, GMT+05:00, GMT+05:30, GMT+05:45, GMT+06:00, GMT+06:30, GMT+07:00, GMT+08:00, GMT+08:45, GMT+09:00, GMT+09:30, GMT+10:00, GMT+10:30, GMT+11:00, GMT+12:00, GMT+12:45, GMT+13:00, GMT+14:00.
Daylight Saving Time: Africa/Cairo, America/Chicago, America/Denver, America/Los_Angeles, America/New_York, America/Sao_Paulo, Asia/Bangkok, Asia/Dubai, Asia/Kolkata, Asia/Shanghai, Asia/Tokyo, Atlantic/Azores, Australia/Sydney, Europe/Berlin, Europe/London, Europe/Moscow, Europe/Paris, Pacific/Auckland, Pacific/Honolulu.
Data Source Configuration
Select the data source to configure:
If your business data source distinguishes between production and development data sources, select Production + Development Data Source.
If your 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 selected Production + Development Data Source for your data source configuration, you need to configure the connection information for both Production + Development Data Source. If you selected 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, reducing the impact of development data sources on production data sources. However, Dataphin also supports configuring them as the same data source with identical parameter values.
Parameter
Description
JDBC URL
The format of the connection address is
jdbc:mysql//host:port/dbname.Username, Password
The username and password of the database.
Configure advanced settings for the data source.
Parameter
Description
connectTimeout
The connectTimeout duration of the database (in milliseconds), default is 900000 milliseconds (15 minutes).
NoteIf you have included a connectTimeout configuration in the JDBC URL, the connectTimeout will be the timeout value configured in the JDBC URL.
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, indicating no timeout limit.
socketTimeout
The socketTimeout duration of the database (in milliseconds), default is 1800000 milliseconds (30 minutes).
NoteIf you have included a socketTimeout configuration in the JDBC URL, the socketTimeout will be the timeout value configured in the JDBC URL.
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, indicating no timeout limit.
Select 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 Connection Test or directly click OK to save and complete the creation of the AnalyticDB for MySQL 3.0 data source.
Click Connection Test to test if the data source can connect normally with Dataphin. If you directly click OK, the system will automatically test the connection for all selected clusters, but the data source can still be created normally even if all selected clusters fail to connect.
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 only used to test network connectivity with the current data source and are not used for running related tasks later.
The test connection usually takes less than 2 minutes. If it times out, you can click the
icon to view the specific reason and retry.Regardless of whether the test result is Connection Failed, Connection Successful, or Succeeded With Warning, the system will record the generation time 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, you can click the
icon to view the specific failure reason.When the test result is Succeeded With Warning, it means that the application cluster connection is successful but the scheduling cluster connection failed. The current data source cannot be used for data development and integration. You can click the
icon to view the log information.