zoukankan      html  css  js  c++  java
  • kafka producer生产数据到kafka异常:Got error produce response with correlation id 16 on topic-partition...Error: NETWORK_EXCEPTION

     

    kafka producer生产数据到kafka异常:Got error produce response with correlation id 16 on topic-partition...Error: NETWORK_EXCEPTION

    1.问题描述

    2017-09-13 15:11:30.656 o.a.k.c.p.i.Sender [WARN] Got error produce response with correlation id 25 on topic-partition test2-rtb-camp-pc-hz-5, retrying (299 attempts left). Error: NETWORK_EXCEPTION
    2017-09-13 15:11:30.656 o.a.k.c.p.i.Sender [WARN] Got error produce response with correlation id 25 on topic-partition test2-rtb-camp-pc-hz-23, retrying (299 attempts left). Error: NETWORK_EXCEPTION
    2017-09-13 15:11:30.657 o.a.k.c.p.i.Sender [WARN] Got error produce response with correlation id 25 on topic-partition test2-rtb-camp-pc-hz-14, retrying (299 attempts left). Error: NETWORK_EXCEPTION
    2017-09-13 15:11:30.657 o.a.k.c.p.i.Sender [WARN] Got error produce response with correlation id 16 on topic-partition test2-rtb-camp-pc-hz-5, retrying (299 attempts left). Error: NETWORK_EXCEPTION
     
     

    2.问题原因

    $KAFKA_HOME/config/server.properties中有如下注释:
    大意是:kafka中每台broker会将hostname和port通知生产者和消费者,如果配置了listeners他就返回listeners的值,否则,就会调用java.net.InetAddress.getCanonicalHostName(),而这个方法返回的是linux这台主机的hostname,而不是IP。所以,在搭建kafka的时候需要配置listeners这个参数,最好也配上host.name=ip。
  • 相关阅读:
    csu 1141 节能
    WA:ZOJ 1025 Wooden Sticks
    UVa 531 Compromise
    UVa 437 The Tower of Babylon
    UVa 10285 Longest Run on a Snowboard
    在asp.net使用web.config身份验证
    掌握 Ajax,第 6 部分: 建立基于 DOM 的 Web 应用程序
    面向对象编程思想
    一步一步学Remoting之五:异步操作
    Asp.net 2.0 用 FileUpload 控件实现多文件上传 用户控件(示例代码下载)
  • 原文地址:https://www.cnblogs.com/haozhengfei/p/7515669.html
Copyright © 2011-2022 走看看