Kafka 是否支持代理集群前的 ELB? [英] Does Kafka support ELB in front of broker cluster?

查看:25
本文介绍了Kafka 是否支持代理集群前的 ELB?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于 AWS 上的 Kafka 代理集群的问题.现在有一个 AWS ELB 位于集群前面,但是当我将我的生产者或消费者的bootstrap.servers"属性设置为我的 ELB 的A"记录(和正确的端口号)时,生产者和消费者消费者无法分别生产和消费消息.我已经关闭了代理上的所有 SSL 并通过 PLAINTEXT 9092 端口进行连接,我的 ELB 使用该端口将端口 1234 转发到 9092.例如,在我的生产者配置属性中,我将...

I had a question regarding Kafka broker clusters on AWS. Right now there is an AWS ELB sitting in front of the cluster, but when I set the "bootstrap.servers" property of my producer or consumer to the "A" record (and correct port number) of my ELB, both the producer and consumer fail to produce and consume messages respectively. I have turned off all SSL on my broker and am connecting through the PLAINTEXT 9092 port, with which my ELB forwards port 1234 to 9092. So in my Producer Configs properties for example, I will have...

bootstrap.servers = (ELB 的A"记录):1234

bootstrap.servers = ("A" record of ELB):1234

更多信息:

  • 我的 ELB 协议是 TCP/TCP
  • 我关于经纪人的advertised.listeners"属性是 PLAINTEXT://(ec2-private-ip):9092

有没有人有幸在 ELB 后面运行 Kafka?如果是这样,请帮帮我!

Has anyone had any luck running Kafka behind an ELB? If so, please help me out!

推荐答案

您可以使用 ELB 作为 bootstrap.servers,但代理仍然需要客户端可以直接访问.ELB 将用于客户端发出的初始元数据请求,以确定哪些主题分区位于哪些代理上,但之后它将使用服务器的主机名(或 advertised.listeners 设置,如果您需要对其进行自定义,例如可能需要在 EC2 实例上获取服务器的公共 IP).

You can use an ELB as the bootstrap.servers, but the brokers still need to be directly accessible to the client. The ELB will be used for the initial metadata request the client makes to figure out which topic partitions are on which brokers, but after that it'll use the hostname of the server (or advertised.listeners setting if you need to customize it, which, e.g. might be necessary on EC2 instances to get the public IP of a server).

这篇关于Kafka 是否支持代理集群前的 ELB?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆