我使用kafka 3.0.0的KRaft模式,安装kafka集群,报:
Exception in thread "main" org.apache.kafka.common.config.ConfigException: Missing configuration
node.id
which is required whenprocess.roles
is defined (i.e. when running in KRaft mode).
错误详情:
Exception in thread "main" org.apache.kafka.common.config.ConfigException: Missing configuration `node.id` which is required when `process.roles` is defined (i.e. when running in KRaft mode).
at kafka.server.KafkaConfig.validateValues(KafkaConfig.scala:1914)
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
我的命令是:
kafka-storage.sh format --config /tmp/kraft-test.properties --cluster-id aaaaaaaaaaaaaaaaaaaaaa
我的 /tmp/kraft-test.properties 配置如下:
listeners=PLAINTEXT://192.168.217.24:9092,PLAINTEXT1://192.168.217.24:9091
advertised.listeners=PLAINTEXT1://192.168.217.24:9091
listener.security.protocol.map=PLAINTEXT1:PLAINTEXT,PLAINTEXT:PLAINTEXT
process.roles=broker,controller
controller.quorum.voters=0@192.168.217.24:9092
controller.listener.names=PLAINTEXT
inter.broker.listener.name=PLAINTEXT1
请问我该如何解决?
你少配置了
node.id
:摘自:Kafka Broker配置
你的答案