本地连接Kafka提示连接被拒绝
at 4年前 ca Linux pv 1513 by touch
本地连接Kafka提示连接被拒绝,报错信息如下。
:30:34.701 [main] DEBUG org.apache.kafka.clients.producer.KafkaProducer - Exception occurred during message send:org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.13:30:35.480 [kafka-producer-network-thread | producer-1] DEBUG org.apache.kafka.common.network.Selector - Connection with /47.95.236.75 disconnectedjava.net.ConnectException: Connection refused: no further information at sun.nio.ch.SocketChannelImpl.checkConnect(Native Method) at sun.nio.ch.SocketChannelImpl.finishConnect(SocketChannelImpl.java:717) at org.apache.kafka.common.network.PlaintextTransportLayer.finishConnect(PlaintextTransportLayer.java:51) at org.apache.kafka.common.network.KafkaChannel.finishConnect(KafkaChannel.java:73) at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:323) at org.apache.kafka.common.network.Selector.poll(Selector.java:291) at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:260) at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:236) at org.apache.kafka.clients.producer.internals.Sender.run(Sender.java:135) at java.lang.Thread.run(Thread.java:748)123456789101112131415
去服务器,修改config/server.properties配置文件,更改如下
把31行的注释去掉,listeners=PLAINTEXT://:9092
把36行的注释去掉,把advertised.listeners值改为PLAINTEXT://host_ip:9092(我的服务器ip是47.75.236.75)
版权声明
本文仅代表作者观点,不代表码农殇立场。
本文系作者授权码农殇发表,未经许可,不得转载。
已有0条评论