当前位置:   article > 正文

kafka listeners 和 advertised.listeners配置内外网都可用_kafka advertised.listeners配置内网和nginx代理的地址

kafka advertised.listeners配置内网和nginx代理的地址

内网访问

在内网部署及访问kafka时,只需要配置listeners参数即可,比如

# The address the socket server listens on. It will get the value returned from 
# java.net.InetAddress.getCanonicalHostName() if not configured.
#   FORMAT:
#     listeners = listener_name://host_name:port
#   EXAMPLE:
#     listeners = PLAINTEXT://your.host.name:9092
listeners=PLAINTEXT://192.168.133.11:9092

# 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
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

按照官网的参数说明,此时advertised.listeners默认值等于listeners参数的值,并被发布到zooleeper中,供客户端访问使用。此时kafka服务、broker之间通信都是使用192.168.133.11:9092<

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/731525
推荐阅读
相关标签
  

闽ICP备14008679号