我正在尝试使用 gem 发送消息ruby-kafka
但我收到错误Could not connect to any of the seed brokers
kafka::ConnectionError: Could not connect to any of the seed brokers:
- kafka:broker1: Connection error EOFError: EOFError
- kafka:broker2: Connection error EOFError: EOFError
- kafka:broker3: Connection error EOFError: EOFError
- kafka:broker4: Connection error EOFError: EOFError
https://github.com/zendesk/ruby-kafka
我创建了krb5.keytab
用于身份验证的文件。
kafka = Kafka.new(["broker1",
"broker2",
"broker3",
"broker4"
],
sasl_gssapi_keytab: '/etc/krb5.keytab')
kafka.deliver_message("Hello, World!", topic: "TestTopic")
有谁知道为什么我会收到这个错误?
您可能正在使用 Kafka 0.10。从版本 0.7.x 开始,在替换 kafka 0.11 中的新记录批处理格式时,放弃了对 Kafka 0.10 的支持。所以,请使用 0.6.x 分支,或者升级你的 kafka 版本。如下所述:
https://github.com/zendesk/ruby-kafka/issues/672