gpt4 book ai didi

ubuntu - 多 IP 上的 Kafka 监听器

转载 作者:行者123 更新时间:2023-12-04 18:30:05 25 4
gpt4 key购买 nike

我有一台 Ubuntu14 服务器,它有两个 IP(192.168.1.131 和 192.168.100.131)。
我们团队中的一些人使用 192.168.1.131 访问服务器,其他人使用 192.168.100.131。

现在我想在服务器上运行 kafka,我的 server.properties 如下:

advertised.host.name = 192.168.1.131

然后我运行 kafka,我们可以使用 192.168.1.131 的 kafka。但它不适用于 192.168.100.131。

有没有办法同时使用 192.168.1.131 和 192.168.100.131 的 kafka?

非常感谢。

最佳答案

在 kafka 0.10.x 中,您可以像这样编辑 server.properties:

listeners=LINKER1://192.168.1.131:9091,LINKER2://101.200.213.131:9092

inter.broker.listener.name=LINKER2

# Hostname and port the broker will advertise to producers and consumers. If not set,
# it uses the value for "listeners" if configured. Otherwise, it will use the value
# returned from java.net.InetAddress.getCanonicalHostName().
#advertised.listeners=PLAINTEXT://your.host.name:9092

# Maps listener names to security protocols, the default is for them to be the same. See the config documentation for more details
listener.security.protocol.map=PLAINTEXT:PLAINTEXT,SSL:SSL,SASL_PLAINTEXT:SASL_PLAINTEXT,SASL_SSL:SASL_SSL,LINKER1:PLAINTEXT,LINKER2:PLAINTEXT

关于ubuntu - 多 IP 上的 Kafka 监听器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40015609/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com