[英]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,您首先要设置系统环境(可选),然后执行以下命令:
nohup zookeeper-server-start.sh $KAFKA_HOME/config/zookeeper.properties & nohup zookeeper-server-start.sh $ KAFKA_HOME / config / zookeeper.properties&
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.