[Solved] Kafka Error: InvalidReplicationFactorException: Replication factor:

Error:
InvalidReplicationFactorException: Replication factor:
1 larger than available brokers
The reason is that the configuration in kafka’s zk doesn’t match the creation parameters

Solution:
Open server.properties
vim /opt/module/kafka/config/server.properties
View Configuration
zookeeper.connect=hadoop102:2181,hadoop103:2181,hadoop104:2181/kafka
Create a topic at this time
bin/kafka-topics.sh –zookeeper hadoop102:2181/kafka –create –replication-factor 3 –partitions 1 –topic first
Here the zookeeper parameter value must be the same as the configured one

Read More: