kafka listeners和advertised

from:https://my.oschina.net/u/4347039/blog/3346312

 

listeners

listeners就是主要用来定义Kafka Broker的Listener的配置项。

advertised.listeners

advertised.listeners参数的作用就是将Broker的Listener信息发布到Zookeeper中

 

内外网分流:

listener.security.protocol.map=EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
listeners=EXTERNAL://10.222.1.33:9092,INTERNAL://10.222.1.33:9093
inter.broker.listener.name=INTERNAL
#advertised.listeners=EXTERNAL://10.222.1.33:9094,INTERNAL://10.222.1.33:9093
[zk: localhost:2181(CONNECTED) 8] get /brokers/ids/0
{"listener_security_protocol_map":{"EXTERNAL":"PLAINTEXT","INTERNAL":"PLAINTEXT"},"endpoints":["EXTERNAL://10.222.1.33:9092","INTERNAL://10.222.1.33:9093"],"jmx_port":-1,"host":"10.222.1.33","timestamp":"1573920483772","port":9092,"version":4}

 内网访问可以使用:10.222.1.33:9093

外网访问使用:10.222.1.33:9092

 

listeners

listeners就是主要用来定义Kafka Broker的Listener的配置项。

advertised.listeners

advertised.listeners参数的作用就是将Broker的Listener信息发布到Zookeeper中

inter.broker.listener.name

inter.broker.listener.name:专门用于Kafka集群中Broker之间的通信

listener.security.protocol.map

配置监听者的安全协议的,比如PLAINTEXTSSLSASL_PLAINTEXTSASL_SSL

 

listeners

是kafka真正bind的地址

 

advertised.listeners

是暴露给外部的listeners,如果没有设置,会用listeners

 

posted @ 2021-07-15 17:33  G1733  阅读(525)  评论(0编辑  收藏  举报