美文网首页
Error while fetching metadata wi

Error while fetching metadata wi

作者: Zal哥哥 | 来源:发表于2021-02-02 09:36 被阅读0次

    kafka出现:

    Error while fetching metadata with correlation id : {LEADER_NOT_AVAILABLE}

    表示无法识别kafka hostname

    正确处理姿势

    1、修改server.properties如下,目的是让kafka监听的到

    vi /opt/kafka/kafka/config/server.properties

    image

    2 ps -ef | grep kafka

    kill -9   kafka的pid
    

    3 ps -ef | grep zookeeper

    kill -9 zookeeper的pid

    4 启动service zookeeper start

     启动kafka   :bin/kafka-server-start.sh config/server.properties
    

    5 测试

    bin/kafka-console-producer.sh --broker-list localhost:9092 --topic test7

    image

    bin/kafka-console-consumer.sh --zookeeper localhost:2181 --topic test7 --from-beginning

    image

    以上仅为本地服务器操作可行,远程访问就会报

    o.a.kafka.common.network.Selector - Connection with /192.168.176.136 disconnected
    java.net.ConnectException: Connection refused: no further information

    如果要本地和远程访问都没有问题,解决如下

    重复2、3操作

    然后增加和修改如下

    vi /opt/kafka/kafka/config/server.properties

    image

    进行远程telnet测试

    telnet 192.168.176.136 9092

    image

    测试成功

    进行本地测试

    image image

    进行远程程序访问,成功访问

    image

    参考

    https://www.2cto.com/net/201801/712758.html 注意这个与解决的版本不同

    http://www.mamicode.com/info-detail-2031083.html

    相关文章

      网友评论

          本文标题:Error while fetching metadata wi

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