简体   繁体   English

我发现使用node-rdkafka时出错,但似乎正常

[英]I see errors using node-rdkafka but it seems to be working ok

I have a Bluemix Node.js (6.1.0) application that uses node-rdkafka 1.0.3. 我有一个使用node-rdkafka 1.0.3的Bluemix Node.js(6.1.0)应用程序。 It seems to be working ok but there are tons of error events like Error: Local: Broker Transport Failure or Error: Local: Authentication failure . 似乎工作正常,但有很多错误事件,例如Error: Local: Broker Transport FailureError: Local: Authentication failure The producer options I have set are: 我设置的生产者选项是:

var producer_opts = {
  "metadata.broker.list":env.messagehub.brokers,
  "security.protocol":"sasl_ssl",
  "ssl.ca.location":env.messagehub.calocation,
  "sasl.mechanisms":"PLAIN",
  "sasl.username":env.messagehub.user,
  "sasl.password":env.messagehub.password,
  "api.version.request":true,
  "socket.timeout.ms": 10000,
  "dr_msg_cb":true
};

Consumer has similar settings plus the group.id tag. 使用者具有相似的设置以及group.id标记。

I wonder if I should be worrying for theese errors and if there is a way to eliminate them. 我想知道我是否应该担心这些错误,是否有消除这些错误的方法。 Thanks! 谢谢!

You are probably hitting https://github.com/edenhill/librdkafka/issues/1218 . 您可能正在访问https://github.com/edenhill/librdkafka/issues/1218

In many cases, as you've noticed, these errors are harmless. 正如您所注意到的,在许多情况下,这些错误是无害的。 The library node-rdkafka is based onto, librdkafka, always connects to all brokers in the cluster. 库node-rdkafka基于librdkafka,始终连接到集群中的所有代理。 Brokers your applications doesn't interact with will close the idle connections after a while leading to these error messages in your clients. 与您的应用程序不进行交互的代理将在一段时间后关闭空闲连接,从而导致客户端中出现这些错误消息。

Unfortunately we don't have a recommended way to eliminate them at the moment. 不幸的是,我们目前没有建议的方法来消除它们。 We are currently working on a potential solution to at least reduce their rate and maybe get rid of them. 我们目前正在研究一种潜在的解决方案,以至少降低它们的使用率,甚至摆脱它们。

Update: 更新:

With the most recent releases of node-rdkafka (>2.2), you can get rid of all the noisy logs by setting the following properties when creating clients: 使用最新版本的node-rdkafka(> 2.2),可以在创建客户端时通过设置以下属性来摆脱所有嘈杂的日志:

'broker.version.fallback': '0.10.2.1',
'log.connection.close' : false

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM