Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception: partition is not a recognized option, when creating a kafka topic inside a docker.

I just start working with Kafka-docker. And I'm taring to create a topic with the following command inside the docker:

./kafka-topics.sh --create --zookeeper zoo1:2181 --replication-factor 3 --partition 2 --topic test

It guive me the following error:

Exception in thread "main" joptsimple.UnrecognizedOptionException: partition is not a recognized option
    at joptsimple.OptionException.unrecognizedOption(OptionException.java:108)
    at joptsimple.OptionParser.handleLongOptionToken(OptionParser.java:510)
    at joptsimple.OptionParserState$2.handleArgument(OptionParserState.java:56)
    at joptsimple.OptionParser.parse(OptionParser.java:396)
    at kafka.admin.TopicCommand$TopicCommandOptions.<init>(TopicCommand.scala:340)
    at kafka.admin.TopicCommand$.main(TopicCommand.scala:43)
    at kafka.admin.TopicCommand.main(TopicCommand.scala)

I have add the following lines in the hosts file:

 127.0.0.1     kafka1
 127.0.0.1     zoo1
like image 593
isaura almar Avatar asked Dec 07 '25 06:12

isaura almar


1 Answers

It's not --partition, but --partitions

like image 74
Alex Ott Avatar answered Dec 11 '25 04:12

Alex Ott



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!