在卡夫卡启动多个经纪人 [英] Start multiple brokers in kafka
问题描述
kafka和融合软件包的初学者。我想启动多个经纪人来消费这个话题。
可以通过此设置完成-
{'bootstrap.server':'ip:your_host,...',}
Beginner in kafka and confluent package.I want to start multiple brokers so as to consume the topic.
It can be done via this setting -
{'bootstrap.server' : 'ip:your_host,...',}
此设置可以在服务器配置文件或脚本中定义。
This setting can be defined in the server config file or else in the script as well.
但是我应该如何运行那些?。如果仅将多个端点添加到引导服务器,则会出现此错误:
But how shall I run those?. If I just add multiple end points to the bootstrap servers, it gives this error:
java.lang.IllegalArgumentException:要求失败:每个侦听器必须使用不同的名称,侦听器:PLAINTEXT://:9092,PLAINTEXT://:9093
java.lang.IllegalArgumentException: requirement failed: Each listener must have a different name, listeners: PLAINTEXT://:9092, PLAINTEXT://:9093
推荐答案
cp config/server.properties config/server-1.properties
cp config/server.properties config/server-2.properties
config / server-1.properties:
config/server-1.properties:
broker.id=1
listeners=PLAINTEXT://:9093
log.dirs=/tmp/kafka-logs-1
config / server-2.properties:
config/server-2.properties:
broker.id=2
listeners=PLAINTEXT://:9094
log.dirs=/tmp/kafka-logs-2
参考:kafka_quickstart_multibroker
Reference: kafka_quickstart_multibroker
这篇关于在卡夫卡启动多个经纪人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!