Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Error while executing topic command : replication factor: 1 larger than available brokers: 0

Rising Star

Hi there,

This is the command I ran.

bin/ --create --zookeeper --replication-factor 1 --partitions 1 --topic test21 Error while executing topic command : replication factor: 1 larger than available brokers: 0

I am getting the below error.

 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)

But, I am seeing in Ambari, There are two brokers has been started. Please help me. Thanks.


Rising Star

Hi, here i have attached the zookeeper screenshot for your reference. zookeeper-screenshot.png

Expert Contributor

understand that your zookeeper is running. Want you to run zkCli at the command line, so that we can check whether it can connect from nodes to the zookeeper server.

Expert Contributor

not sure what are the url for your zookeeper sever. you should run as /usr/hdp/current/zookeeper-server/bin/ -server if is your zookeeper server.

Rising Star

I ran as you said. This is the screenshot for the output.


Expert Contributor

from your picture, it looks like you have a zookeeper on, how about cmtoldhwdpadm02, and cmtoldhwdpadm03? Are there zookeeper running on those two?

Now, please follow the steps below:

/usr/hdp/current/zookeeper-server/bin/ -server

ls /brokers/ids/ <-- here you should see two ids as there are two broker nodes

get /brokers/ids/<id1> and <id2> <--- Please share the output

Cloudera Employee


Just check the value of "zookeeper.chroot"(znode in ZooKeeper used as a root for Kafka cluster) property in your Kafka configurations. According to the command, which you have mentioned, it should be '/'.

i.e connect to the correct znode for kafka.

New Contributor

I too had the same issue.

Check for zookeeper.chroot value. As zookeeper and Kafka have tight integration.

In my case i had given /kafka.