今天搭建新的kafka 集群给大数据和中台部门共用,搭建好了,内部访问测试是可以的,外部其他机器访问不通,查了下,原来是有个外部访问的参数没有配置。配置 listeners,如下
看了下示例,conf文件里面是有说明的
############################# Socket Server Settings #############################
# 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://: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
配置好listeners后,重启集群,访问成功。