Kafka - 消費錯誤問題,多臺機器上面無法消費資料
錯誤日誌:
2024-01-08 10:45:44 org.apache.flink.util.FlinkException: Global failure triggered by OperatorCoordinator for 'Source: Kafka Source 主流' (operator bc764cd8ddf7a0cff126f51c16239658). at org.apache.flink.runtime.operators.coordination.OperatorCoordinatorHolder$LazyInitializedCoordinatorContext.failJob(OperatorCoordinatorHolder.java:545) at org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator$QuiesceableContext.failJob(RecreateOnResetOperatorCoordinator.java:223) at org.apache.flink.runtime.source.coordinator.SourceCoordinatorContext.failJob(SourceCoordinatorContext.java:285) at org.apache.flink.runtime.source.coordinator.SourceCoordinatorContext.handleUncaughtExceptionFromAsyncCall(SourceCoordinatorContext.java:298) at org.apache.flink.util.ThrowableCatchingRunnable.run(ThrowableCatchingRunnable.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.flink.util.FlinkRuntimeException: Failed to list subscribed topic partitions due to at org.apache.flink.connector.kafka.source.enumerator.KafkaSourceEnumerator.checkPartitionChanges(KafkaSourceEnumerator.java:237) at org.apache.flink.runtime.source.coordinator.ExecutorNotifier.lambda$null$1(ExecutorNotifier.java:86) at org.apache.flink.util.ThrowableCatchingRunnable.run(ThrowableCatchingRunnable.java:40) ... 3 more Caused by: java.lang.RuntimeException: Failed to get metadata for topics [pre_topic_cunsumer_test]. at org.apache.flink.connector.kafka.source.enumerator.subscriber.KafkaSubscriberUtils.getTopicMetadata(KafkaSubscriberUtils.java:47) at org.apache.flink.connector.kafka.source.enumerator.subscriber.TopicListSubscriber.getSubscribedTopicPartitions(TopicListSubscriber.java:52) at org.apache.flink.connector.kafka.source.enumerator.KafkaSourceEnumerator.getSubscribedTopicPartitions(KafkaSourceEnumerator.java:222) at org.apache.flink.runtime.source.coordinator.ExecutorNotifier.lambda$notifyReadyAsync$2(ExecutorNotifier.java:83) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ... 3 more Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45) at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32) at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89) at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:260) at org.apache.flink.connector.kafka.source.enumerator.subscriber.KafkaSubscriberUtils.getTopicMetadata(KafkaSubscriberUtils.java:44) ... 10 more Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. 2024-01-08 10:45:44 org.apache.flink.util.FlinkException: Global failure triggered by OperatorCoordinator for 'Source: Kafka Source 主流' (operator bc764cd8ddf7a0cff126f51c16239658). at org.apache.flink.runtime.operators.coordination.OperatorCoordinatorHolder$LazyInitializedCoordinatorContext.failJob(OperatorCoordinatorHolder.java:545) at org.apache.flink.runtime.operators.coordination.RecreateOnResetOperatorCoordinator$QuiesceableContext.failJob(RecreateOnResetOperatorCoordinator.java:223) at org.apache.flink.runtime.source.coordinator.SourceCoordinatorContext.failJob(SourceCoordinatorContext.java:285) at org.apache.flink.runtime.source.coordinator.SourceCoordinatorContext.handleUncaughtExceptionFromAsyncCall(SourceCoordinatorContext.java:298) at org.apache.flink.util.ThrowableCatchingRunnable.run(ThrowableCatchingRunnable.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: org.apache.flink.util.FlinkRuntimeException: Failed to list subscribed topic partitions due to at org.apache.flink.connector.kafka.source.enumerator.KafkaSourceEnumerator.checkPartitionChanges(KafkaSourceEnumerator.java:237) at org.apache.flink.runtime.source.coordinator.ExecutorNotifier.lambda$null$1(ExecutorNotifier.java:86) at org.apache.flink.util.ThrowableCatchingRunnable.run(ThrowableCatchingRunnable.java:40) ... 3 more Caused by: java.lang.RuntimeException: Failed to get metadata for topics [pre_topic_cunsumer_test]. at org.apache.flink.connector.kafka.source.enumerator.subscriber.KafkaSubscriberUtils.getTopicMetadata(KafkaSubscriberUtils.java:47) at org.apache.flink.connector.kafka.source.enumerator.subscriber.TopicListSubscriber.getSubscribedTopicPartitions(TopicListSubscriber.java:52) at org.apache.flink.connector.kafka.source.enumerator.KafkaSourceEnumerator.getSubscribedTopicPartitions(KafkaSourceEnumerator.java:222) at org.apache.flink.runtime.source.coordinator.ExecutorNotifier.lambda$notifyReadyAsync$2(ExecutorNotifier.java:83) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ... 3 more Caused by: java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. at org.apache.kafka.common.internals.KafkaFutureImpl.wrapAndThrow(KafkaFutureImpl.java:45) at org.apache.kafka.common.internals.KafkaFutureImpl.access$000(KafkaFutureImpl.java:32) at org.apache.kafka.common.internals.KafkaFutureImpl$SingleWaiter.await(KafkaFutureImpl.java:89) at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:260) at org.apache.flink.connector.kafka.source.enumerator.subscriber.KafkaSubscriberUtils.getTopicMetadata(KafkaSubscriberUtils.java:44) ... 10 more Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment.
解決方案:
多臺機器都要配置下/etc/hosts的配置對映
排查過程:
先看了下kafka的程式資訊
ps -ef |grep kafka
然後看了下如下配置資訊
/var/run/cloudera-scm-agent/process/405-kafka-KAFKA_BROKER/kafka.properties
這裡看到裡面的zk使用了對映的名字
猜測因為zk的連線過程是透過對映名稱來通訊的
來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/70024433/viewspace-3003015/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- kafka消費Kafka
- kafka 消費組功能驗證以及消費者資料重複資料丟失問題說明 3Kafka
- Kafka 1.0.0 多消費者示例Kafka
- Kafka 消費組消費者分配策略Kafka
- kafka消費者消費訊息的流程Kafka
- Kafka消費與心跳機制Kafka
- 無鏡--kafka之消費者(四)Kafka
- RocketMQ部分資料消費不了問題排查MQ
- alpakka-kafka(8)-kafka資料消費模式實現Kafka模式
- Kafka 消費者解析Kafka
- Python指令碼消費多個Kafka topicPython指令碼Kafka
- kafka多執行緒順序消費Kafka執行緒
- 生產消費問題
- 使用Flume消費Kafka資料到HDFSKafka
- 學習問題記錄:RocketMQ整合到SpringBoot後,消費者無法自動進行訊息消費。MQSpring Boot
- 使用多執行緒增加kafka消費能力執行緒Kafka
- flink連線消費kafkaKafka
- Kafka之消費與心跳Kafka
- Kafka 消費者組 RebalanceKafka
- 「Kafka應用」消費者Kafka
- “田由甲” - Kafka重複消費線上問題暴雷Kafka
- 實際業務處理 Kafka 訊息丟失、重複消費和順序消費的問題Kafka
- Kafka 入門(二)--資料日誌、副本機制和消費策略Kafka
- Kafka無法消費?!我的分散式訊息服務Kafka卻穩如泰山!Kafka分散式
- spring-kafka多執行緒順序消費SpringKafka執行緒
- 用 gpss 從 kafka 消費資料載入到 greenplumKafka
- kafka消費者客戶端Kafka客戶端
- java的kafka生產消費JavaKafka
- spring 整合kafka監聽消費SpringKafka
- python中多程式消費者生產者問題Python
- 中國消費者協會:近4成消費者在直播購物中遭遇消費問題
- 分享一些 Kafka 消費資料的小經驗Kafka
- Kafka生產消費資料丟失和優化小結Kafka優化
- kafka 如何保證不重複消費又不丟失資料?Kafka
- MongoDB和資料流:使用MongoDB作為Kafka消費者MongoDBKafka
- Apache Kafka消費者再平衡 | TechMyTalkApacheKafka
- Kafka入門(4):深入消費者Kafka
- Kafka入門(2):消費與位移Kafka