kafka侦听器

x4shl7ld  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(453)

我有一个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,我们可以使用Kafka192.168.1.131。但它不适用于192.168.100.131。
有没有办法同时使用Kafka192.168.1.131和192.168.100.131?
谢谢。

p1tboqfb

p1tboqfb1#

在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

相关问题