Reply
Explorer
Posts: 6
Registered: ‎07-04-2016

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$)

New Contributor
Posts: 2
Registered: ‎02-12-2017

Re: kafka 2.0.1 create topic failed

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

Explorer
Posts: 16
Registered: ‎09-12-2017

Re: kafka 2.0.1 create topic failed

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

Tears down!

Announcements