启动多个Kafka经纪人失败 [英] Launching multiple Kafka brokers fails
问题描述
尝试启动多个具有不同brokerId的Kafka经纪人时.一个是默认的 server.properties
,另一个是 serverTest.properties
,但更改了两行,分别是 broker.id = 1
和 listeners = PLAINTEXT://localhost:6000
.其余的是相同的默认设置.我首先启动zookeeper,然后启动默认的kafka server.properties
,然后在启动 serverTest.properties
时遇到以下异常: kafka.common.InconsistentBrokerIdException:已配置的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经纪人失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!