[Fixed] Replication factor: larger than available brokers

I received this error when trying to create a Kafka topic. I have given the replication factor 2 which is more than my broker count i.e., 1.

Below is the command I ran that got this error.

kafka-topics --zookeeper --topic first-topic --create --partitions 3 --replication-factor 2

The thing is, you cannot create the Kafka topic with replication factor greater than your broker. I have only 1 broker, therefore, I will take the replication factor value as 1.

kafka-topics --zookeeper --topic first-topic --create --partitions 3 --replication-factor 1

Thank you All!!! Hope you find this useful.

Up ↑

%d bloggers like this: