Zookeeper是Kafka的必需品吗? [英] Is Zookeeper a must for Kafka?

查看:133
本文介绍了Zookeeper是Kafka的必需品吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Kafka中,我只想使用一个代理,单个主题和一个分区,该分区具有一个生产者和多个消费者(每个消费者都从代理获取自己的数据副本)。鉴于此,我不需要使用Zookeeper的开销;我不仅可以只使用经纪人吗?为什么Zookeeper必须?

In Kafka, I would like to use only a single broker, single topic and a single partition having one producer and multiple consumers (each consumer getting its own copy of data from the broker). Given this, I do not want the overhead of using Zookeeper; Can I not just use the broker only? Why is a Zookeeper must?

推荐答案

是的,运行Kafka需要Zookeeper。从Kafka入门文档中:

Yes, Zookeeper is required for running Kafka. From the Kafka Getting Started documentation:


步骤2:启动服务器

Step 2: Start the server

Kafka使用zookeeper,因此如果您没有
,则需要首先启动zookeeper服务器。您可以使用随kafka打包的便捷脚本
来获取一个快速且脏的单节点zookeeper
实例。

Kafka uses zookeeper so you need to first start a zookeeper server if you don't already have one. You can use the convenience script packaged with kafka to get a quick-and-dirty single-node zookeeper instance.


$ b $关于原因,很早以前人们就发现您需要某种方式来协调分布式系统中的任务,状态管理,配置等。一些项目已经建立了自己的机制(例如,在MongoDB分片群集中的配置服务器,或者在Elasticsearch群集中的主节点)。其他人则选择将Zookeeper用作通用的分布式过程协调系统。因此,Kafka,Storm,HBase和SolrCloud都使用Zookeeper来帮助管理和协调。

As to why, well people long ago discovered that you need to have some way to coordinating tasks, state management, configuration, etc across a distributed system. Some projects have built their own mechanisms (think of the configuration server in a MongoDB sharded cluster, or a Master node in an Elasticsearch cluster). Others have chosen to take advantage of Zookeeper as a general purpose distributed process coordination system. So Kafka, Storm, HBase, SolrCloud to just name a few all use Zookeeper to help manage and coordinate.

Kafka是一个分布式系统,旨在使用Zookeeper。您没有使用Kafka的任何分布式功能这一事实并不会改变其构建方式。无论如何,使用Zookeeper不会有太多开销。更大的问题是,为什么要使用这种特殊的设计模式-Kafka的单个经纪人实现会错过多经纪商集群的所有可靠性功能以及扩展能力。

Kafka is a distributed system and is built to use Zookeeper. The fact that you are not using any of the distributed features of Kafka does not change how it was built. In any event there should not be much overhead from using Zookeeper. A bigger question is why you would use this particular design pattern -- a single broker implementation of Kafka misses out on all of the reliability features of a multi-broker cluster along with it's ability to scale.

这篇关于Zookeeper是Kafka的必需品吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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