赞
踩
当前使用版本:kafka_2.13-3.4.0
使用老版本的创建topic的命令,是用zookeeper来创建,但是报错如下
D:\Software\Doument\kafka_2.13-3.4.0> .\bin\windows\kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test
Exception in thread "main" joptsimple.UnrecognizedOptionException: zookeeper 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:567)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:47)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
这是新版本创建topic的命令,localhost:9092是kafka的 启动地址:端口
D:\Software\Doument\kafka_2.13-3.4.0> .\bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test
Created topic test.
这样问题就解决了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。