5

我正在尝试使用ruby-kafkagem 发送消息,但出现错误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")

有谁知道我为什么会收到这个错误?

4

1 回答 1

0

您可能正在使用 Kafka 0.10。从 0.7.x 版本开始,放弃对 Kafka 0.10 的支持,以替换 kafka 0.11 中的新 Record Batch 格式。所以,请使用 0.6.x 分支,或者升级你的 kafka 版本。如此处所述:

https://github.com/zendesk/ruby-kafka/issues/672

于 2019-10-31T13:06:11.947 回答