赞
踩
在内网部署及访问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
按照官网的参数说明,此时advertised.listeners默认值等于listeners参数的值,并被发布到zooleeper中,供客户端访问使用。此时kafka服务、broker之间通信都是使用192.168.133.11:9092<
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。