Configure Kafka broker rack awareness so replicas are spread across availability zones

domain: kafka.apache.org · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Set broker.rack=<rack-id> in each broker's server.properties, typically using the availability zone identifier as the rack ID
  2. Restart each broker to apply the config, since broker.rack is a read-only/startup config that cannot be changed at runtime without a restart
  3. When topics are created or replicas are reassigned afterward, Kafka's replica placement algorithm will honor rack constraints, spreading each partition's replicas across min(#racks, replication-factor) distinct racks
  4. Verify placement with kafka-topics.sh --describe, checking that replicas for each partition land on brokers in different racks rather than clustering in one
  5. Optionally set client.rack on consumers to match their AZ, and enable the built-in rack-aware replica selector so consumers preferentially fetch from an in-rack replica instead of always the partition leader, reducing cross-AZ transfer
  6. For existing topics created before rack awareness was enabled, run a partition reassignment to redistribute existing replicas according to the new rack constraints

Known gotchas

Related routes

Configure Elasticsearch shard allocation awareness to spread replicas across availability zones
elastic.co · 5 steps · unrated
Configure topology spread constraints to distribute pods evenly across availability zones
kubernetes.io · 5 steps · unrated
Configure Kafka producer acks=all with topic min.insync.replicas for strong durability guarantees
kafka.apache.org · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans