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
Set broker.rack=<rack-id> in each broker's server.properties, typically using the availability zone identifier as the rack ID
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
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
Verify placement with kafka-topics.sh --describe, checking that replicas for each partition land on brokers in different racks rather than clustering in one
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
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
broker.rack must be set before or consistently across the cluster before new topics are created — enabling it later does not retroactively rebalance existing partitions without an explicit reassignment
Rack awareness only affects replica placement, not leader election preference by default — pair with client.rack and RackAwareReplicaSelector if you specifically want consumers to prefer same-rack reads
Changing broker.rack requires a broker restart, so plan rack-ID assignment carefully upfront in cloud/multi-AZ deployments to avoid repeated rolling restarts
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?