Rack Awareness & Multi-AZ Placement
Learn how Kafka rack awareness spreads replicas across racks and availability zones to survive datacenter-level failures.
What Is Rack Awareness?
Rack awareness tells Kafka about the physical (or cloud) topology of your brokers.
Without it, all replicas of a partition could land on brokers sharing the same rack or availability zone. If that zone fails, the partition becomes unavailable.
- Each broker advertises a
broker.rackvalue. - Kafka then places replicas on different racks when possible.
Configuring broker.rack
Set broker.rack in each broker's server.properties to identify its rack or zone.
# server.properties on a broker in us-east-1a
broker.id=1
broker.rack=us-east-1a
# Another broker in a different zone
broker.id=2
broker.rack=us-east-1bAll lessons in this course
- Replication & Fault Tolerance
- Controller & ZooKeeper/Kraft Roles
- Designing a Kafka Cluster
- Rack Awareness & Multi-AZ Placement