Create an Elasticsearch data source to enable Dataphin to write data to Elasticsearch.
Background information
Alibaba Cloud Elasticsearch is a fully managed Elasticsearch cloud service built on open-source Elasticsearch. It is widely used for real-time log analysis, information retrieval, and multi-dimensional data query and statistical analysis.
To export data from Dataphin to Elasticsearch, you must first create an Elasticsearch data source.
Permission requirements
Only users with the Create Data Source permission point in a custom global role and users with the super administrator, data source administrator, domain architect, and project administrator system roles 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 Elasticsearch in the NoSQL section.
If you have recently used Elasticsearch, you can also select Elasticsearch in the Recently Used section. You can also enter Elasticsearch keywords in the search box to quickly search for it.
-
On the Create Elasticsearch Data Source page, configure the connection parameters.
-
Configure the basic information of the data source.
Parameter
Description
Datasource Name
The data source 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
Once configured, you can access Dataphin data source tables in Flink_SQL tasks or through the Dataphin JDBC client in the format
data source code.table nameordata source code.schema.table name. To automatically switch data sources based on the execution 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.
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
The Elasticsearch version. Supported versions: Elasticsearch 6.x, Elasticsearch 7.x, and Elasticsearch 8.x.
Data Source Description
Optional. A brief description of the data source. Maximum length: 128 characters.
Data Source Configuration
Select the configuration scope:
-
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 based on tags. To create tags, see Manage data source tags.
-
-
Configure the connection parameters between the data source and Dataphin.
The displayed configuration page depends on the option you selected: Production + Development Data Source shows both configuration sections, while Production Data Source shows only the production section.
NoteWe recommend that you configure separate data sources for production and development to achieve environment isolation. However, you can also configure them as the same data source with identical parameter values.
Parameter
Description
ES URL
The Elasticsearch connection address. A private endpoint is recommended. Format:
http://host:port. Example:http://192.168.*.212:9200.Username, Password
The username and password for accessing the Elasticsearch instance.
-
-
Select a Default Resource Group to run tasks for this data source, such as database SQL, offline migration, and data preview.
-
Click Test Connection to verify connectivity, or click OK to save the data source directly.
If you click Test Connection, the system verifies whether Dataphin can connect to the data source. If you click OK directly, the system automatically tests the connection for all selected clusters, but the data source is created even if some clusters fail to connect.