Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Am not able to produce message to kafka topic.

Am not able to produce message to kafka topic.

New Contributor

Hi am using HDP2.6 with two Kafka brokers and three zookeeper. Initially everything was working fine but now am not able to produce messages to topic and getting this below error.

ERROR Error when sending message to topic nikesh with key: null, value: 8 bytes with error: (org.apache.kafka.clients.producer.internals.ErrorLoggingCallback) org.apache.kafka.common.errors.NotLeaderForPartitionException: This server is not the leader for that topic-partition.

My topic has one partition and one replication, even i tried with two topics and two replications but getting same above error. I tried even with creating new topic but same above error.

Error from server log:

[2017-11-10 13:10:42,227] ERROR Controller 1001 epoch 17 encountered error while electing leader for partition [__consumer_offsets,2] due to: Preferred replica 1002 for partition [__consumer_offsets,2] is either not alive or not in the isr. Current leader and ISR: [{"leader":1001,"leader_epoch":23,"isr":[1001]}]. (state.change.logger) [2017-11-10 13:10:42,227] ERROR Controller 1001 epoch 17 initiated state change for partition [__consumer_offsets,2] from OnlinePartition to OnlinePartition failed (state.change.logger) [2017-11-10 13:10:42,229] ERROR Controller 1001 epoch 17 encountered error while electing leader for partition [mark-quotes,0] due to: Preferred replica 1002 for partition [mark-quotes,0] is either not alive or not in the isr. Current leader and ISR: [{"leader":1001,"leader_epoch":25,"isr":[1001]}]. (state.change.logger) [2017-11-10 13:10:42,229] ERROR Controller 1001 epoch 17 initiated state change for partition [mark-quotes,0] from OnlinePartition to OnlinePartition failed (state.change.logger)

1 REPLY 1
Highlighted

Re: Am not able to produce message to kafka topic.

Contributor

Which is the command used to produce messages to this topic?

Could you please use "describe" the topic that you're trying to produce messages?. You can use:

./kafka-topics.sh --describe --zookeeper <zkHost:zkPort> --topic <topicName>

Thanks.