Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Kafka and Friends (ko)

Kafka and Friends (ko)

Kafka와 그 친구들: Kafka를 운영하는 데 사용되는 다양한 툴들에 관하여.
2019년 7월 3일, Cloudera Openday 2019 에서 발표.

Kafka and friends: About the tools for monitoring, operating, testing Kaka.
Presented in Cloudera Openday 2019, July 3rd, 2019.

Slides: Korean. Presentation: Korean.

Lee Dongjin

July 03, 2019
Tweet

More Decks by Lee Dongjin

Other Decks in Technology

Transcript

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

    View Slide

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

    View Slide

  3. © 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)
    ● 기타 등등...

    View Slide

  4. © 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

    View Slide

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

    View Slide

  6. © 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이 적음.

    View Slide

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

    View Slide

  8. © 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

    View Slide

  9. © 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
    • 쉽고, 편하고, 범용임.

    View Slide

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

    View Slide

  11. © 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
    • 어려움 + 기술 지원 없음.

    View Slide

  12. © 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
    • 오픈 소스 + 기술 지원

    View Slide

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

    View Slide

  14. © 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

    View Slide

  15. © 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

    View Slide

  16. © 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 유료 -

    View Slide

  17. © 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

    View Slide

  18. © 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)

    View Slide

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

    View Slide