Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Error while creating Kafka topic

Error while creating Kafka topic

Explorer

Hi followed below link to install kafka using Parcel:

 

https://www.cloudera.com/documentation/kafka/latest/topics/kafka_installing.html#concept_ctb_k1c_d5

 

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-1.2.1.1.p0.18/lib/kafka/libs/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/KAFKA-2.1.1-1.2.1.1.p0.18/lib/kafka/libs/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings 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)
(kafka.admin.TopicCommand$)

 

 

Any help?

1 REPLY 1

Re: Error while creating Kafka topic

Contributor

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.