简体   繁体   English

在Kafka中,是否可以从一个主题复制选择性分区?

[英]In Kafka, Is it possible to have replication for selective partitions from one topic?

As I understand that we can have replication at topic level where all partitions of a Topic will be replicated across cluster. 据我了解,我们可以在主题级别进行复制,其中主题的所有分区都将在整个集群中复制。 But can we control replication of only selective partitions from a topic? 但是我们可以控制主题中仅选择性分区的复制吗?

No. From the doc 否。来自文档

Kafka replicates the log for each topic's partitions across a configurable number of servers (you can set this replication factor on a topic-by-topic basis). Kafka在可配置数量的服务器上复制每个主题分区的日志(您可以在逐个主题的基础上设置此复制因子)。

If you think about the design of Kafka, what are Topics and Partitions, it makes sense: 如果您考虑Kafka的设计,什么是主题和分区,那么这很有意义:

  • Topics are streams or category of messages, so it's a way to organise your messages based on their type and content 主题是消息的流或类别,因此这是一种根据消息的类型和内容来组织消息的方法
  • partitions are basically a concept to handle smoothly distribution. 分区基本上是一个处理平稳分布的概念。 They are based on a Key, but the original idea is to split your messages evenly on all partitions of one Topic. 它们基于密钥,但是最初的想法是在一个主题的所有分区上平均划分您的消息。 It's not really designed to organise messages for business use, but for architectural constraint. 它并不是真正为组织业务用途而组织消息,而是为体系结构约束而设计。

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

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