多台服务器上的 Kafka [英] Kafka on Multiple Servers

查看:35
本文介绍了多台服务器上的 Kafka的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我关注了这个链接以安装 Kafka + Zookeeper.一切正常,但我正在 2 台服务器上设置 Kafka + Zookeeper.

I followed this link to install Kafka + Zookeeper. It all works well, yet I am setting up Kafka + Zookeeper on 2 servers.

我已经设置了kafka/config/server.properties:

  • 服务器 1:broker.id = 0
  • 服务器 1:zookeeper.connect = localhost:2181,99.99.99.91:2181
  • 服务器 2:broker.id = 1
  • 服务器 2:zookeeper.connect = localhost:2181,99.99.99.92:2181

我想知道以下几点:

  • 当我发布一个主题时,它会同时发送到两个实例,还是只发送到加载它的服务器?
  • 为了像这样使用多台服务器,我是否需要将 HAProxy 之类的东西与 3 台服务器一起使用?
  • 在使用 3 个服务器时我遗漏了什么重要的东西吗?

感谢您的回答.

推荐答案

一开始,我会假设这里提到的实例指的是 Kafka 服务器实例.

At the very beginning, I would be assuming that the instance mentioned here refers to a Kafka server instance.

问题 1:新创建的主题信息将存储在 Zookeeper 中,一些关键信息将加载到所有代理的元数据缓存缓冲区中.

Question #1: Information for the new-created topics will be stored in Zookeeper and some key information will be loaded into all brokers' metadata cache buffer.

问题 2:无需为 Kafka 集群配置任何类型的代理服务器.它自行管理以实现故障转移和负载平衡.

Question #2: No need to configure any kind of proxy servers for Kafka cluster. It's self managed to implement the fail-over and load-balancing.

问题 3:分配一个未使用的 ID 和数据目录,就像您为这两个代理所做的那样.

Question #3: Assigning an unused id and data directory like what you did for those two brokers is enough.

最后但并非最不重要的一点是,由于 ZAB 需要多数,因此最好使用奇数台机器作为 zookeeper 法定人数.

At last but not least, due to the fact that ZAB requires a majority, it is best to use an odd number of machines as the zookeeper quorum.

这篇关于多台服务器上的 Kafka的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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