By creating an AnalyticDB for MySQL 2.0 data source, you can write data from Dataphin to AnalyticDB for MySQL 2.0. This topic describes how to create an AnalyticDB for MySQL 2.0 data source.
Background information
AnalyticDB for MySQL is Alibaba Cloud's cloud-native data warehouse built on a data lakehouse architecture that provides real-time data warehousing capabilities. It is highly compatible with MySQL and supports millisecond-level updates and sub-second queries. If you are using AnalyticDB for MySQL, you need to create an AnalyticDB for MySQL data source before connecting to Dataphin for data development. For more information about AnalyticDB for MySQL, 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, select AnalyticDB for MySQL 2.0 in the Relational Database section.
If you have recently used AnalyticDB for MySQL 2.0, you can also select it from the Recently Used section. You can also enter keywords related to AnalyticDB for MySQL 2.0 in the search box to quickly find it.
On the Create AnalyticDB For MySQL 2.0 Data Source page, configure the connection parameters.
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 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
A brief description of the data source. It cannot exceed 128 characters.
Time Zone
The time zone is used to process time format data in integration tasks. The default time zone is Asia/Shanghai. Click Modify to select a target time zone from the following options:
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 on 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 between development and production, reducing the impact of development activities on production. 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). The default is 900000 milliseconds (15 minutes).
NoteIf you have included a connectTimeout configuration in the JDBC URL, the connectTimeout will be the timeout period configured in the JDBC URL.
For data sources created before Dataphin V3.11, the default connectTimeout is
-1, which means no timeout limit.
socketTimeout
The socketTimeout duration of the database (in milliseconds). The default is 1800000 milliseconds (30 minutes).
NoteIf you have included a socketTimeout configuration in the JDBC URL, the socketTimeout will be the timeout period configured in the JDBC URL.
For data sources created before Dataphin V3.11, the default socketTimeout is
-1, which means no timeout limit.
Select a 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 Test Connection or directly click OK to save and complete the creation of the AnalyticDB for MySQL 2.0 data source.
Click Test Connection to test whether the data source can connect normally to Dataphin. If you directly click OK, the system will automatically test the connection for all selected clusters. However, even if all selected clusters fail the connection test, the data source can still be created normally.