我安装kafka raft集群模式的时候,报错
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Each listener must have a different port, listeners: PLAINTEXT://:9094,CONTROLLER://:9094
我执行的是:
bin/kafka-storage.sh format -t Cba3BkapTFWyEKbpUkNJ_w -c config/kraft/server-1.properties
配置文件:
listeners=PLAINTEXT://:9094,CONTROLLER://:9094
错误明细:
Exception in thread "main" java.lang.IllegalArgumentException: requirement failed: Each listener must have a different port, listeners: PLAINTEXT://:9094,CONTROLLER://:9094
at scala.Predef$.require(Predef.scala:337)
at kafka.utils.CoreUtils$.validate$1(CoreUtils.scala:264)
at kafka.utils.CoreUtils$.listenerListToEndPoints(CoreUtils.scala:275)
at kafka.server.KafkaConfig.listeners(KafkaConfig.scala:1814)
at kafka.server.KafkaConfig.controllerListeners(KafkaConfig.scala:1820)
at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1945)
at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1897)
at kafka.server.KafkaConfig.<init>(KafkaConfig.scala:1393)
at kafka.tools.StorageTool$.$anonfun$main$2(StorageTool.scala:62)
at scala.Option.flatMap(Option.scala:283)
at kafka.tools.StorageTool$.main(StorageTool.scala:62)
at kafka.tools.StorageTool.main(StorageTool.scala)
我该如何解决?
每个listener的端口不能相同:
listeners=PLAINTEXT://:9094,CONTROLLER://:9094
你写了2个相同的
9094
,换成不同的端口就可以了。感谢,是我太粗心了。
你的答案