Hubble
Hubble

Reputation: 49

Kafka Leader Error

I have a kafka cluster on three EC2 machines (server-1,server-2,server-3) and zookeeper is running on server-1. server-1 has brokers ids 11,12,13, server-2 has broker ids 21,22,23 and server-3 has broker ids 31,32,33. While trying to send a message via kafka console producer (on server-1) to topic with name test4, I'm getting the following error:

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)

The output which I get for describe topic command is :

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

What could be the reason for this error?

Upvotes: 0

Views: 1401

Answers (1)

Lukáš Havrlant
Lukáš Havrlant

Reputation: 4424

It seems that you are sending messages to broker 11 but you should send them to broker 21 because this broker is leader for topic test4, partition 0. How exactly are you producing/sending these messages? Can you share the command? Isn't it possible that you somehow specified the broker 11 explicitly?

And just out of curiosity: why do you have three Kafka brokers on a single server? (If I understood it correctly.)

Upvotes: 1

Related Questions