Tuesday, January 23, 2018

Apache Kafka InvalidReplicationFactorException

When creating a topic this Exception may be thrown by Kafka.

Scenario

If we try to create a topic with replication factor larger than the number of cluster, we will see an error.


Exception

This is the exception thrown by Apache Kafka.

Error while executing topic command : Replication factor: 5 larger than available brokers: 2.
[2018-01-23 18:02:37,534] ERROR org.apache.kafka.common.errors.InvalidReplicationFactorException:
Replication factor: 5 larger than ava
ilable brokers: 2.
(kafka.admin.TopicCommand$)
view raw gistfile1.txt hosted with ❤ by GitHub



Resolution

Ensure that the replication factor is less than or equal to the number of brokers in the cluster.

No comments:

Post a Comment