Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka Producer not able to send messages

Tags:

apache-kafka

I am very new to Kafka.

Using Kafka 0.11

Number of alive brokers '1' does not meet the required replication factor '3' for the offsets topic (configured via 'offsets.topic.replication.factor')

I get the above error on sending a message for a topic

kafka-topics --zookeeper localhost:2181 --topic test --describe
Topic:test1 PartitionCount:1    ReplicationFactor:1 Configs:
Topic: test1    Partition: 0    Leader: 0   Replicas: 0 Isr: 0 
like image 628
mukulbudania Avatar asked Aug 08 '17 13:08

mukulbudania


1 Answers

How are you starting the broker ? What is the server.properties file. The one provided with the downloaded package should have the following line :

offsets.topic.replication.factor=1

Just to be clear the error you see is not related to the topic you are trying to publish. Today, Kafka doesn't save topic offsets for consumers in Zookeeper anymore but in "internal topics" with name __consumer_offsets. Of course, if you have 1 broker you can't have a replication factor of 3. So I'd like to take a look at your server.properties. If the above property is missing, the default is 3.

like image 63
ppatierno Avatar answered Oct 26 '22 12:10

ppatierno