美文网首页
2019-08-11

2019-08-11

作者: 潘L | 来源:发表于2019-08-11 16:54 被阅读0次

    本地连接Kafka提示连接被拒绝,解决办法

    本地连接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)

    ---------------------

    版权声明:本文为CSDN博主「长城Ol」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。

    原文链接:https://blog.csdn.net/baijunzhijiang_01/article/details/82382238

    相关文章

      网友评论

          本文标题:2019-08-11

          本文链接:https://www.haomeiwen.com/subject/okssjctx.html