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

查看:71
本文介绍了多台服务器上的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

我想知道以下情况:

  • 发布主题时,它是进入两个实例,还是只是被加载到的服务器?
  • 要使用多个这样的服务器,是否需要对3个服务器使用类似HAProxy的服务器?
  • 使用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占多数,因此最好使用奇数台计算机作为动物园管理员定额.

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天全站免登陆