I know that partitions are split across Kafka Broker. But the split is based on what ?. For instance, if I have 3 brokers and 6 partitions, how to ensure that each broker will have 2 partitions ? How this split is currently made in Kafka ?
相关问题
- Delete Messages from a Topic in Apache Kafka
- Serializing a serialized Thrift struct to Kafka in
- Kafka broker shutdown while cleaning up log files
- Getting : Error importing Spark Modules : No modul
- How to transform all timestamp fields when using K
相关文章
- Kafka doesn't delete old messages in topics
- Kafka + Spark Streaming: constant delay of 1 secon
- Spring Kafka Template implementaion example for se
- How to fetch recent messages from Kafka topic
- Determine the Kafka-Client compatibility with kafk
- Kafka to Google Cloud Platform Dataflow ingestion
- Kafka Producer Metrics
- Spark Structured Streaming + Kafka Integration: Mi
Assignment policy is an internal implementation detail and not documented as it can get changed at any point in time. Thus, you should not rely the this algorithms stay the same. Furthermore, there is nothing you can do to influent/configure this internal strategy.
The basic policy is to ensure load balancing, i.e., it assigns partitions to brokers that have less partitions assigned than other. Thus, for your example each broker will get 2 partitions assigned.
Furthermore, for partitions replicas a "rack aware" policy is applied (as of Kafka 0.10). That means that partition replicas are assigned to different racks if possible to guard again offline partitions if a whole rack fails. See this KIP for more details about this: https://cwiki.apache.org/confluence/display/KAFKA/KIP-36+Rack+aware+replica+assignment