本地連線Kafka提示連線被拒絕
阿新 • • 發佈:2018-11-21
本地連線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 disconnected
java.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)
去伺服器,修改config/server.properties配置檔案,更改如下
把31行的註釋去掉,listeners=PLAINTEXT://:9092
把36行的註釋去掉,把advertised.listeners值改為PLAINTEXT://host_ip:9092(我的伺服器ip是47.75.236.75)