admin管理员组

文章数量:1608835

背景

在CentOS配置好所有东西后,使用kafka消费者连接能查到东西,而使用Java远程就不行,提示Connection refused: no further information,仔细分析是poll时查不到节点的原因。

解决

那问题应该是出在kafka里,排除了防火墙端口问题,那就是配置导致节点不能被远程检测到,通过翻阅资料,发现通过改/config/server.properties,就能解决问题(加上host.name,定义ip)。

############################# Socket Server Settings #############################

# The address the socket server listens on. It will get the value returned from 
# java.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.InetAddress.getCanonicalHostName().
#advertised.listeners=PLAINTEXT://your.host.name:9092

# remove connection 需要加的-------
host.name=192.168.137.199

本文标签: JavaKafkaConnectioninformationrefused