How Do I Configure Connection Retries for Kafka Sink If it is Disconnected?
- Symptom
You used Flink 1.10 to run a Flink Opensource SQL job. The job failed after the following error was reported when Flink Sink wrote data to Kafka.
Caused by: org.apache.kafka.common.errors.NetworkException: The server disconnected before a response was received.
- Possible Causes
The CPU usage is too high. As a result, the network is intermittently disconnected.
- Solution
Add connector.properties.retries=5 to the SQL statement.
create table kafka_sink( car_type string , car_name string , primary key (union_id) not enforced ) with ( "connector.type" = "upsert-kafka", "connector.version" = "0.11", "connector.properties.bootstrap.servers" = "xxxx:9092", "connector.topic" = "kafka_car_topic ", "connector.sink.ignore-retraction" = "true", "connector.properties.retries" = "5", "format.type" = "json" );
O&M Guide FAQs
- How Do I Locate a Flink Job Submission Error?
- How Do I Locate a Flink Job Running Error?
- How Do I Know Whether a Flink Job Can Be Restored from a Checkpoint After Being Restarted?
- Why Does DIS Stream Not Exist During Job Semantic Check?
- Why Is the OBS Bucket Selected for Job Not Authorized?
- Why Are Logs Not Written to the OBS Bucket After a DLI Flink Job Fails to Be Submitted for Running?
- How Do I Configure Connection Retries for Kafka Sink If it is Disconnected?
- Why Is Information Displayed on the FlinkUI/Spark UI Page Incomplete?
- Why Is the Flink Job Abnormal Due to Heartbeat Timeout Between JobManager and TaskManager?
- Why Is Error "Timeout expired while fetching topic metadata" Repeatedly Reported in Flink JobManager Logs?
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.
more