Exception in thread "main" joptsimple.UnrecognizedOptionException: bootstrap-server is not a recognized optionat 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.(TopicCommand.scala:358)
at kafka.admin.TopicCommand$.main(TopicCommand.scala:44)
at kafka.admin.TopicCommand.main(TopicCommand.scala)
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic topic1 --partitions 3
WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected
Adding partitions succeeded!
试试这个:
bin/kafka-topics.sh --bootstrap-server broker_host:port --alter --topic my_topic_name --partitions 40
报了这个错
Exception in thread "main" joptsimple.UnrecognizedOptionException: bootstrap-server 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.(TopicCommand.scala:358) at kafka.admin.TopicCommand$.main(TopicCommand.scala:44) at kafka.admin.TopicCommand.main(TopicCommand.scala)
kafka什么版本
你的kafka版本<2.2,不识别
bootstrap-server
,正确方式和日志bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic topic1 --partitions 3 WARNING: If partitions are increased for a topic that has a key, the partition logic or ordering of the messages will be affected Adding partitions succeeded!
查看是否增加成功:
bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic topic1
那请问 单机kafka可以 设置多分区吗
可以多分区,不能多副本。
哦哦 多分区的话 在生产的时候 需要改什么吗 比如想要发送到多出来的分支里
默认会轮询发送到各个分区中。
ps:如果问题不同,新提个问题详细描述下吧(这个问题可以结贴了哦)。
好的 知道了 谢谢大佬
你的答案