Listener ve Advertised Listeners Kafka Broker'ı çalıştırırken belirtile ayarlardır. server.properties dosyasında belirtilir.
1. Listener
Listener KAFKA_CFG_LISTENERS değişkeni ile belirtilir. Açıklaması şöyle
The KAFKA_CFG_LISTENERS environment variable is used to configure the listeners in Apache Kafka. It allows you to specify the network interfaces, ports, and protocols through which clients can connect to the Kafka brokers.
Listener Tipleri
Açıklaması şöyle
PLAINTEXT: Unencrypted plaintext communication.SSL: Encrypted communication using SSL/TLS.SASL_PLAINTEXT: Authentication and encryption using SASL mechanisms over plaintext.SASL_SSL: Authentication and encryption using SASL mechanisms over SSL/TLS.
Örnek
Şöyle yaparız
KAFKA_CFG_LISTENERS=PLAINTEXT://localhost:9092,SSL://localhost:9093
Örnek
Şöyle yaparız. Burada localhost yerine IP adresi kullanılıyor
KAFKA_CFG_LISTENERS=PLAINTEXT://192.168.0.10:9092
2. Difference between listeners and advertised listeners
Açıklaması şöyle
The main difference between the two properties is that listeners is used for internal communication between Kafka brokers, while advertised.listeners is used for external communication between clients and Kafka brokers.
Açıklaması şöyle
For example, if you have a Kafka cluster that is deployed in the cloud, you may want to set the listeners property to the internal IP addresses of the Kafka brokers, and the advertised.listeners property to the public IP addresses of the Kafka brokers. This will allow clients to connect to the Kafka brokers from the outside world, even though the Kafka brokers are not directly accessible from the outside world
Örnek
Şöyle yaparız. Burada istemciler Kafka'ya bağlanmak için my-public-ip:9092 ve my-public-ip:9093 adreslerini kullanırlar
KAFKA_CFG_LISTENERS=PLAINTEXT://localhost:9092,SSL://localhost:9093 KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://my-public-ip:9092,SSL://my-public-ip:9093
No comments:
Post a Comment