我刚开始与Kafka-docker合作。而且我要在docker中使用以下命令创建一个主题:
./kafka-topics.sh --create --zookeeper zoo1:2181 --replication-factor 3 --partition 2 --topic test
它给我以下错误:
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)
我在hosts文件中添加了以下行:
127.0.0.1 kafka1
127.0.0.1 zoo1
答案 0 :(得分:6)
不是--partition
,而是--partitions