Mirror Maker 를 통한 데이터 적재 중에 오류가 발생하는 경우, 데이터 유실 여부를 확인하기 위한 테스트다. 2022년 테스트 됨. 설정 키와 실행 명령은 4.3 에서도 같다[1].
정상적인 데이터 미러링 진행.
vi config/east-test.prop
clusters = A, B
A.bootstrap.servers = 192.168.103.151:9092, 192.168.103.152:9092, 192.168.103.153:9092
B.bootstrap.servers = 192.168.103.154:9092, 192.168.103.155:9092, 192.168.103.156:9092
A->B.enabled = false
A->B.topics =
B->A.enabled = true
B->A.topics = east.*
replication.factor=2
A.producer.max.request.size=102400000
B.producer.max.request.size=102400000
checkpoints.topic.replication.factor=2
heartbeats.topic.replication.factor=2
offset-syncs.topic.replication.factor=2
offset.storage.replication.factor=2
status.storage.replication.factor=2
config.storage.replication.factor=2
bin/connect-mirror-maker.sh config/east-test.prop
퍼포먼스 테스트 Producer 실행. 10MB × 3000 records × 2 replication = 60GB.
bin/kafka-producer-perf-test.sh --topic east-test --num-records 3000 --throughput -1 --producer-props bootstrap.servers=kafka04:9092,kafka05:9092,kafka06:9092 --print-metric --record-size 10240000 --producer.config config/producer.properties
테스트 결과.
3000 records sent, 2.302036 records/sec (22.48 MB/sec), 1541.35 ms avg latency, 4758.00 ms max latency, 1558 ms 50th, 2877 ms 95th, 3399 ms 99th, 4080 ms 99.9th.
| Source | |||
|---|---|---|---|
| kafka04 | kafka05 | kafka06 | |
| Partition 0 | 9.6 G (10050212 KB) | 9.6 G (10050216 KB) | |
| Partition 1 | 9.8 G (10190212 KB) | 9.8 G (10190212 KB) | |
| Partition 2 | 9.4 G (9760208 KB) | 9.4 G (9760212 KB) | |
| Target | |||
| ----------- | ------------------- | ------------------- | ------------------- |
| kafka01 | kafka02 | kafka03 | |
| Partition 0 | 9.6 G (10050208 KB) | 9.6 G (10050208 KB) | |
| Partition 1 | 9.8 G (10190208 KB) | 9.8 G (10190208 KB) | |
| Partition 2 | 9.4 G (9760204 KB) | 9.4 G (9760204 KB) |
데이터 미러링 중 Broker 종료. kafka06 Broker 의 Partition 0, 2 에 각각 2.5GB 적재된 상황에서 Broker 를 종료했다.
퍼포먼스 테스트 Producer 실행. 10MB × 3000 records × 2 replication = 60GB.
bin/kafka-producer-perf-test.sh --topic east-test --num-records 3000 --throughput -1 --producer-props bootstrap.servers=kafka04:9092,kafka05:9092,kafka06:9092 --print-metric --record-size 10240000 --producer.config config/producer.properties
테스트 결과.
3000 records sent, 2.664166 records/sec (26.02 MB/sec), 1306.02 ms avg latency, 5924.00 ms max latency, 1298 ms 50th, 2510 ms 95th, 3045 ms 99th, 4716 ms 99.9th.
| Source | |||
|---|---|---|---|
| kafka04 | kafka05 | kafka06 | |
| Partition 0 | 9.5 G (9930212 KB) | 1.3 G (1360056 KB) | |
| Partition 1 | 9.7 G (10100212 KB) | 9.7 G (10100212 KB) | |
| Partition 2 | 9.6 G (9970212 KB) | 1.5 G (1480056 KB) | |
| Target | |||
| ----------- | ------------------- | ------------------- | ------------------ |
| kafka01 | kafka02 | kafka03 | |
| Partition 0 | 9.5 G (9930208 KB) | 9.5 G (9930208 KB) | |
| Partition 1 | 9.7 G (10100208 KB) | 9.7 G (10100208 KB) | |
| Partition 2 | 9.6 G (9970208 KB) | 9.6 G (9970208 KB) |
테스트 전 Metadata size 4KB 차이를 제외하고 정상 적재 완료. 소스 브로커 한 대가 죽어도 복제 계수 2 이상이면 타깃의 적재량은 같았다.
Kafka 4.3 — Geo-Replication (Cross-Cluster Data Mirroring) — 2026-09-20 확인. https://kafka.apache.org/43/operations/geo-replication-cross-cluster-data-mirroring/ ↩︎