admin管理员组

文章数量:1608625

问题:
kafka启动正常,发送消息时报错
Connection with /x.x.x.x:x disconnected java.ConnectException: Connection refused: no further information

分析:
分析个毛线,跑脚本模拟一下:
发送
消费
啊哦, 脚本没有问题

那看来时地址设置的错了,打开config/server.properties

#listeners=PLAINTEXT://:9092
zookeeper.connect=localhost:2181

修改如下:

listeners=PLAINTEXT://:9999
zookeeper.connect=内网ip:2181

顺手改了以下三个(不需要改,我是因为端口不是默认的)
connect-standalone.properties
consumer.properties
producer.properties

bootstrap.servers=内网ip:9999

重启broker, 测试 ok了

解决:

server.properties中

listeners=PLAINTEXT://:你的对外端口
zookeeper.connect=你的内网ip:2181

consumer.properties/ producer.properties中

bootstrap.servers=你的内网ip:你的对外端口

本文标签: NETJavadisconnectedrefusedConnection