05.KafkaClusterUpgrade,Expansion,Shrink
Kafka Cluster ํ์ฅ
๊ณ ์ ํ ID๋ฅผ ๋ถ์ฌํ ์๋ก์ด Broker๋ฅผ Zookeeper Ensemble์ ์ฐ๊ฒฐ๋ง ํ๋ฉด ๋จ ํ์ง๋ง, ์๋์ผ๋ก Partition์ ์๋ก์ด Broker๋ก ์ฎ๊ฒจ์ฃผ์ง ์์
kafka-reassign-partitions ๋๊ตฌ
Confluent Auto Data Balancer/Self-Balancing Cluster ๊ธฐ๋ฅ

kafka-reassign-partitions ๋ช
๋ น
๊ณ์ฐ ์ค์๋ก ์ธํ ๋ฌธ์ ๋ฐ์ ๊ฐ๋ฅ์ฑ ์กด์ฌ
kafka-reassign-partitions \\
--bootstrap-server kafka1:9092 \\
--zookeeper zk1:2181 \\
--reassignment-json-file reassignment.json \\
--execute

Confluent ADB(Auto Data Balancer)
Cluster๋ด์ ์ ์ฒด Broker์ ๋ํ Partition ๋ฆฌ๋ฐธ๋ฐ์ฑ์ ๋ช ๋ น์ด ํ๋๋ก ์๋ ๊ณ์ฐ ๋ฐ ์ํ
confluent-rebalancer execute \\
--zookeeper zk1:2181 \\
--metrics-bootstrap-server kafka1:9092,kafka2:9092 \\
--throttle 2000000 \\
--verbose \\
--force
ํ๋ฒ์ ํ๋์ ๋ฆฌ๋ฐธ๋ฐ์ฑ๋ง ์ํ ๊ฐ๋ฅ
์์คํ ์์์ ๋ง์ด ์ฌ์ฉ - Throttle(bytes/sec) ์ต์ ์ผ๋ก ์ ์ด
Cluster๋ด์ ์ ์ฒด Broker๊ฐ ์ด์์์ ๋๋ง ๋์

Confluent Self-Balancing Cluster
On/Off ๋ฅผ ๋งค์ฐ ๊ฐ๋จํ๊ฒ ์ค์ ํ๋ฉฐ, ๊ณ์ฐ ๋ฐ ์คํ์ ๋ชจ๋ ์๋ํ
Broker ๋ ธ๋ ์ถ๊ฐ์, ์๋์ผ๋ก ๋ฆฌ๋ฐธ๋ฐ์ฑ ์คํ

Partition ์ด๋
Downtime ์์ด Partition์ ์ด๋
๋ฆฌ๋ฐธ๋ฐ์ฑ๋์ Disk ์ฌ์ฉ๋ฅ ์ด ์ฆ๊ฐ

Kafka Cluster ์ถ์
Broker๋ฅผ ์ค์ด๋ ์ด์ ?
Cluster ์ฌ์ฉ๋ฅ ์ด ๋ฎ์ ๊ฒฝ์ฐ, ๋น์ฉ์ ์๋ผ๊ธฐ ์ํด์
Broker ์ฅ๋น์ ๋ํ ์ ์ง๋ณด์ ๋ฑ
Broker ํด์ ํ๋ ๋ฐฉ๋ฒ
Auto Data Balancer ๋๋ kafka-reassign-partition์ ์ฌ์ฉํ์ฌ, ์ ๊ฑฐํ Broker์ Partition๋ค์ ๋ค๋ฅธ Broker์ ์ฌํ ๋น
kafka-reassign-partition ๋ Broker์ Partition๋ค์ ์์์ ์ผ๋ก ๋ชจ๋ ์ฎ๊ฒจ์ผ ํจ
Auto Data Balancer ๋ --remove-broker-ids ์ต์ ์ ์ฌ์ฉํ์ฌ ์ ๊ฑฐํ Broker๋ฅผ ์ฝ๊ฒ ์ง์ ํ์ฌ Partition ์ฌํ ๋น
์ ๊ฑฐํ Broker๋ฅผ Controlled Shutdown(kafka-sever-stop)์ ์คํ
Self-Balancing Cluster ๋ kafka-remove-brokers ๋ช ๋ น์ผ๋ก ์ ๊ฑฐํ Broker๋ฅผ Shutdown๋ง ํ๋ฉด ์๋์ผ๋ก Partition ์ฌํ ๋น
Broker ์ฅ๋น ๊ต์ฒด
Broker ์ฅ๋น ๊ต์ฒด ์, ๊ต์ฒด ๋์ Broker์ ID ๋ง ๋์ผํ๊ฒ ์ค์ ํ๊ณ ์๋ก์ด Broker๋ฅผ ๊ธฐ๋
Peak ์๊ฐ์ ํผํด์ ์ํํด์ผ ํจ
Broker๋ Recovery ์ค์ ๊ฐ๋ฅํ ํ ๋นจ๋ฆฌ ๋ฐ์ดํฐ๋ฅผ ๋นจ๋ฆฌ ๋ณต์ฌ ์ด๋ ๋คํธ์ํฌ์ ์ค์ํ impact ๋ฐ์ ๊ฐ๋ฅ
Last updated