简体   繁体   English

Kafka Broker-与Zookeeper相同吗? 还是KafkaProducer是经纪人?

[英]Kafka Broker - Is it same as Zookeeper? or KafkaProducer is the broker?

There are multiple code examples available (One of such is here ) where KafkaProducer and KafkaConsumers are implemented and can be started separately. 有多个可用的代码示例( 此处是其中的一个),在其中实现了KafkaProducer和KafkaConsumers并可以分别启动。

I was trying to find the code that starts the broker? 我试图找到启动代理的代码?

I think Zookeeper is not the KafkaBroker, as Zookeeper is for some other purpose .. managing clusters states. 我认为Zookeeper不是KafkaBroker,因为Zookeeper用于其他目的..管理集群状态。

While creating the KafkaProducer we pass in property like 在创建KafkaProducer时,我们传入诸如

props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, IKafkaConstants.KAFKA_BROKERS);

Does that mean the KafkaProducer it self start the broker? 这是否意味着KafkaProducer会自行启动代理?

The Zookeeper manages the co-ordination and synchronisaton of the Kafka brokers, and they are separate components. Zookeeper管理卡夫卡经纪人的协调和同步,它们是独立的组件。

The Producer does not start the broker. 生产者不启动代理。 The Producer and Consumer are client-side components that connect to one or more Kafka brokers, and produce/consume data to and from the cluster of brokers. 生产者和消费者是客户端组件,它们连接到一个或多个Kafka代理,并在代理群集之间产生/消费数据。

The Kafka broker is generally started by running kafka/bin/kafka-server-start.sh kafka/config/server.properties , which will start one Kafka broker with the properties defined in the server.properties file. 通常,通过运行kafka/bin/kafka-server-start.sh kafka/config/server.properties来启动Kafka代理,这将启动一个具有server.properties文件中定义的属性的Kafka代理。

Is important to begin have so clear the concepts: 重要的是开始要有如此清晰的概念:

Kafka broker = One instance of kafka started, i mean start the application download from ( https://kafka.apache.org/downloads ) Kafka经纪人 =一个kafka实例启动,我的意思是从( https://kafka.apache.org/downloads )开始下载应用程序

Zookeeper = Effectively is a coordinator for cluster in this specific case you can start up many instance on kafka with zookeeper and take a cluster. Zookeeper =实际上是集群的协调者,在这种特定情况下,您可以使用zookeeper在kafka上启动许多实例并进行集群。

Kafka Producer = Any application (implement kafka libraries) that is in charge of send message to specific kafka topic, some like queue. Kafka Producer =负责将消息发送到特定kafka主题的任何应用程序(实现kafka库),例如队列。

Kafka consumer = Any application (implement kafka libraries) that is in charge of get messages of kafka cluster and process it. Kafka使用者 =负责获取kafka集群的消息并对其进行处理的任何应用程序(实现kafka库)。

For start kafka you first set a system environment (optional), and then execute this commands : 对于启动kafka,您首先要设置系统环境(可选),然后执行以下命令:

---- first start zookeeper ----首先启动Zookeeper

nohup zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties & nohup zookeeper-server-start.sh $ KAFKA_HOME / config / zookeeper.properties&

----- then istart kafka -----然后我启动kafka

nohup kafka-server-start.sh $KAFKA_HOME/config/server.properties & nohup kafka-server-start.sh $ KAFKA_HOME / config / server.properties&

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Kafka:从ZooKeeper获取经纪人主持人 - Kafka: Get broker host from ZooKeeper 如果Kafka经纪人无法连接到zookeeper怎么办? - What if a Kafka broker cannot connect to zookeeper? 未将Kerberized Kafka经纪人连接到Kerberized Zookeeper - Not Kerberized Kafka broker connection to Kerberized Zookeeper kafka缓存zkVersion不等于zookeeper经纪人没有恢复的情况 - Kafka cached zkVersion not equal to that in zookeeper broker not recovering Kafka中Zookeeper Vs Controller Broker的职责 - Responsibility of Zookeeper Vs Controller Broker in Kafka Kafka Topic、Broker、ZooKeeper 架构概览 - Kafka Topic, Broker, ZooKeeper architecture overview 在同一台机器的两个docker conatiners中创建kafka代理和zookeeper的利弊是什么 - what are the pros and cons of creating kafka broker and zookeeper in two docker conatiners in same machine kafka + Leader none + 并且 kafka broker id 未在 zookeeper 中签名 - kafka + Leader none + and kafka broker id not signed in zookeeper kafka.common.KafkaException:无法从zookeeper解析经纪人信息 - kafka.common.KafkaException: Failed to parse the broker info from zookeeper 建议为Apache kafka的zookeeper和broker使用的批量方法是什么? - What is the suggested volume method to use for zookeeper and broker for Apache kafka?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM