랙 인식 및 다중 AZ 배치
Kafka의 랙 인식 기능이 랙과 가용 영역에 복제본을 분산하여 데이터센터 수준의 장애를 견디는 방식을 배우세요.
랙 인식 및 다중 AZ 배치은(는) CoddyKit의 무료 Apache Kafka & Stream Processing Fundamentals 강의입니다. 이것은 4개 중 4번째 강의입니다. 아래에서 전체 강의를 무료로 읽을 수 있으며, 내장 코드 에디터와 24/7 AI 튜터와 함께 브라우저에서 직접 실습할 수 있습니다. 이 강의는 Apache Kafka & Stream Processing Fundamentals 학습 경로의 일부이며, 진행 상황이 웹과 CoddyKit 앱에 동기화됩니다. Apache Kafka & Stream Processing Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.
이 강의의 일부는 아직 번역되지 않았으며 영어로 표시됩니다.
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-1bHow Replicas Get Spread
When a topic is created, Kafka's replica assignment algorithm alternates across racks.
For a partition with replication factor 3 and 3 racks, each replica lands on a distinct rack — guaranteeing the partition survives the loss of any single rack.
Cloud Availability Zones
In AWS, GCP, or Azure, map broker.rack to the availability zone (AZ).
- AZs are physically isolated within a region.
- Spreading replicas across AZs protects against a full AZ outage.
- Beware cross-AZ network costs for replication traffic.
Creating a Rack-Aware Topic
No special flag is needed — if brokers have broker.rack set, topic creation is automatically rack-aware.
kafka-topics.sh --create \
--bootstrap-server localhost:9092 \
--topic orders \
--partitions 6 \
--replication-factor 3Verifying Replica Placement
Use --describe to inspect which brokers hold each replica, then cross-check against broker racks.
kafka-topics.sh --describe \
--bootstrap-server localhost:9092 \
--topic ordersThe min.insync.replicas Tie-In
Rack awareness protects placement, but durability also depends on min.insync.replicas.
With replicas spread across 3 AZs and min.insync.replicas=2, a producer using acks=all can still write even if one entire AZ is down.
Follower Fetching from Closest Replica
Kafka 2.4+ supports fetch from follower. Consumers can read from a replica in their own rack, cutting cross-AZ traffic and latency.
# broker config
replica.selector.class=org.apache.kafka.common.replica.RackAwareReplicaSelector
# consumer config
client.rack=us-east-1aLimitations to Know
Rack awareness is best-effort:
- If racks < replication factor, some replicas share a rack.
- Reassignments triggered manually do not always respect racks unless you generate a rack-aware plan.
- It does not rebalance existing topics when you add
broker.racklater.
Generating a Rack-Aware Reassignment
To fix existing topics after enabling rack awareness, generate a reassignment plan with the reassign-partitions tool.
kafka-reassign-partitions.sh \
--bootstrap-server localhost:9092 \
--topics-to-move-json-file topics.json \
--broker-list 1,2,3 \
--generateDesign Checklist
Before going to production:
- Replication factor >= number of racks you want to tolerate losing + 1.
- Set
min.insync.replicasto at least 2. - Use
acks=allon critical producers. - Enable follower fetching to control cross-AZ costs.
Quick Check
Test your understanding of rack awareness.
Recap
You learned how rack awareness spreads replicas across racks and availability zones.
- Set
broker.rackper broker. - Topic creation becomes automatically rack-aware.
- Combine with
min.insync.replicasandacks=allfor AZ-failure resilience. - Use follower fetching to reduce cross-AZ cost.
자주 묻는 질문
“랙 인식 및 다중 AZ 배치” 강의는 무료인가요?
네 — “랙 인식 및 다중 AZ 배치” 전체 내용을 이 웹사이트에서 무료로 읽을 수 있습니다. 인터랙티브하게 실습하려면(내장 코드 에디터와 24/7 AI 튜터), CoddyKit PRO로 업그레이드하면 Apache Kafka & Stream Processing Fundamentals 강의 전체를 잠금 해제할 수 있습니다. Apache Kafka & Stream Processing Fundamentals 강의에는 총 4개의 강의가 포함되어 있습니다.
“랙 인식 및 다중 AZ 배치”에서 뭘 배우나요?
Kafka의 랙 인식 기능이 랙과 가용 영역에 복제본을 분산하여 데이터센터 수준의 장애를 견디는 방식을 배우세요. 브라우저에서 직접 실행하는 실습 코드로 Apache Kafka & Stream Processing Fundamentals을(를) 배우며, 24/7 AI 튜터가 강의를 진행하면서 질문에 답변해줍니다.
Apache Kafka & Stream Processing Fundamentals을(를) 시작하는 데 경험이 필요한가요?
사전 경험은 필요하지 않습니다. CoddyKit의 Apache Kafka & Stream Processing Fundamentals은(는) 초급자부터 고급 학습자까지를 위해 구성되어 있으므로, 여기서 시작하거나 처음부터 시작할 수 있으며 자신의 속도대로 진행할 수 있습니다. 이것은 4개 중 4번째 강의입니다.
“랙 인식 및 다중 AZ 배치” 강의는 얼마나 걸리나요?
대부분의 CoddyKit 강의는 약 5~10분이 소요됩니다. 각 강의는 간결하고 인터랙티브하여 꾸준한 진행이 가능하며, 웹과 앱에서 중단한 부분부터 바로 시작할 수 있습니다.
이 Apache Kafka & Stream Processing Fundamentals 강의에서 코드를 작성하고 실행할 수 있나요?
네. 모든 Apache Kafka & Stream Processing Fundamentals 강의에는 내장 코드 에디터가 포함되어 있으므로, 브라우저에서 바로 실제 코드를 작성하고 실행한 후 즉시 AI 피드백을 받을 수 있습니다 — 로컬 설정이 필요 없습니다.
이 강의의 모든 강의
- 복제 및 장애 허용
- 컨트롤러 및 ZooKeeper/Kraft 역할
- Kafka 클러스터 설계
- 랙 인식 및 다중 AZ 배치