19

What is the meaning of this kafka error ?

[2018-08-22 11:40:49,429] WARN [Consumer clientId=consumer-1, groupId=console-consumer-62114] 1 partitions have leader brokers without a matching listener, including [topicname-0] (org.apache.kafka.clients.NetworkClient)

I'm getting it when running:

./kafka-console-consumer.sh --topic topicname --bootstrap-server localhost:9094 

And I'm getting some errors inside a golang program when trying to read this topic:

2018/08/22 11:44:12 ReadOffsetWithRetryOnError conn error: < dial tcp :0: connect: connection refused > kafka0:9094 topic: 0

The code snippet:

conn, err := kafka.DialLeader(context.Background(), "tcp", ip, getTopic(topic), 0) if err != nil { log.Println("ReadOffsetWithRetryOnError conn error: <", err, "> ", ip, " topic:", topic) } 

This is quite weird because, when reading on different topic it is working fine at the same time.

More error logs:

/kafka-topics.sh --describe --zookeeper localhost:2181 --topic topicname Topic:indexBlock PartitionCount:1
ReplicationFactor:1 Configs: Topic: topicname Partition: 0 Leader: -1 Replicas: 1002 Isr: 1002

4

7 Answers 7

7

[2018-08-22 11:40:49,429] WARN [Consumer clientId=consumer-1, groupId=console-consumer-62114] 1 partitions have leader brokers without a matching listener, including [topicname-0] (org.apache.kafka.clients.NetworkClient)

This error also happens if you try to run multiple consumers and the kafka topic contains only one partition. Generally one consumer should mapped with one partition. If you are using two consumers then you should have 2 partition in the kafka topic.

Sign up to request clarification or add additional context in comments.

2 Comments

Small correction: if you try to run multiple consumers from the same consumer group.
I have 2 consumers and 3 partitions and error keep spamming the console.
4

In my case, i was getting this error when i was testing Kafka fail-over. I brought down 1 Kafka, and expected the message to be written to the other Kafka.

The issue was that topic replication-factor was set to 1, when i needed to set it to 2. (2 Kafka instances)

Bonus:
Check out the directories where the topics are created(in my case: kafka-logs-xx) for both Kafka, and you will understand why :-)

Comments

1

I think my problem is I was running 2 instances, without setting anything special for replications. (prob no replication?) then I removed a broker. Some topics stopped working.

1 Comment

We were facing the same issue, started all the brokers and the issue was resolved.
1

I had this issue while running Kafka in a docker container.

The following solution helped to resolve the issue.

As mentioned by @coldkreap in the comment of this answer: https://stackoverflow.com/a/58067985/327862

The kafka broker information is kept between restarts because the wurstmeister/kafka image creates a volume named 'kafka'. If you run docker volume ls you will see a kafka volume. Remove that volume and you will be able to recreate topics, etc.

If using docker-compose, you can run the following command to remove containers along with their associated volumes:

docker-compose down -v 

OR

docker-compose rm -sv 

Comments

0

In my case, i was getting this error while updating my kafka cluster from v2.0 to v2.4. The reason was the configuration settings was wrong for log.dirs in server.properties file. Because I didnt noticed different disk name for different nodes and i missmatch the disknames in log.dirs settings.

Comments

0

jumping_monkey's bonus on checking the directories is helpful. For me, I was deploying with Bitnami Kafka. On first deploy I was not config in the helm values. I wanted to change retention down to minutes, and set that:

config: |- log.retention.minutes=10 

This caused the log.dirs directory to switch from /bitnami/kafka/data to /tmp/logs.

Essentially where the data is being stored on the Kafka brokers caused the error to show up.

Comments

-1

I had this problem and i resolved it by creating a new broker and starting it. Afterwards you have to restart the different consumers, producers and so on.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.