zoukankan      html  css  js  c++  java
  • kafka消费者启动报错

    报错信息:

     WARN Fetching topic metadata with correlation id 14 for topics [Set(test)] from broker [BrokerEndPoint(2,ubuntu,9092)] failed (kafka.client.ClientUtils$)

    WARN Fetching topic metadata with correlation id 14 for topics [Set(test)] from broker [BrokerEndPoint(2,ubuntu,9092)] failed (kafka.client.ClientUtils$)
    java.nio.channels.ClosedChannelException
        at kafka.network.BlockingChannel.send(BlockingChannel.scala:112)
        at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:80)
        at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
        at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:61)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
        at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:68)
        at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:64)
    ^X[2019-01-18 15:54:50,516] WARN Fetching topic metadata with correlation id 17 for topics [Set(test)] from broker [BrokerEndPoint(2,ubuntu,9092)] failed (kafka.client.ClientUtils$)
    java.nio.channels.ClosedChannelException
        at kafka.network.BlockingChannel.send(BlockingChannel.scala:112)
        at kafka.producer.SyncProducer.liftedTree1$1(SyncProducer.scala:80)
        at kafka.producer.SyncProducer.kafka$producer$SyncProducer$$doSend(SyncProducer.scala:79)
        at kafka.producer.SyncProducer.send(SyncProducer.scala:124)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:61)
        at kafka.client.ClientUtils$.fetchTopicMetadata(ClientUtils.scala:96)
        at kafka.consumer.ConsumerFetcherManager$LeaderFinderThread.doWork(ConsumerFetcherManager.scala:68)
        at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:64)

      问题:可以非常明显的看到

      这个主机名是ubuntu,这个名字在hosts文件中我没有配置映射,非常粗心的一个问题。

      解决:在/etc/hosts文件中添加主机名和ip映射。

      说明:这个kafka相互通信连接的时候是默认拿着主机名加端口号的,而我开始在hosts文件中映射的ip并不是使用的主机名,因为几台机器的主机名命名不规范,所以我的映射文件是统一命名py101、py102、py103这种。而kafka默认拿着主机名寻找映射信息,然而hosts文件中没有,故报错。

  • 相关阅读:
    求教——使用node做表单,刷新浏览器页面,浏览器为什么会重复提交上次所填的信息
    sublime 插件
    h5专题应该兼容那些浏览器?
    省市区县镇级联数据JS版
    使用 iscroll 实现焦点图无限循环
    DAO与DTO的区别
    Struts2的DMI的开启方法
    在JSP中的java代码中调用js代码
    Eclipse发布web项目时报错:Multiple Contexts have a path of "/xxx".
    记录:将MyEclipse的Dynamic Web Project项目部署到Eclipse的过程
  • 原文地址:https://www.cnblogs.com/dongxiucai/p/10288275.html
Copyright © 2011-2022 走看看