Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Apache Kafka on Kubernetes 基礎編 ワークショップ QA 2021...
Search
suzukiry
November 30, 2021
Technology
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Apache Kafka on Kubernetes 基礎編 ワークショップ QA 2021-11-24 / Apache Kafka Workshop QA 2021-11-24
suzukiry
November 30, 2021
More Decks by suzukiry
See All by suzukiry
OpenShiftの内部レジストリって何?/What's OpenShift Image Registry
suzukiry
1
2k
Strimzi Kafka Operator を試す Part 3 / Try Strimzi Part3
suzukiry
0
660
Apache Kafka on Kubernetes 基礎編 ワークショップ QA 2022-01-12 / Apache Kafka Workshop QA 2022-01-12
suzukiry
0
130
GitOps と Apache Kafka Part 1 / GitOps and Apache Kafka Part 1
suzukiry
0
340
Strimzi Kafka Operator を試す Part 2 / Try Strimzi Part2
suzukiry
0
400
Apache KafkaとKubernetes / Kafka and K8s
suzukiry
1
1.6k
Other Decks in Technology
See All in Technology
日本AIベンチャーレポート2026
kentarofujii
0
240
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
420
アカウント統制の健康診断
kenichinakamura
1
200
AI時代、つくる力を自分たちの手に。 ──電通×KAG、アジャイルとAI駆動開発で挑む開発の変革
yuukiyo
3
390
BacklogのRAG 今ならこう作る - S3 Vectorsと自前パイプラインの勘所
revsystem
0
140
Maestro MCPとClaude Code Skillsによる自律的なE2Eテスト支援
asmz
0
250
AIに任せられるFlutterコードベースを作る 〜仕様をコードで表し、ハーネスで守る〜
myohei
1
240
小規模OSSモデルは サイバーセキュリティ業務に どこまで使えるか
bbrbbq
0
300
外国人エンジニアがVueプロトタイプで仕様を合わせている話 / Vue Fes Japan 2026 LT
eluwing
0
170
[re:Invent2026事前勉強会(有志開催)]続きは、ラスベガスの廊下で / continue-in-the-vegas-hallway
sh_fk2
0
290
QAエンジニアがSoutherを使ってみたの〜10分でわかるSouther〜
mhlyc
0
120
局所最適は悪ではない。壊れているのは指標です。量と質を同時に見る先行指標の設計
recruitengineers
PRO
3
1.3k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
580
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
SEO for Brand Visibility & Recognition
aleyda
0
4.8k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
How to train your dragon (web standard)
notwaldorf
96
6.9k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
550
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
1k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
510
Designing Experiences People Love
moore
143
24k
Practical Orchestrator
shlominoach
192
12k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
810
Transcript
Apache Kafka on Kubernetes基礎編 ワークショップ QA 2021.11.24 分
Strimzi • Apache KafkaのクラスタをKubernetes上で管理するOperator ◦ オープンソースプロジェクト( Apache License 2.0) ◦
Cloud Native Computing Foundation (CNCF) • Strimzi で提供するもの: ◦ Apache Kafka, Connect, Zookeeper, MirrorMaker2 の コンテナイメージ ◦ Apache Kafka clusters, topics and users を管理するKubernetes Operators
QA
Note: 冪等性はありますか? • Kafkaと外部サービス(DBなど)とが接続する場合、冪等性を完全に保つことはでき ません。 ◦ メッセージの重複が発生する可能性があります *。 • Kafka
StreamsにはExactly Once Semantics (EOS)があります。 ◦ KIP-129: Streams Exactly-Once Semantics • よって、メッセージの重複検知の仕組みが必要。 ◦ ◦ EIPのIdempotent Consumerパターン ◦ Outboxパターン** Q. *O’Reilly, Designing Event-DriveSystems:Chapter 12: Transactions, but Not as We Know Them - What Can’t Transactions Do? **マイクロサービスとメッセージングのなぜ [疑問編]:https://rheb.hatenablog.com/entry/microservices_messaging_2
Kafkaにおける冪等性の関連設定 • Kafka Producer ◦ Kafka内のイベントの重複、順序性 *を保証する設定の追加 ▪ “enable.idempotence=true” ◦
Producerのゾンビプロセス対策として、ユニークなトランザクション IDを利用 ▪ “transactional.id” (default null) • Kafka Consumer ◦ Commitされたレコードのみを poll ▪ “isolation.level=read_commited” (default read_uncommited) • Kafka Streams ◦ Kafka Streams内のConsumer/Producerにトランザクション処理を行う設定の追加 ▪ “processing.guarantee=exactly_once” (default at_least_once) * Consumerの障害時には順序性は保証されなくなるので注意。
Note: Partition 0 Partition 1 Partition 2 Partition 3 Topic
T1 Consumer1 Consumer Group Consumer2 Consumer3 Consumer4 Partition 0 Partition 1 Partition 2 Partition 3 Topic T1 Consumer1 Consumer Group Consumer2 Consumer3 Consumer4 リバランシング 図 Consumer 追加変更・障害時のリバランシング • Consumer グループ内のConsumerの設定変更や障害があった場合、該当パー ティションをその他のConsumerが引き継ぎます。 • ConsumerリーダーとGroupCoordinatorの連携によって各Consumerへのパー ティション割り当てを行います。 リバランシングとは? Q.
リバランシングConsumer グループ • Consumer リーダー ◦ Consumer Groupに最初に参加したConsumerはリーダー。 ◦ Consumer
リーダーは、Group Coordinator(後述)と連携し、各Consumerに パーティションのサブセットを割り当てます。 ◦ 割り当て方には、パーティション割り当てポリシー(PartitionAssignor)が使われ ます。 ▪ Defaultポリシーには、RangeとRoundRobinとStickyAssignorがある。 ▪ 独自の割り当て戦略を実装することも可能。
リバランシングConsumer グループ • GroupCoordinator ◦ 各Consumerグループに対して、Kafka Brokerに一つ存在。 ◦ GroupCoordinatorは、各Consumerとハートビートを行い、死活監視を行う。 ◦
Consumerの離脱を検知した時、GroupCoordinatorは生きているConsumerの みのリストをConsumerリーダーに受け渡す。その後、Consumerリーダーを任せ れたConsumerが、グループ内のConsumerのアサインメントを決める(次の図)
新しいコンシューマが参加または離脱すると、パーティションを 再割り当てするリバランシングが行われている(Eager Rebalancing) リバランシング • 動作の流れ 参考:Consumer Group Internals: Rebalancing,
Rebalancing.... Coordinatorから リーダーを任されている 各Consumerへの アサインメントの決定 メンバーのハートビートが切れるとリバ ランスのステートへ
Note: Eager Rebalancing = Stop-the-world Rebalancing • Stop-the-world Rebalancing ◦
リバランシングが起きるとパーティションをリリースしないといけない(すべてのグループメンバーを 停止) ◦ 運用や障害時にこのリバランシングではコストが大きい ◦ 例: ▪ スケールアップ・ダウン ▪ Kubernetes プロセスダウン ▪ ローリングアップグレード/アップデート Note: • Incremental Cooperative Rebalancing ◦ 稼働しているプロセスやタスクはそのままに、リバ ランシングを行う。 ◦ まだデフォルト設定になっていないようなので、利 用時の設定方法は要確認。 KIP Applied to Released in KIP-429 Kafka Consumer 2.4.0 KIP-415 Kafka Connect 2.3.0 KIP-441 Kafka Stream 2.6.0 そこで Incremental Cooperative Rebalancing Note:
その他
AMQ Streams • Apache Kafka のエンタープライズ向けディストリビューション ◦ 2018年から Kafka をサポート、Kubernetes
上でも提供 ◦ Red Hat AMQ Streams としてローンチ • 提供形態 ◦ Red Hat Enterprise Linux ◦ Red Hat OpenShift Container Platform Apache Kafka on Kubernetes 基礎編 ワークショップ: https://redhat-open.connpass.com/ Strimzi/AMQ Streamsをハンズオンをしてみたい
Thank you