我在三台服务器机器( EC2 -1、server-2、server-3)上有一个kafka集群,而zookeeper正在server-1上运行。服务器-1具有代理ids 11、12、13,服务器-2具有代理ids 21、22、23,并且服务器-3具有代理ids 31、32、33。尝试通过kafka控制台生产者(在服务器-1上)向名为test4的topic发送消息时,收到以下错误:
WARN [KafkaApi-11] Produce request with correlation id 2 from client
console-producer on partition [test4,0] failed due to Leader not local
for partition [test4,0] on broker 11 (kafka.server.KafkaApis)我使用describe topic命令得到的输出是:
Topic: test4 Partition: 0 Leader: 21 Replicas: 21 Isr: 21
Topic: test4 Partition: 1 Leader: 22 Replicas: 22 Isr: 22
Topic: test4 Partition: 2 Leader: 23 Replicas: 23 Isr: 23此错误的原因可能是什么?
发布于 2015-11-01 02:19:32
看起来您正在向代理11发送消息,但是您应该将它们发送给代理21,因为这个代理是主题test4,分区0的领导者。您究竟是如何生成/发送这些消息的?你能分享这个命令吗?您是否可能以某种方式显式地指定了代理11?
出于好奇:为什么在一台服务器上有三个Kafka代理?(如果我理解正确的话。)
https://stackoverflow.com/questions/33454716
复制相似问题