我有两个代理kafka 0.10.2.0 cluster.Replication factor是2。我正在对此Kafka运行1.0.0 kafka流应用程序。在我的kafka流应用程序中,生产者配置具有retries = 10 and retry.backoff.ms = 100
运行几分钟后,我观察到Kakfa server.log中的以下日志。由于此Kafka流应用程序引发'NOT_LEADER_FOR_PARTITION'异常。
可能是什么原因?请帮我。
[2017-12-12 10:26:02,583] ERROR [ReplicaFetcherThread-0-1], Error for partition [__consumer_offsets,22] to broker 1:org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition. (kafka.server.ReplicaFetcherThread)
Run Code Online (Sandbox Code Playgroud) 根据 Kafka 文档,消费者配置 enable.auto.commit 的默认值为 true。但我越来越假了。
在我的 Kafka 流应用程序中,我尝试将其更改true为props.put(StreamsConfig.consumerPrefix(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG), true)自动提交偏移量。但是我WARN o.a.k.s.StreamsConfig [main] Unexpected user-specified consumer config: enable.auto.commit found. User setting (true) will be ignored and the Streams default setting (false) will be used在日志中收到消息并恢复为 false。
原因是什么?请帮我。
我有 Spring Boot docker 镜像。我在 application.properties 文件中提供了所有参数(环境变量)。如何在通过 docker image 作为输入运行应用程序时提供此文件。
请帮我。