%3|1538976114.812|FAIL|rdkafka#producer-1| [thrd:kafka-server:9092/bootstrap]: kafka-server:9092/0: Receive failed: Disconnected
%3|1538976114.812|ERROR|rdkafka#producer-1| [thrd:kafka-server:9092/bootstrap]: kafka-server:9092/0: Receive failed: Disconnected
%3|1538976114.812|ERROR|rdkafka#producer-1| [thrd:kafka-server:9092/bootstrap]: 1/1 brokers are down

原因:

Why am I seeing Receive failed: Disconnected?

If the remote peer, typically the broker (but could also be an active TCP gateway of some kind), closes the connection you'll see a log message like this:

%3|1500588440.537|FAIL|rdkafka#producer-1| 10.255.84.150:9092/1: Receive failed: Disconnected

There are a number of possible reasons, in order of how common they are:

  • Broker's idle connection reaper closes the connection due to inactivity. This is controlled by the broker configuration property connections.max.idle.ms and defaults to 10 minutes. This is by far the most common reason for spontaneous disconnects.
  • The client sent an unsupported protocol request; see Broker version compatibility. This is considered a configuration error on the client. The broker should log an exception explaining why the connection was closed, see the broker logs.
  • The client sent a malformed protocol request; this is an indication of a bug in the client. The broker should log an exception explaining why the connection was closed, see the broker logs.
  • The broker is in an invalid state. The broker should log an exception explaining why the connection was closed, see the broker logs.
  • TCP gateway/load-balancer/firewall session timeout. Try enabling TCP keep-alives on the client by setting socket.keepalive.enable=true.

Since a TCP close can't signal why the remote peer closed the connection there is no way for the client to know what went wrong. If the disconnect logs are getting annoying and the admin deems they are caused by the idle connection reaper, the log.connection.close client configuration property can be set to false to silence all spontaneous disconnect logs.

NOTE: Whenever a connection is closed for whatever reason, librdkafka will automatically reconnect after reconnect.backoff.jitter.ms (default 500ms).

简单的说,其中之一是服务器会kill掉10分钟空闲的连接,librdkafka会在连接断开后500毫秒内重连。所以,根本解决方法就是没事每分钟发个心跳信息。

参考:https://github.com/edenhill/librdkafka/wiki/FAQ#why-am-i-seeing-receive-failed-disconnected

c++ kafka 客户端rdkafka报Receive failed: Disconnected问题原因以及解决方法的更多相关文章

  1. [Kafka] |FAIL|rdkafka#producer-1 : Receive failed: Disconnected

    Why am I seeing Receive failed: Disconnected? 1. broker 的空闲连接回收器关闭不活跃连接. 由 broker 的配置属性 connections. ...

  2. 转:Validation of viewstate MAC failed异常的原因及解决方法

    ViewState是一种机制,ASP.NET 使用这种机制来跟踪服务器控件状态值,否则这些值将不作为 HTTP 窗体的一部分而回传.也就是说在页面刷新或者回传的时候控件的值将被清空,我们在aspx.c ...

  3. IDEA报compilation failed:internal java compiler error解决方法

    java complier 设置的问题  ,项目中有的配jdk1.6,有的配jdk1.7,版本不一样,导致这样的错误,提示这样的报错时,从file-Settings进入

  4. 启动elasticsearch报错的几种原因及解决方法

    ERROR: [1] bootstrap checks failed [1]: max virtual memory areas vm.max_map_count [65530] is too low ...

  5. linux下svn客户端报错Cannot negotiate authentication mechanism的解决方法

    svn客户端报错Cannot negotiate authentication mechanism的解决方法: 问题出现的原因之一: 因为SVN服务器配置了saslauthd服务用来实现与ldap的对 ...

  6. 使用AFNetworking 2.0 请求数据时出现错误 Request failed: unacceptable content-type: text/html 解决方法

    使用AFNetworking 2.0 请求数据时出现错误 Request failed: unacceptable content-type: text/html 解决方法 添加一行 manager. ...

  7. Failed dependencies: 检查依赖性错误 解决方法

    centOs下: error: Failed dependencies: 检查依赖性错误 解决方法 刚才安装avast的linux版,结果出现了: [root@localhost /]# rpm -i ...

  8. 安装PHP过程中,make步骤报错:(集合网络上各种解决方法)

    安装PHP过程中,make步骤报错:(集合网络上各种解决方法) (1)-liconv -o sapi/fpm/php-fpm /usr/bin/ld: cannot find -liconv coll ...

  9. 转:Loadrunner报错“Too many local variablesAction.c”解决方法

    问题描述,在Action.c里定义数组时如果数组长度过长,如char a[1024*1024]运行时即会报错: 问题原因及解决方法如下: 1. VuGen对于局部变量可以分配的最大内存为64K,如果想 ...

随机推荐

  1. react 全局公共组件-----动态弹窗 (dialog)

    react 的时候,总是会用到弹窗,并且各种各样的,一般来说,组件层级嵌套之后,就会出现 z-index层级覆盖的问题 这个时候,就需要一个公共的弹出层,然后我们将需要展示的组件,放到弹出层里面 下面 ...

  2. shell实现SSH自动登陆【转】

    前言 公司开发使用docker,每次登陆自己开发机总要输入 ssh user_name@ip_string,然后再确认输入password,手快了还经常会输错.作为一个懒人,肯定要找一个取巧的方式,查 ...

  3. CentOS6.5 安装openssl

    安装比较简单! 1.下载安装包 [root@mycentos ~]# wget http://www.openssl.org/source/openssl-1.0.2f.tar.gz 2.解压和编译 ...

  4. 数据分析与挖掘 - R语言:KNN算法

    一个简单的例子!环境:CentOS6.5Hadoop集群.Hive.R.RHive,具体安装及调试方法见博客内文档. KNN算法步骤:需对所有样本点(已知分类+未知分类)进行归一化处理.然后,对未知分 ...

  5. 初尝Web API《转》

    HTTP 并不是只能用在网页中.它其实还是一个强大的平台,可以用来生成一些API,暴露服务和数据.HTTP很简单灵活,还非常普及.几乎所有你能想到的平台都有HTTP库,所以HTTP服务可以囊括很大范围 ...

  6. Go linux 实践4

    这是目前学习的最难的Go demo例子 ***************************************** 如果能看懂,你就出师了,我的任务也就结束了 **************** ...

  7. template.js简单入门

    template.js是一款开源的JavaScript模板引擎,用来渲染页面的. github地址 https://github.com/yanhaijing/template.js 下载templa ...

  8. UGUI之Slider使用,制作血条

    用Slider来控制Cube旋转 Slider是滑动条.

  9. Unity shader学习之屏幕后期处理效果之边缘检测

    边缘检测的原理是利用一些边缘检测算子对图像进行卷积操作. 转载请注明出处:http://www.cnblogs.com/jietian331/p/7232707.html 例如: 代码如下: usin ...

  10. Python全栈-网络编程基础

    一.C/S架构 1.硬件C/S架构 如PC-打印机 2.软件C/S架构 如PC-网站服务器 参照: https://baike.baidu.com/item/Client%2FServer/15044 ...