Skip to Content
スパーク定義ガイド
book

スパーク定義ガイド

by Bill Chambers, Matei Zaharia
March 2025
Intermediate to advanced
606 pages
9h
Japanese
O'Reilly Media, Inc.
Content preview from スパーク定義ガイド

第15章. クラスタ上でのSparkの実行方法

この作品はAIを使って翻訳されている。ご意見、ご感想をお待ちしている:translation-feedback@oreilly.com

このように この本では、プログラミングインタフェースとしてのSparkの特性に焦点を当てた。構造化APIがどのように論理演算を行い、それを論理プランに分割し、クラスタマシン全体で実行されるRDD(Resilient Distributed Dataset)演算で構成される物理プランに変換するかを説明した。この章では、Sparkがそのコードを実行するときに何が起こるかに焦点を当てる。実装にとらわれない方法でこれを議論する。これは、使用しているクラスタマネージャにも、実行しているコードにも依存しない。結局のところ、Sparkのコードはすべて同じように実行される。

この章では、いくつかの重要なトピックを取り上げる:

  • Sparkアプリケーションのアーキテクチャとコンポーネント

  • SparkアプリケーションのライフサイクルをSparkの内部と外部で考える

  • パイプラインなどの重要な低レベル実行プロパティ

  • Sparkアプリケーションを実行するために必要なこと、第16章への分岐点として。

まずはアーキテクチャから見ていこう。

Sparkアプリケーションのアーキテクチャ

第2章では、Sparkアプリケーションのハイレベルなコンポーネントについて説明した。もう一度おさらいしよう:

Sparkドライバー

ドライバは、Sparkアプリケーションの "運転席に座る "プロセスである。Sparkアプリケーションの実行を制御し、Sparkクラスタのすべての状態(エクゼキュータの状態とタスク)を維持する。実際に物理リソースを取得し、エクゼキュータを起動するためには、クラスタ・マネージャーとインタフェースする必要がある。結局のところ、これは物理マシン上のプロセスに過ぎず、クラスタ上で実行されているアプリケーションの状態を維持する役割を担っている。

Sparkの実行者たち

Spark エグゼキューターは、Sparkドライバーによって代入されたタスクを実行するプロセスである。ドライバーから代入されたタスクを実行し、その状態(成功か失敗か)と結果を報告する。各Sparkアプリケーションは、それぞれ独立したエクゼキュータ・プロセスを持っている。

クラスタ・マネージャ

Spark DriverとExecutorは空中に存在するわけではないので、クラスタ・マネージャの出番となる。クラスタマネージャは、Sparkアプリケーションを実行するマシンのクラスタを管理する。少し紛らわしいが、クラスターマネージャーは独自の "ドライバー"(マスターと呼ばれることもある)と "ワーカー "の抽象化を持つ。主な違いは、これらが(Sparkのように)プロセスではなく物理マシンに結びついていることだ。図15-1は基本的なクラスタのセットアップを示している。図の左側のマシンはクラスタマネージャードライバノードである。円は個々のワーカーノード上で動作し、管理しているデーモンプロセスを表す。まだSparkアプリケーションは実行されていない-これらはクラスタマネージャからのプロセスだけである。

image
図15-1. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

高性能Spark

高性能Spark

Holden Karau, Rachel Warren
生成AIの可視化

生成AIの可視化

Priyanka Vergadia, Valliappa Lakshmanan
ソフトウェア工学の基礎

ソフトウェア工学の基礎

Nathaniel Schutta, Dan Vega

Publisher Resources

ISBN: 9798341627567