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.

kafka 2.0.1 create topic failed

Highlighted

kafka 2.0.1 create topic failed

I am trying to test kafka 2.0.2
cdh 5.7
kafka host ~]$ kafka-topics --zookeeper <zookeeper-host>:2181 --create --topic first --partitions 1 --replication-factor 1
Error while executing topic command : replication factor: 1 larger than available brokers: 0
[2016-10-11 12:42:59,436] ERROR kafka.admin.AdminOperationException: replication factor: 1 larger than available brokers: 0
at kafka.admin.AdminUtils$.assignReplicasToBrokers(AdminUtils.scala:77)
at kafka.admin.AdminUtils$.createTopic(AdminUtils.scala:244)
at kafka.admin.TopicCommand$.createTopic(TopicCommand.scala:107)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:60)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
(kafka.admin.TopicCommand$)

2 REPLIES 2

Re: kafka 2.0.1 create topic failed

New Contributor

Hi,

 

The problem might already be solved. 

However, I would like share the solution as I've faced the same.

Two solutions:

1. Mention zookeeper chroot directory while creating topic as follows (in my case chroot is /kafka)

kafka-topics --zookeeper <zookeeper-host>:2181/kafka --create --topic first --partitions 1 --replication-factor 1

 

2. change zookeeper chroot to / using CM

   cluster>kafka>configuration: zookeeper.chroot

 

Thanks,

Aminul

Re: kafka 2.0.1 create topic failed

Explorer

It works for me. Thank you very very much~~~~~

Tears down!