Slide 1

Slide 1 text

KAFKA와 그 친구들 Lee Dongjin ([email protected])

Slide 2

Slide 2 text

© 2019 Cloudera, Inc. All rights reserved. 2 개요 • 다양한 Kafka Ecosystem Tool 소개 ● 모니터링 • Partition, Broker, JVM, ... ● 운영 • Upgrade, Rebalancing, Mirroring, ... ● 개발 • Testing, ...

Slide 3

Slide 3 text

© 2019 Cloudera, Inc. All rights reserved. 3 발표자 소개 • Kafka Contributor • 다양한 Kafka 기능들을 개발 / Bug Fix ● ZStandard Support (KIP-110) ● Fine-grained Compression Configuration Support (KIP-390) ● KafkaStreams close bug fix (KIP-459) ● 기타 등등...

Slide 4

Slide 4 text

© 2019 Cloudera, Inc. All rights reserved. 4 • Kafka = 분산 Log System ● "Producer가 Broker에 보내면, Broker는 Log에 쓰고, Consumer는 받는다." ● "모든 작업은 Leader Partition에서 순차적으로 이루어진다." Kafka 모니터링: 왜 어려운가? (1) Follower Partition (2) Follower Partition (1) Producer Consumer (1) Consumer (2) Broker Leader Partition

Slide 5

Slide 5 text

© 2019 Cloudera, Inc. All rights reserved. 5 Kafka 모니터링: 왜 어려운가? (2) MySQL Cluster Kafka Cluster ‘Replication’ 부하 분산 Failover Hotspot 요청을 많이 받는 Instance 요청이 들어오는 Leader Partition을 많이 보유한 Broker Scale-out Instance별 부하 감소 ... Hotspot 위치 정적 옮겨다님

Slide 6

Slide 6 text

© 2019 Cloudera, Inc. All rights reserved. 6 • 다양한 층위에 대해 각각 모니터링 해야 함. Kafka 모니터링: 왜 어려운가? (3) Partition Leader 여부, Client 수, Consumer Lag, ... Broker FailedProduceRequestsPerSec, LeaderCount, ... JVM JVM Memory, Garbage Collection, ... Host CPU %, Memory %, Network I/O, Disk Space, ... 범용: 잘 알려져 있고, 사용할 수 있는 Tool이 많음. 전용: 잘 알려져 있지 않고, 사용할 수 있는 Tool이 적음.

Slide 7

Slide 7 text

© 2019 Cloudera, Inc. All rights reserved. 7 Kafka 모니터링: 왜 어려운가? (4) 실제 사례: 특정 Topic에서 쓰던 Gzip 문제가 JVM 전체로 번짐 (KAFKA-8546)

Slide 8

Slide 8 text

© 2019 Cloudera, Inc. All rights reserved. 8 Kafka 모니터링: 왜 어려운가? (5) • Partition 모니터링하기: Consumer Lag ● {LEO} - {LCO} ● '밀린 메시지 수' ● 문제가 생기면 반드시 치솟는다. • Consumer 문제 (LCO) • Cluster 문제 (HW) ● 치솟는다고 항상 문제는 아님. (False Positive) LEO (Log End Offset) LCO (Last Committed Offset) HW (High Watermark) Kafka Log Offset

Slide 9

Slide 9 text

© 2019 Cloudera, Inc. All rights reserved. 9 모니터링 툴 (1) - Kafka Manager • by Yahoo ● https://github.com/yahoo/kafka-manager • 여러 Kafka Cluster의 현재 상태를 Web Interface 상에서 보여 줌. ● Broker Metric + Consumer Lag • 쉽고, 편하고, 범용임.

Slide 10

Slide 10 text

© 2019 Cloudera, Inc. All rights reserved. 10 모니터링 툴 (2) - Kafka Manager

Slide 11

Slide 11 text

© 2019 Cloudera, Inc. All rights reserved. 11 모니터링 툴 (3) - Kafka Monitor + Burrow • By Linkedin ● https://github.com/linkedin/kafka-monitor ● https://github.com/linkedin/Burrow • 강력한 기능과 확장성 ● Regression Test ● Time window based notification • 어려움 + 기술 지원 없음.

Slide 12

Slide 12 text

© 2019 Cloudera, Inc. All rights reserved. 12 모니터링 툴 (4) - Streams Messaging Manager • By Cloudera ● https://hortonworks.com/products/data- platforms/dataplane/streams-messaging- manager/ • 편리한 UI + 다른 툴들과의 통합 ● Notification ● Schema Registry • 오픈 소스 + 기술 지원

Slide 13

Slide 13 text

© 2019 Cloudera, Inc. All rights reserved. 13 모니터링 툴 (5) - Streams Messaging Manager • Data의 흐름을 보여 줌. ● 관심이 가는 Topic의 내용을 바로 열어볼 수 있음.

Slide 14

Slide 14 text

© 2019 Cloudera, Inc. All rights reserved. 14 모니터링 툴 (6) - 기타 • Chaperone (by Uber) ● https://github.com/uber/chaperone ● Web Dashboard • Remora (by Zalando) ● https://github.com/zalando-incubator/remora ● Integration with AWS CloudWatch / DataDog • Kafka Lag Exporter (by Lightbend) ● Integration with Prometheus / Grafana

Slide 15

Slide 15 text

© 2019 Cloudera, Inc. All rights reserved. 15 모니터링 툴 (7) - 비교 이름 개발 비용 비고 Kafka Manager Yahoo 무료 ● 쉽고 단순 Kafka Monitor + Burrow Linkedin 무료 ● 강력한 기능 + 확장성 ● 어려움 SMM Cloudera 무료 (w/ support) ● 편리한 UI ● 편리한 기능 Chaperone Uber 무료 ● Web Dashboard Remora Zalando 무료 ● Consumer Lag Kafka Lag Exporter Lightbend 무료 (w/ support) ● Consumer Lag

Slide 16

Slide 16 text

© 2019 Cloudera, Inc. All rights reserved. 16 운영 툴 - 미러링 이름 개발 유/무료 비고 MirrorMaker Kafka Community 무료 ● Kafka Built-in MirrorMaker 2 Kafka Community (Cloudera) 무료 (?) ● Kafka Built-in ● WIP (2.4.0) Brooklin MirrorMaker Linkedin 무료 ● 범용 Framework Mirus Salesforce 무료 - uReplicator Uber 무료 ● Chaperone 기반 ● 범용성...? Replicator Confluent 유료 -

Slide 17

Slide 17 text

© 2019 Cloudera, Inc. All rights reserved. 17 운영 툴 - 기타 • Kafka Utils (by Yelp) ● https://github.com/Yelp/kafka-utils ● Monitoring Tool 역할도 함. (단, command line 한정) ● Rolling Upgrade, Rebalance, ... • Kafka Kit (by Data Dog) ● https://github.com/DataDog/kafka-kit ● Rebalance

Slide 18

Slide 18 text

© 2019 Cloudera, Inc. All rights reserved. 18 개발 툴 • Kafka-junit (by Salesforce) ● https://github.com/salesforce/kafka-junit ● 단위 테스트/통합 테스트 라이브러리 ● 개발 환경에 in-memory kafka를 띄워 준다. • KafkaKat ● https://github.com/edenhill/kafkacat ● unix netcat 명령어의 kafka 버전 (non-JVM)

Slide 19

Slide 19 text

© 2019 Cloudera, Inc. All rights reserved. 19 질문?