简体   繁体   中英

Kafka Broker vs Topic

A topic usually resides within the broker (server process) and has multiple partitions, but can it span across multiple brokers or nodes (machines)?

ie, lets say a topic is divided into two partitions, partition-1 and partition-2. Can partition-1 belong to broker-1 and partition-2 of the same topic belong to a different broker-2 or a different node altogether?

A Kafka cluster consists of one or more servers ( Kafka brokers ).

Each Broker can have one or more Topics . Kafka topics are divided into a number of partitions, each partition can be placed on a single or separate machine to allow for multiple consumers to read from a topic in parallel.

Yes, different partitions of a topic can be stored in multiple machines. But, a single partition has to be stored entirely in one machine.

Kafka Broker as the name stated its kind of controller or server who receives the request and does the particular operation. For example, Kafka broker receives messages from producers and stores them on disk keyed by unique offset. A broker can response unique message from topic, partition, and offset to the consumer on request

Whenever we think about Kafka Broker it's not a single unit but a group of the server which shares information using ZooKeeper. Kafka Brokers do not sit on one machine but able to distribute across a distributed cluster environment. This group of brokers deployed on Cluster coordinated by Zookeeper can be visualized Kafka Cluster . Brokers are the heart of Kafka Cluster and its connector to the outer words such as consumer, producer, confluent connector.

Kafka Topic consists of multiple partitions distributed across Brokers. One partition can be treated as leader other partitions will be a follower and in other broker and message get replicated using ISR.

You can assign leader partition by using Reassign Partitions Tool you can refer below link for more detail

https://cwiki.apache.org/confluence/display/KAFKA/Replication+tools

kafka 主题跨多个代理复制,以便多个消费者可以并行接收数据,或者在一个代理宕机的情况下,可以从具有相同主题分区的其他代理检索数据。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM