Support Questions

Find answers, ask questions, and share your expertise

Error while creating Kafka topic


Hi followed below link to install kafka using Parcel:


I am using Cloudera Sandbox CDH 5.12.


I get below error message when I try to create a topic:


[cloudera@quickstart ~]$ /usr/bin/kafka-topics --create --zookeeper localhost:2181/kafka --replication-factor 1 --partitions 1 --topic t2
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/KAFKA-2.1.1-!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/KAFKA-2.1.1-!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Error while executing topic command : replication factor: 1 larger than available brokers: 0
[2017-09-14 11:42:53,033] ERROR kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0
at kafka.admin.AdminUtils$.assignReplicasToBrokers(AdminUtils.scala:117)
at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:403)
at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:110)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:61)
at kafka.admin.TopicCommand.main(TopicCommand.scala)



Any help?



This could be caused by two possible situations:


1) all of you kafka brokers are down (unlikely)

2) you are not connecting to the correct zookeeper, or specified a wrong root zk node(most likely). Please check if you really need /kafka in your zookeper conenct string, check your "zookeeper.chroot" configuraion on CM. If it's empty there, you don't need to append /kafka in zookeeper connect string, or if's something else, replace with it.

Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.