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
版权声明:本文标题:【kafka】Java连接出现Connection refused: no further information 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://www.elefans.com/xitong/1728548995a1163201.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论