Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
分散スケジューラMesosの紹介
Search
UENISHI Kota
July 14, 2016
Technology
1.5k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
分散スケジューラMesosの紹介
db tech showcase 2016 のスライド
UENISHI Kota
July 14, 2016
More Decks by UENISHI Kota
See All by UENISHI Kota
Storage Systems in Preferred Networks
kuenishi
0
97
Metadata Management in Distributed File Systems
kuenishi
2
570
Behind The Scenes: Cloud Native Storage System for AI
kuenishi
2
460
Apache Ozone behind Simulation and AI Industries
kuenishi
0
480
Distributed Deep Learning with Chainer and Hadoop
kuenishi
3
1.3k
A Few Ways to Accelerate Deep Learning
kuenishi
0
1.2k
Introducing Retz
kuenishi
5
1.3k
Introducing Retz and how to develop practical frameworks
kuenishi
3
830
Formalization and Proof of Distributed Systems (ja)
kuenishi
10
6.5k
Other Decks in Technology
See All in Technology
ガバメントクラウドでのランサムウェア対策
techniczna
1
510
NYC Summit 2026 におけるAmazon Bedrock AgentCore のアップデート
ren8k
3
300
WEBフロントエンド研修【MIXI 26新卒技術研修】
mixi_engineers
PRO
2
900
[MIRU26] To What Extent Does MLLM-as-a-Judge Exhibit Cross-Model Preference Bias?
keio_smilab
PRO
0
100
実践が先生だった— 新卒サーバーエンジニア1年目のリアル
mixi_engineers
PRO
0
220
LangfuseによるLLMOps基盤の構築と活用事例
zozotech
PRO
1
220
Atlassian Cloudサポート業務でのAIエージェント活用事例
smt7174
0
230
20260801_スクフェス大阪
kgnkhkr
0
330
Power Automateアップデート情報
miyakemito
0
290
新しい SLO が良い感じにハマっている話
z63d
4
1.9k
Claude Mythos、Fable...フロンティアAIの最新動向と企業のセキュリティ対策
flatt_security
0
180
AIは実装を速くする。では、私たちは何を今作るべきか?-立場を越えてリリースに向き合ったチーム開発の実践 / 20260801 Hiromi Nakaya and Naoki Takahashi
shift_evolve
PRO
3
180
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
230
WENDY [Excerpt]
tessaabrams
11
39k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
450
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
310
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.4k
Darren the Foodie - Storyboard
khoart
PRO
3
3.5k
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
1.1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
980
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
Transcript
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. Proprietary
& Confidential NAUTILUS 分散スケジューラMesosの紹介 Kota UENISHI 2016/7/14 db tech showcase 2016 秋葉原 株式会社ノーチラス・テクノロジーズ http://www.nautilus-technologies.com/ mailto:
[email protected]
Tel: 03-6712-0636 Fax: 03-6712-0664
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
2 Proprietary & Confidential Operating System とは何だったのか CPU オペレーティングシステム アプリケーション システムコール POSIX API, ABI, libc 機械語 デバイスドライバ ファームウェア メモリ I/O アプリケーション アプリケーション アプリケーション アプリケーション アプリケーション アプリケーション ユーザ管理、隔離 多重化 プロセススケジューリング メモリ管理 IOスケジューリング
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
3 Proprietary & Confidential OSのない/ある時代のコンピュータの使い方 OSがない OSがある ユーザ管理 列に並んでログインを 待つ みんな同時ログイン プロセス多重化 列に並んでログインと 実行を待つ Runqueue上で待つ メモリ管理 他に誰もいない 仮想メモリ空間 IOスケジューラ 他に誰もいない IO queue上で待つ システムコール 都度プログラミング 統一されたAPI アプリケーション開発 手動アセンブリ コンパイラがABIを合 わせてくれる
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
4 Proprietary & Confidential OSのない/ある時代のコンピュータの使い方 OSがない OSがある スケジューリング ノンプリエンプティブ シリアル実行 実行可能なものから 順番 ジョブの予約 パンチカードを担当者 に渡す コマンド実行 ジョブの待ち時間 長い 短い リソース使用率 低い 高い
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
5 Proprietary & Confidential ビッグ!データ!時代!!はなんでも分散
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
6 Proprietary & Confidential “大規模” システムのシンプルさと効率のトレードオフ 管理しやすい シンプルな構成 リソース 利用効率 •運用のコスト高い •管理可能なスケールに限界 •システムの構成要素少ない •初期システム設計が高コスト •重厚長大になりがち •システムの構成要素多い •アプリケーションをノード分離 •リソース分離 •スタティックな構成 •手動の障害対応 •アプリケーションの分離 •アプリ同士のリソース共有 •ダイナミックな構成 •自動で障害対応
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
7 Proprietary & Confidential ビッグデータ時代のシステムが抱える課題 ▪管理しないといけないサブシステムが沢山 ▪リソース分離とリソース利用効率がトレードオフ – リソース競合しないアプリAとアプリBを同居させても動きそうだけど、ホントに 大丈夫かなあ… ▪瞬発力を必要とするアプリケーション – 30GBのデータをスキャンして別のデータとjoinするクエリを3000コアのCPU を使って20秒で終わらせたい – 一時的に20TBのデータをメモリにのせてプログラムを走らせたい – Webサーバーを増やしてキャンペーンの間だけ3000QPS捌きたい – 月次の集計バッチのときだけ50ノードのCPUとメモリを使いたい – フェイルオーバーしてたので新しいノードをすぐもってきたい ▪完全仮想化、準仮想化のオーバーヘッド – 5~10% でも惜しい ▪拡張性 – 100台サーバー追加、どのアプリにどれだけ追加すればよいのか? – それぞれ別々にデプロイするのめんどくさい…
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
8 Proprietary & Confidential Mesos: DC用リソース管理&分散スケジューラ Apache Mesos は CPU, メモリ、ストレージなど、あらゆるリソースを(物理および仮想)マシンから抽象化し 耐障害性と可塑性のある分散システムを簡単かつ効率的にに構築、実行できるようになります
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
9 Proprietary & Confidential Mesos: distributed systems kernel Mesosって何? 分散システムのカーネルだよ! Mesos は Linux カーネルと同じ原則で設計、開発されています。違うのは抽象化されているレベルだけです。 Mesos カーネルはあらゆるマシン上で動作し、 Hadoop, Spark, Kafka, Elastic Search といったアプリケーションに APIを通じて、データセンタ丸ごと、クラウド環境まるごとの上にリソース管理とスケジューリングを提供します。
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
10 Proprietary & Confidential Mesos: まことしやかな噂@シリコンバレー 「Mesosって何?」 「GoogleのBorgみたいなもんだよ」
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
11 Proprietary & Confidential 分散スケジューラのない/ある時代のコンピュータの使い方 ない ある アプリケーション管理 別ノード コンテナ分離 リソース共有 別クラスタ 必要なときだけ確保 メモリ管理 別クラスタ 必要なときだけ確保 耐障害性 自前、アプリ毎、手動 自動、アプリごと 可塑性 ノード追加 予備リソース投入 アプリケーション開発 開発環境を維持 必要なときにデプロイ
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
12 Proprietary & Confidential 分散スケジューラのない/ある時代のコンピュータの使い方 OSがない OSがある スケジューリング スタティック ダイナミック ジョブの予約 前のジョブが終わった ら実行 リソース確保できたら 実行 ジョブの待ち時間 順番待ち 確保できるかぎりなし リソース使用率 低い 高い
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
13 Proprietary & Confidential Mesosの構成 Master Agent Executor Executor Executor Executor Agent Executor Executor Executor Executor Agent Executor Executor Executor Executor •…....... Framework Scheduler C Framework Scheduler B Framework Scheduler A
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
14 Proprietary & Confidential Mesosの特徴 ▪いいところ – リソース管理とスケジューリングのモジュールの分離 - “Resource Offer” ▪ スケジューリングアルゴリズムを、目的に応じて切り替えたり最適化できる ▪ Masterの負荷を低減 – Scheduler / Executor のシンプルな API ▪ 豊富な言語サポート ▪ 豊富なフレームワークのサポート – きれいなC++で書かれている ▪Mesosの残念なところ – 高可用動作にはZooKeeperが必要 – マルチDCを明示的にはサポートしていない – フレームワークもミドルウェアなので、作るのは簡単だがテストしづらい
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
15 Proprietary & Confidential 典型的なスケジューリング ▪アプリケーションがスケジューラに「リソースをくれ」と頼む ▪スケジューラは手持ちからアプリケーションに渡せるリソースを渡す ▪リソースがない場合は、待たせるまたは失敗 ▪Cons: – スケジューリングも同時に行うためスケジューラのMasterの負荷が高くなる – アプリケーションがバラバラにリソース要求をしてくるのでアプリケーション間 のリソース最適化をしにくい – 全てのアプリケーションに同じアルゴリズムでリソース配分を行うので、スケジ ューラ側で最適化をしやすいが、それがアプリケーションにとってよいとは限ら ない
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
16 Proprietary & Confidential MesosのResource Offer ▪“Two-level Scheduling” ▪リソース管理とスケジューリングの分離 ▪Masterが各Frameworkに「このリソースいる?」と尋ねてまわる ▪Frameworkは、その中から必要な分だけ使う ▪いらない分は次のFrameworkにOfferを出す ▪Pros: – 余っている分のリソースがアプリケーションに全て伝わるので、アプリケーショ ン側で最適化をしやすい ▪Cons: – OfferをもらうまでFrameworkは待たなければいけない
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
17 Proprietary & Confidential タスク起動の仕組み Master Agent Executor Agent Executor Framework Scheduler 1. Resource Offer 2. Accept Offer 3. Launch Task 4. Fork & Exec 4. Fork & Exec 5. Status Update 5. Status Update •Executorは daemon でもOK •Executorは ただのコマンドでもOK •Executorは Docker イメージでもOK •Framework SchedulerはMarathonで管理
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
18 Proprietary & Confidential Frameworks ▪Aurora, Marathon – プロセス管理やオートスケール、故障時の再起動などをしてくれるサービスス ケジューラ ▪Airflow – ワークフローエンジン ▪Spark, Hadoop ▪MPI – HPC向け分散処理フレームワーク ▪Chronos – 高可用クラスタCron ▪Jenkins ▪Cassandra ▪Elasticsearch http://mesos.apache.org/documentation/latest/frameworks/
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
19 Proprietary & Confidential Frameworkを作ろう! ▪Frameworkを作らないとMesosを使いきったとはいえない ▪Scheduler クラスを継承してコールバックを実装 ▪Scheduler driverを叩いて命令を伝える ▪Executor クラスを継承してコールバックを実装 ▪Executor driverを叩いて命令を伝える ▪うごかす
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
20 Proprietary & Confidential みんな使っています ▪Airbnb ▪Apple ▪Atlassian ▪CERN ▪Cisco ▪eBay ▪Ericsson ▪Groupon ▪Hootsuite ▪Mesosphere •https://github.com/apache/mesos/blob/master/docs/powered-by-mesos.md •と、他にもいくつかのソースから ▪Netflix ▪Twitter ▪Uber ▪UC Berkeley ▪Yelp ▪Microsoft ▪Two Sigma ▪…
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
21 Proprietary & Confidential Datacenter scheduling ▪沢山あるコンピュータに、どこにどれだけアプリケーションを効率 的かつ安定して割り当てるか ▪グリッドの時代からある、古くて新しい問題 – ユースケースごとに最適化した解があり、目的に特化することが多い ▪YARN – Hadoop MapReduce からスケジューラー相当のコードを切り離し て汎用化したもの。 ▪Borg – Googleが世界中にある自社DC内のコンピュータと、その上で動くア プリケーションを管理するためのスケジューラ ▪似ているけど全然違うもの – OpenStack, CloudStack, Kubernetes, Ansible, Chef, CoreOS
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
22 Proprietary & Confidential Questions? お知らせ:Mesos勉強会 ▪近いうちにやります ▪都内、平日夕方
Copyright © 2012 Nautilus Technologies, Inc. All rights reserved. NAUTILUS
23 Proprietary & Confidential Agenda 1. OSとは何だったのか「コンピュータを運用するためのシステム(ソフト ウェア)」 → I/O抽象化(デバイスドライバ、firmware、HW)→メモリ 管理、プロセス多重化/CPU管理、スケジューリング(高レベル、低レベ ル) 「システムコール」 2. OSのない時代、ある時代のコンピューティング 3. Datacenter OSとは何か? 4. 分散スケジューラ is 何 -- Goal: 複数あるコンピュータ資源を極限ま で使い倒す(スケジューラー リソース管理/制限 まるちてなんしー) 5. Datacenter OSのない時代、ある時代のコンピューティング 6. 仕組み(Master, Agent, Framework Scheduler, Executor) 7. みんな使っています 8. 類似: YARN, k8s, OpenStack, CloudStack 9. Mesos勉強会やるよ!!