$30 off During Our Annual Pro Sale. View Details »

“Running Apache Samza on Kubernetes” Recap : KubeCon2019@NA

yosshi_
December 03, 2019

“Running Apache Samza on Kubernetes” Recap : KubeCon2019@NA

“Running Apache Samza on Kubernetes”
Recap : KubeCon2019@NA

yosshi_

December 03, 2019
Tweet

More Decks by yosshi_

Other Decks in Technology

Transcript

  1. ç
    “Running Apache Samza on Kubernetes”
    Recap : KubeCon2019@NA
    Kubernetes Meetup Tokyo #26@Yahoo
    @yosshi_

    View Slide

  2. ● 吉村 翔太
    ● NTTコミュニケーションズ所属
    ● データサイエンスチーム
    ● インフラエンジニア/データエンジニアリング
    ● Kurbernetes 、Prometheus  etc
    ● 趣味:ボードゲーム
    ● コミュニティ活動 “Cloud Native Developers JP”
    @yosshi_
    自己紹介

    View Slide

  3. 簡単なsamzaの話

    View Slide

  4. 取り上げるセッション
    参考< https://sched.co/Uacc >

    View Slide

  5. • 簡単なsamzaの話
    • 最近のHadoopの動向
    • もう少し、詳しくsamzaの話
    本日の目次

    View Slide

  6. About Apache Samza
    2018年11月にApache Samza 1.0.0をリリース

    View Slide

  7. Samza on Kubernetes
    • YARN(Hadoopのリソース管理)に加えて、
    Kubernetesにも対応

    View Slide

  8. Kubernetes上で動く他のストリーミング処理
    • Spark on Kubernetes • Flink on Kubernetes

    View Slide

  9. 参考:SparkとFlinkの資料
    • Spark
    – ドキュメント
    • https://github.com/GoogleCloudPlatform/spark-on-k8s-operator
    – KubeCon2019@NAのセッション
    • Kubernetizing Big Data and ML Workloads at Uber - Mayank Bansal & Min Cai, Uber
    https://sched.co/Uaad
    • Flink
    – ドキュメント
    • https://ci.apache.org/projects/flink/flink-docs-stable/ops/deployment/kubernetes.html
    – KubeCon2019@NAのセッション
    • Managing Apache Flink on Kubernetes - FlinkK8sOperator - Anand Swaminathan, Lyft
    https://sched.co/UabA

    View Slide

  10. 最近のHadoopの動向

    View Slide

  11. Hadoopの動向(2018年9月まで)
    • オンプレでHadoopを使う場合は、
    だいたい以下のディストリビューションのどれかを使う
    ディストリビューションを使わないことも出来はするが・・・厳しい

    View Slide

  12. Hadoopの動向(2018年10月以降の世界)
    • 2018年10月にClouderaとHortonworksの合併が発表
    • 2019年1月合併完了

    View Slide

  13. Unity1.0 Unity2.0
    ディストリビューションの統合
    合併後3年間は保守する方向らしい(2022年?)
    統合していくらしい 2021年くらいに全ての機能が統合?

    View Slide

  14. Cloudera Data Platform(CDP)
    • 現在、AWSでサポート、
    AzureおよびGCPでも近々にサポートが開始される予定
    “Unity1.0”の実態?
    AWS版のアーキテクチャはEKS(Elastic Kubernetes Servic)とS3ベース
    オンプレのとき
    Kubernetesは
    どうするんだろ?

    View Slide

  15. 参考:データ分析組織に必要なスキルセット
    インフラ
    業務知識
    データ
    サイエンス
    データ
    エンジニアリング
    IPAの”ITSS+”とかが参考になる
    統計
    R
    Python
    SQL
    Hadoop
    Spark

    View Slide

  16. Kubernetes前提のデータ分析の組織
    Kuberntesのクラスタ
    Hadoopのクラスタ
    データエンジニア
    データサイエンス
    業務
    データエンジニア
    Hadoopのクラスタ
    Kuberntesのクラスタ
    業務
    データサイエンス
    理想 現実
    別々の
    チーム
    同じ人が
    やる

    View Slide

  17. CDP
    今後のオンプレでのHadoop環境の選択
    今、使ってる人たち
    保守期限まで粘る
    信じて待つ
    第3の道 ex) 自分たちで頑張る

    View Slide

  18. 今後のオンプレでのデータパイプライン
    • ディストリビューション買っても、k8s前提なら結局
    バッチ/ストリーミング処理
    Pub/Sub 永続化
    Kafka Kubernetes ストレージ or DB
    2,3年くらい待つくらいなら自分たちで検証しても

    View Slide

  19. もう少し、詳しくsamzaの話

    View Slide

  20. About Apache Samza (2回目)
    • Samza開発者のひとりであるLinkedInのChris Riccominiの話
    – 「KafkaがHDFSなら、SamzaはMapReduceにあたる存在」
    • Samzaのネーミング
    – フランツ・カフカ(Franz Kafka)の小説の「変身」の主人公である
    グレゴール・ザムザ(Gregor Samsa)

    View Slide

  21. About Apache Kafka(1/2)
    • Linkedinで開発され、2011年にOSS化
    • 大事な役割
    – Message queue
    – Message hub
    Kafkaのない世界 Kafkaのある世界
    参考< https://engineering.linkedin.com/distributed-systems/log-what-every-software-engineer-should-know-about-real-time-datas-unifying/ >

    View Slide

  22. About Apache Kafka(2/2)
    • 大事な機能
    – Partition
    – Offset
    参考< https://kafka.apache.org/intro >
    Offset
    Partition

    View Slide

  23. Typical Use Cases of Samza

    View Slide

  24. Samza Features
    重複は許容

    View Slide

  25. Samza Concept Overview
    • Samza processes streams. A stream is composed of immutable messages of a
    similar type or category. In Kafka a stream is a topic.

    View Slide

  26. Advanced Concept Overview (1/2)
    • Partition: each stream is broken into one or more partitions, which is an ordered,
    replayable sequence of records.
    • Task: the unit of parallelism of the job, just as the partition is to the stream.
    コンテナ数を増やすとスケール
    (ただし多重度の限界はprtition数に依存)

    View Slide

  27. Advanced Concept Overview (2/2)
    • Job Coordinator
    – manage the assignment of tasks across the individual containers
    – monitor the liveness of individual containers
    – redistribute the tasks among the remaining ones during a failure

    View Slide

  28. Fault tolerance
    どのoffsetまで処理したかを記録しているので、故障時は記録を元に再開
    ただし、処理は済んだが記録する前に故障した場合、復旧時に処理が重複する
    参考< hhttps://samza.apache.org/learn/documentation/latest/architecture/architecture-overview.html >

    View Slide

  29. Samza & Kubernetes: Working Together

    View Slide

  30. Workflow

    View Slide

  31. Proposed Changes
    • The Samza Operator, similar to the Samza AM in YARN, is the control hub for Samza applications running on
    Kubernetes. It is responsible for requesting Pods from Kubernetes and coordinating work assignment
    across Pods.
    • Below graph describes the lifecycle of a Samza application running on Kubernetes.
    参考

    View Slide

  32. Overview - Samza on Kubernetes

    View Slide

  33. Node – Zoom In

    View Slide

  34. Samza on YARN
    • Samza leverages YARN for scheduling, resource-management, and deployment.

    View Slide

  35. Kubernetes vs Apache Yarn
    k8s版はなし

    View Slide

  36. Samzaの今後
    • Adding support for other languages, like Python
    • Hot-standby containers to support applications with strict downtime requirements
    • Making it easy to auto-scale and auto-tune Samza applications
    • Supporting machine learning related use cases
    • Enabling end-to-end exactly once processing
    参考< https://engineering.linkedin.com/blog/2018/11/samza-1-0--stream-processing-at-massive-scale>

    View Slide