配置 kafka 监听器 [英] Configuring kafka listeners
问题描述
我有一个关于正确配置 kafka 侦听器属性的问题 -听众和广告.听众.
在我的配置中,我在道具下面设置:
listeners=SASL_PLAINTEXT://:9092Adverted.listeners=SASL_PLAINTEXT://u-kafkatst-kafkadev-5.sd.xxx.com:9092
客户端使用 u-kafkatst-kafkadev-5.sd.xxx.com:9092
连接.我是否需要在 listener 和 Advertising.listeners 中具有相同的值.这里u-kafkatst-kafkadev-5.sd.xxx.com
是一条dns记录,指向运行kafka代理的主机.
在哪些情况下我希望它们保持相同和不同?
谢谢!
advertised.listeners
属性很重要,如果您正在做任何事情而不是直接连接到同一网络上的代理.如果您使用 Docker、Kubernetes、IaaS(AWS、GCP 等),那么您需要公开外部地址,以便客户端知道连接到哪里.
这篇文章深入解释了这一切.>
I have this question regarding configuring kafka listeners properties correctly - listeners and advertised.listeners.
In my config I am setting below props:
listeners=SASL_PLAINTEXT://:9092
advertised.listeners=SASL_PLAINTEXT://u-kafkatst-kafkadev-5.sd.xxx.com:9092
The clients connect using u-kafkatst-kafkadev-5.sd.xxx.com:9092
. Do I need to have the same value in listener and advertised.listeners. Here u-kafkatst-kafkadev-5.sd.xxx.com
is a dns record that points to the host where kafka broker is running.
What are the situations where I would want to keep them same and different?
Thanks!
The advertised.listeners
property is important if you are doing anything other than connecting to a broker directly on the same network. If you are using Docker, Kubernetes, IaaS (AWS, GCP, etc) then you need to expose the external address for the client to know where to connect to.
This article explains it all in depth.
这篇关于配置 kafka 监听器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!