0

I created a topic using following command:

./kafka-topics.sh --create --zookeeper zookeeper:2181 --replication-factor 2 --partitions 2 --topic testTopic 

When I tried producing the records using console producer, I see following messages on producer console:

 Error while fetching metadata with correlation id 0 : {testTopic=UNKNOWN_TOPIC_OR_PARTITION} (org.apache.kafka.clients.NetworkClient) 

The command I used to start console producer:

./kafka-console-producer.sh --broker-list broker1:9092 broker2:9092 --topic testTopic 

The output of topic describe is as follows:

kafka-topics.sh --zookeeper zookeeper:2181 --describe --topic testTopic 


Topic:testTopic PartitionCount:2        ReplicationFactor:2     Configs:
        Topic: testTopic        Partition: 0    Leader: none    Replicas: 2,1   Isr:
        Topic: testTopic        Partition: 1    Leader: none    Replicas: 1,2   Isr: 

Looking at above output this question is not a duplicate of this. There is no leader assigned to the partitions.

What could be possible reason behind this behavior?

Community
  • 1
  • 1
vatsal mevada
  • 5,148
  • 7
  • 39
  • 68
  • Can you check whether Kafka `brokers` are up and running? Also review your zookeeper port because ports used for creating topic(2182) and listing topic(2181) are different! – avr Apr 12 '17 at 09:55

0 Answers0