繁体   English   中英

多 IP 上的 Kafka 侦听器

[英]Kafka listener on multi IP

我有一个 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。

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

非常感谢。

在 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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM