This topic describes how to create an InfluxDB data source, which enables Dataphin to write data to InfluxDB.
Permissions
To create data sources, you must have a custom global role with the New Data Source permission point or one of the following system roles: Super Administrator, Data Source Administrator, Plate Architect, or Project Administrator.
Procedure
In the top navigation bar of the Dataphin homepage, choose Management Center > Data Source Management.
On the Data Sources page, click + New Data Source.
On the New Data Source page, in the NoSQL section, select InfluxDB.
If you have recently used InfluxDB, you can select it from the Recently Used section. You can also use the search box to find it.
On the New InfluxDB Data Source page, configure the connection parameters.
Configure the basic information for the data source.
Parameter
Description
Data Source Name
Enter a name for the data source. The name must meet the following requirements:
Can contain only Chinese characters, uppercase or lowercase letters, digits, underscores (_), and hyphens (-).
Cannot exceed 64 characters in length.
Data Source Code
The Data Source Code allows you to directly access Dataphin data source tables in Flink SQL jobs or via the Dataphin JDBC client. Use the format
data_source_code.tableordata_source_code.schema.tableto reference tables. If you need to automatically switch data sources based on the job execution environment, use the variable format${data_source_code}.tableor${data_source_code}.schema.table. For more information, see Develop Flink SQL jobs.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.
Version
Currently, only version 2.x is supported.
Data Source Description
Enter a description for the data source. The description can be up to 128 characters long.
Data Source Configuration
Select the environment type for the data source:
If your business data source distinguishes between production and development environments, select Production + Development Data Source.
If your business data source does not distinguish between production and development environments, select Production Data Source.
Tags
You can use tags to classify and label the data source. To create tags, see Manage data source tags.
Configure the connection parameters.
If you selected Production + Development Data Source in the previous step, configuration sections for both environments are displayed. If you selected Production Data Source, only the configuration section for the production data source is displayed.
NoteTypically, you should configure the production and development data sources as separate instances. This isolates the environments and prevents development activities from impacting the production environment. However, you can also use the same data source for both by providing identical parameter values.
Parameter
Description
Connection URL
The HTTP connection URL for InfluxDB v2. For example:
http://host:8086.Authentication Token
The API token for authentication with InfluxDB v2.
Organization
The organization name in InfluxDB v2.
Bucket
The bucket name in InfluxDB v2.
Configure Advanced Settings.
Parameter
Description
connectTimeout
The database connection timeout in milliseconds. The default value is 900000 (15 minutes).
NoteIf the JDBC URL contains a connectTimeout setting, the value from the JDBC URL is used.
For data sources created in Dataphin versions earlier than v3.11, the default
connectTimeoutis-1, which means no timeout.
socketTimeout
The database socket timeout in milliseconds. The default value is 1800000 (30 minutes).
NoteIf the JDBC URL contains a socketTimeout setting, the value from the JDBC URL is used.
For data sources created in Dataphin versions earlier than v3.11, the default
socketTimeoutis-1, which means no timeout.
Select the Default Resource Group. This resource group runs tasks related to the data source, such as SQL execution, offline full database migration, and data preview.
Click Test Connection to verify the settings, or click OK to save the configuration and create the data source.
Clicking Test Connection verifies the connection to the data source. If you click OK directly, the system performs this test automatically. The data source is created even if the connection test fails.
ImportantIf the connection test fails, see Network connectivity solutions to troubleshoot the issue.
If the connection test returns a
VPC_GRANT_ACCESS_API_ERRORerror, see Solution for the VPC_GRANT_ACCESS_API_ERROR error.