本文介绍了启动多个 Kafka 代理失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用不同的 brokerId 启动多个 Kafka 代理时.一个是默认的 server.properties,另一个是 serverTest.properties 有 2 行改变,那些是 broker.id=1listeners=PLAINTEXT://localhost:6000.其余是相同的默认设置.我首先启动zookeeper,然后是默认的kafka server.properties 然后在启动serverTest.properties 时出现以下异常:kafka.common.InconsistentBrokerIdException: Configured brokerId 1与 meta.properties 中存储的 brokerId 0 不匹配.我的理解是,上面的内容实际上应该启动多个节点,正如我在教程中看到的其他人所做的那样.我正在使用 Kafka 9.0.

While trying to launch multiple Kafka brokers with different brokerId's. One being the default server.properties and the other being serverTest.properties with 2 lines changed, those being broker.id=1 and listeners=PLAINTEXT://localhost:6000. The rest is the same default setting. I first start zookeeper, then the default kafka server.properties then while launching serverTest.properties I get the following exception: kafka.common.InconsistentBrokerIdException: Configured brokerId 1 doesn't match stored brokerId 0 in meta.properties. My understanding is that the following above should actually launch multiple nodes, as I've seen others do in tutorials. I'm using Kafka 9.0.

推荐答案

编辑 config/serverTest.properties 并替换现有的配置值如下:

Edit config/serverTest.properties and replace the existing config values as follows:

broker.id=2
port=9093
log.dir=/tmp/kafka-logs-2

如果您想要第三个经纪人:

If you want a third broker:

cp config/server.properties config/server3.properties

编辑 config/server3.properties 并替换现有的配置值,如下所示:

Edit config/server3.properties and replace the existing config values as follows:

broker.id=3
port=9094
log.dir=/tmp/kafka-logs-3

如果你在不同的机器上运行你必须改变

if you run on different machines you must change

advertised.host.name=192.168.x.x

否则,如果您在同一台 vmware 机器上运行,例如您应该只更改如上所述的端口和 log.dir

else if you run in the same vmware machine, for example you should only change the port and log.dir as described above

这篇关于启动多个 Kafka 代理失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 17:12