Flink
The Flink Doris Connector lets you import data produced by Flink (such as data Flink reads from Kafka or MySQL) into your warehouse in real time. It is suitable for real-time data ingestion and streaming ETL scenarios.
Before you begin
Run Flink and its connector in your own environment. Copy the warehouse HTTP and SQL connection details from Connect, and make sure the Flink workers can reach the addresses required by the connector. Use a warehouse SQL user with permission to write the target table.
For supported source imports without an external Flink deployment, consider Data Integration. Keep Flink when you need its processing logic or existing pipelines.
Applicable scenarios
| Scenario | Description |
|---|---|
| Real-time data ingestion | Write data from message queues such as Kafka or Pulsar into your warehouse in real time |
| Database synchronization | Synchronize data from databases such as MySQL or Oracle to VeloDB Cloud through Flink CDC |
| Streaming ETL | Perform real-time computation with Flink and write the results to VeloDB Cloud |
Limitations
- Requires a Flink cluster that you have already deployed.
- Requires the corresponding version of the Flink Doris Connector to be deployed in Flink.
Procedure
For complete instructions on importing data with Flink, see Flink Doris Connector. The following minimal example shows how to quickly complete an import through Flink.
The overall workflow consists of the following three steps:
- Create the target table in your warehouse
- Write data through FlinkSQL in Flink
- Verify in your warehouse that the data has been imported successfully
Step 1: create a table in your warehouse
Create the target table students in your warehouse to receive data from Flink:
CREATE DATABASE IF NOT EXISTS test;
CREATE TABLE test.`students` (
`id` INT NULL,
`name` VARCHAR(256) NULL,
`age` INT NULL
) ENGINE=OLAP
UNIQUE KEY(`id`)
COMMENT 'OLAP'
DISTRIBUTED BY HASH(`id`) BUCKETS 1;
Step 2: import data with Flink
Run bin/sql-client.sh to open the FlinkSQL console, and execute the following statements to create a sink table and write data:
CREATE TABLE student_sink (
id INT,
name STRING,
age INT
)
WITH (
'connector' = 'doris',
'fenodes' = '<warehouse-http-host>:<http-port>',
'table.identifier' = 'test.students',
'username' = '<warehouse-user>',
'password' = '<warehouse-password>',
'sink.label-prefix' = 'doris_label'
);
INSERT INTO student_sink VALUES (1,'zhangsan',123);
The key parameters are described below:
| Parameter | Description |
|---|---|
connector | Fixed as doris, indicating that the Flink Doris Connector is used |
fenodes | The warehouse HTTP address, in the format host:http_port, from Connect |
table.identifier | The identifier of the target table, in the format database.table |
username | The VeloDB Cloud login username |
password | The VeloDB Cloud login password |
sink.label-prefix | The Label prefix for the Stream Load import task. Use a distinct prefix for independent jobs writing to the same database |
Step 3: check the imported data
Query the target table in your warehouse to confirm that the data has been imported successfully:
select * from test.students;
+------+----------+------+
| id | name | age |
+------+----------+------+
| 1 | zhangsan | 123 |
+------+----------+------+
Troubleshoot no available backend errors
A Flink sink can report no available backend when it cannot select or reach an import endpoint. The message alone does not identify whether the failure is in the connector, the network, or the target cluster. Start with the earliest exception and the request or response that failed.
| Error location | What it means | What to check first |
|---|---|---|
A DorisRuntimeException with no available backend. in BackendUtil.getAvailableBackend | The connector has no candidate endpoint, or its HTTP checks cannot reach a usable candidate. | fenodes, any explicit benodes, auto-redirect, and connectivity from the failing Flink worker. |
A Stream Load response with No backend available for load | The service cannot select an import-capable compute node in the selected cluster. | The requested cluster name, cluster status, and service health. |
Check the target cluster
In the VeloDB Cloud Console, select the warehouse and open Clusters. Confirm that the intended cluster still exists and is Running. If it is paused, resume the cluster. Wait for startup or maintenance to finish before retrying.
Use the same warehouse SQL account as the Flink job to check accessible clusters:
SHOW COMPUTE GROUPS;
This result is filtered by the account's cluster access. If the cluster is missing, ask a warehouse SQL administrator to check its name and the account's USAGE privilege. The account also needs LOAD on the target database or table. A nonzero BackendNum is a node count, not a guarantee that those nodes can accept imports. See cluster access and selection.
Check connection and cluster selection
Copy the current HTTP connection details from Connect. Set fenodes to the warehouse HTTP host and port. Use the connection details for your deployment and preserve its TLS requirements.
To select a cluster for Stream Load, add the following option to the sink table's WITH clause. Replace <cluster-name> with the cluster's name, not its resource ID:
'sink.properties.cloud_cluster' = '<cluster-name>'
Selecting a cluster with USE @<cluster-name> in a separate SQL session does not select the cluster for the connector's HTTP requests. If the job also sends a compute_group header, check its precedence for your Core version in Stream Load cluster selection.
For connector versions that support auto-redirect, use the managed HTTP routing described in Connect. Review any explicit benodes or auto-redirect=false settings: these can make the connector contact individual backend addresses instead of the warehouse entry point. Use only addresses supplied for your warehouse and reachable from Flink.
Check connectivity from the failing Flink worker
Test from the TaskManager host or container that reports the error. A successful connection from your laptop or the JobManager does not verify the TaskManager's network path. Check the warehouse HTTP endpoint and any candidate or redirect address in the error log.
For example, replace <warehouse-http-endpoint> with the HTTP or HTTPS endpoint from Connect, including its protocol and port:
curl --verbose --connect-timeout 10 --max-time 20 \
--output /dev/null '<warehouse-http-endpoint>/'
- A DNS error, connection timeout, or refused connection points to the address, port, or network path. For private endpoints, check private DNS and connectivity from the Flink network.
- A certificate error requires checking the hostname, certificate trust, and connector TLS support.
- An HTTP
5xxresponse can cause endpoint health checks to fail. Check warehouse and cluster availability. - An HTTP response, including
401or403, confirms that an HTTP service answered. It does not prove that the account can load the target table or that an import-capable node is available.
Recover the job or request help
After correcting the connection settings or restoring cluster availability, recover the existing job from its checkpoint or savepoint according to your connector's recovery procedure. Preserve the transaction and label configuration required by your exactly-once pipeline.
If imports still fail while the intended cluster is Running, contact VeloDB Cloud support. Include the warehouse ID, cluster name and ID, approximate failure time and timezone, connector and Core versions, and the earliest exception or Stream Load response available. If the failure recurs, capture the candidate address, HTTP status, and nested network exception before restarting. Redact credentials. VeloDB Cloud manages compute-node recovery and maintenance.
FAQ
Q1: Which data sources does the Flink Doris Connector support?
In theory, all data sources supported by Flink (Kafka, MySQL CDC, file systems, message queues, etc.) can be used as upstream sources, processed by Flink, and then written to VeloDB Cloud.
Q2: Why does sink.label-prefix need to be unique?
The Flink Doris Connector implements imports based on VeloDB Cloud Stream Load. Load labels identify transactions within a database. Use a distinct prefix for independent jobs to avoid conflicts. Exactly-once delivery also requires the connector checkpoint and two-phase commit configuration described in its guide; a label alone does not provide that guarantee.
Q3: Which port should fenodes use?
fenodes takes the warehouse HTTP host and port shown in Connect, not the MySQL protocol port. Do not assume self-managed default ports apply to your warehouse.
Q4: How can I synchronize data from databases such as MySQL or Oracle to VeloDB Cloud?
You can use it together with Flink CDC. For details, see Flink Doris Connector.