本文介绍了单独安装Zookeeper还是不使用kafka 10.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用Kafka 10.2随附的嵌入式Zookeeper 3.4.9,而不要单独安装Zookeeper.每个Kafka经纪人在本地主机上将始终具有1:1 Zookeeper.

I would like to use the embedded Zookeeper 3.4.9 that come with Kafka 10.2, and not install Zookeeper separately. Each Kafka broker will always have a 1:1 Zookeeper on localhost.

因此,如果我在主机A,b,C,D和E上有5个代理,每个代理上都运行着一个Kafka和Zookeeper实例,那么仅运行Kafka随附的Zookeeper是否足够?

So if I have 5 brokers on hosts A, b, C, D and E, each with a single Kafka and Zookeeper instance running on them, then is it sufficient to just run the Zookeeper provided with Kafka?

与独立版本相比,嵌入式3.4.9 Zookeper有什么不利之处或配置限制?

What downsides or configuration limitations if any does the embedded 3.4.9 Zookeper have compared to the standalone version?

推荐答案

这些是一些不将Zookeeper与Kafka经纪人同时运行的原因.

These are a few reason not to run zookeeper on the same box as Kafka brokers.

  1. 它们的缩放比例不同

  1. They scale differently

5 zk和5 Kafka有效,但6:6或11:11无效.即使对于相当大的Kafka集群,也不需要超过5个zookeeper节点.与Kafka不同,Zookeeper会将数据复制到所有节点,因此当您添加更多节点时,它会变慢.

5 zk and 5 Kafka works but 6:6 or 11:11 do not. You don't need more than 5 zookeeper nodes even for a quite large Kafka cluster. Unlike Kafka, Zookeeper replicates data to all nodes so it gets slower as you add more nodes.

他们争夺磁盘I/O

Zookeeper对磁盘I/O延迟非常敏感.您需要将其与Kafka提交日志放在单独的物理磁盘上,否则冒着大量发布到Kafka的风险,这会使Zookeeper的运行速度变慢,并导致其退出集合体,从而导致潜在的问题.

Zookeeper is very disk I/O latency sensitive. You need to have it on a separate physical disk from the Kafka commit log or you run the risk that a lot of publishing to Kafka will slow zookeeper down and cause it to drop out of the ensemble causing potential problems.

他们争夺页面缓存内存

Kafka使用Linux OS页面缓存来减少磁盘I/O.当其他应用程序与Kafka在同一盒子上运行时,您会使用其他数据(这些数据会从Kafka的缓存中删除)来减少或污染"页面缓存.

Kafka uses Linux OS page cache to reduce disk I/O. When other apps run on the same box as Kafka you reduce or "pollute" the page cache with other data that takes away from cache for Kafka.

服务器故障导致更多基础架构瘫痪

Server failures take down more infrastructure

如果盒子重新启动,您将同时失去动物园管理员和经纪人.

If the box reboots you lose both a zookeeper and a broker at the same time.

这篇关于单独安装Zookeeper还是不使用kafka 10.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-19 20:26