SlideShare a Scribd company logo
How to deploy Apache Spark

to Mesos/DCOS
with Iulian Dragoș
Agenda
• Intro Apache Spark
• Apache Mesos
• Why Spark on Mesos
• A look under the hood
2
How to deploy Apache Spark 
to Mesos/DCOS
Spark - lightning-fast cluster computing
• next generation Big Data solution
• analytics and data processing
• up to 100x faster than Hadoop MapReduce
• built with Scala and Akka
• Apache top-level project
4
Spark
• It’s a next generation compute-engine
• Does not replace the whole Hadoop ecosystem
• just MapReduce
• Integrates/works with HDFS, Hive, Hbase, etc.
5
Spark API
• Scala distributed collections
• also available from Python and Java
• interactive shell and job submission
• streaming and batch modes
• flourishing ecosystem (SparkSQL, MLLib, GraphX)
6
Spark execution
7
http://spark.apache.org/docs/latest/cluster-­‐overview.html
Spark execution
• local (for experimentation)
• standalone (built-in cluster manager)
• YARN (Hadoop cluster manager)
• Mesos (general cluster manager)
8
Apache Mesos
Why Apache Mesos?
• General (a “distributed kernel”)
• Efficient resource management
• Proven technology (in production at Apple and Twitter)
• Typesafe & Mesosphere maintain the Spark/Mesos framework
10
“Program against your datacenter as a single pool of resources”
Frameworks running on Mesos
• HDFS
• Cassandra
• ElasticSearch
• Yarn (Myriad)
• Marathon, etc.
• and of course, Spark
11
Resource scheduling with Mesos
• 2-level scheduling
• Mesos offers resources to frameworks
• Frameworks accept or reject offers
• Offers include
• CPU cores, memory, ports, disk
12
13
Mesos Cluster
master
Mesos Master
Key
Mesos
Spark
HDFS
master / client
master / client
node
Mesos Slave
Name Node
Executor
task1 …
node
DiskDiskDiskDiskDisk
Mesos Slave
Data Node
Executor
… …
node
…
HDFS FW Sched. Job 1
Spark FW Sched. Job 1
1
(S1, 8CPU, 32GB, ...)
14
Mesos Cluster
master
Mesos Master
Key
Mesos
Spark
HDFS
master / client
master / client
node
Mesos Slave
Name Node
Executor
task1 …
node
DiskDiskDiskDiskDisk
Mesos Slave
Data Node
Executor
… …
node
…
HDFS FW Sched. Job 1
Spark FW Sched. Job 1
2
(S1, 8CPU, 32GB, ...)
1
def foo(x: Int)
15
Mesos Cluster
master
Mesos Master
Key
Mesos
Spark
HDFS
master / client
master / client
node
Mesos Slave
Name Node
Executor
task1 …
node
DiskDiskDiskDiskDisk
Mesos Slave
Data Node
Executor
… …
node
…
HDFS FW Sched. Job 1
Spark FW Sched. Job 1
2
1
(S1, 2CPU, 8GB, ...)
(S1, 2CPU, 8GB, ...)
3
def foo(x: Int)
16
Mesos Cluster
master
Mesos Master
Key
Mesos
Spark
HDFS
master / client
master / client
node
Mesos Slave
Name Node
Executor
task1 …
node
DiskDiskDiskDiskDisk
Mesos Slave
Data Node
Executor
… …
node
…
HDFS FW Sched. Job 1
Spark FW Sched. Job 1
2
1
(S1, 2CPU, 8GB, ...)
(S1, 2CPU, 8GB, ...)
3
4
Spark
Executor
task1 …
17
Spark Cluster Abstraction
…NodeNode
Spark Driver
object MyApp {
def main() {
val sc =
new SparkContext(…)
…
}
}
Cluster
Manager
Spark Executor
task task
task task
Spark Executor
task task
task task
…
18
Mesos Coarse Grained Mode
…Node Node
Mesos Executor …Mesos Executor
master
Spark Executor
task task
task task
Spark Executor
task task
task task
…
Mesos Master
Spark Framework
Spark Driver
object MyApp {
def main() {
val sc =
new SparkContext(…)
…
}
}
Scheduler
Mesos Coarse Grained Mode
• Fast startup for tasks:
• Better for interactive sessions.
• But resources locked up in larger Mesos task.
• (Dynamic allocation changes this is in 1.5)
19
…Node Node
Mesos Executor …Mesos Executor
master
Spark Executor
task task
task task
Spark Executor
task task
task task
…
Mesos Master
Spark Framework
Spark Driver
object MyApp {
def main() {
val sc =
new SparkContext(…)
…
}
}
Scheduler
Mesos Fine Grained Mode
20
…NodeNode
Spark Framework
Mesos Executor …
master
Spark Driver
object MyApp {
def main() {
val sc =
new SparkContext(…)
…
}
}
task task
task task
…
Mesos Master
Mesos Executor
Spark Exec
task
Spark Exec
task
Spark Exec
task
Spark Exec
task
Mesos Executor
Spark Exec
task
Spark Exec
task
Spark Exec
task
Spark Exec
task
…
Scheduler
Mesos Fine Grained Mode
• Better resource utilization.
• Slower startup for tasks:
• Fine for batch and relatively static streaming.
21
…NodeNode
Spark Framework
Mesos Executor …
master
Spark Driver
object MyApp {
def main() {
val sc =
new SparkContext(…)
…
}
}
task task
task task
…
Mesos Master
Mesos Executor
Spark Exec
task
Spark Exec
task
Spark Exec
task
Spark Exec
task
Mesos Executor
Spark Exec
task
Spark Exec
task
Spark Exec
task
Spark Exec
task
…
Scheduler
Dynamic allocation
• Mesos support was added in Spark 1.5
• adds and removes executors based on load
• when executors are idle, kills them
• when tasks queue up in the scheduler, adds executors
• needs external-shuffle-service to be running on each node
22
Client vs Cluster mode
• Where does the driver process run?
• client-mode: on the machine that submits the job
• cluster-mode: on a machine in the cluster
23
Demo
What’s next on Mesos
• Oversubscription (0.23)
• Persistence Volumes
• Dynamic Reservations
• Optimistic Offers
• Isolations
• More….
25
Closing words on Spark Streaming
• Spark 1.5 improves resiliency by adding back-pressure inside
Spark Streaming
• slow-down receivers dynamically, based on load
• Spark 1.6 will add the ability to connect to Reactive Streams
• propagate back-pressure outside of Spark
26
Key points
• Spark is a next-generation compute engine for Big Data
• Mesos is a next-generation cluster manager
• better utilization of cluster resources across organization
• Spark on Mesos is commercially supported by Typesafe
• Typesafe&Mesosphere are the maintainers of Spark/Mesos
27
EXPERT SUPPORT
Why Contact Typesafe for Your Apache Spark Project?
Ignite your Spark project with 24/7 production SLA,
unlimited expert support and on-site training:
• Full application lifecycle support for Spark Core,
Spark SQL & Spark Streaming
• Deployment to Standalone, EC2, Mesos clusters
• Expert support from dedicated Spark team
• Optional 10-day “getting started” services
package
Typesafe is a partner with Databricks, Mesosphere
and IBM.
Learn more about on-site trainingCONTACT US

More Related Content

What's hot (20)

PPTX
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lightbend
 
PDF
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Helena Edelson
 
PDF
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
Patrick Di Loreto
 
PPTX
xPatterns ... beyond Hadoop (Spark, Shark, Mesos, Tachyon)
Claudiu Barbura
 
PDF
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Helena Edelson
 
PDF
Reactive dashboard’s using apache spark
Rahul Kumar
 
PDF
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
DataStax Academy
 
PDF
Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...
Spark Summit
 
PDF
Using the SDACK Architecture to Build a Big Data Product
Evans Ye
 
PDF
Kafka spark cassandra webinar feb 16 2016
Hiromitsu Komatsu
 
PPTX
Real time data viz with Spark Streaming, Kafka and D3.js
Ben Laird
 
PDF
Make 2016 your year of SMACK talk
DataStax Academy
 
PPTX
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
PDF
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
DataStax
 
PPTX
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Spark Summit
 
PDF
Rethinking Streaming Analytics For Scale
Helena Edelson
 
PDF
Streaming Big Data & Analytics For Scale
Helena Edelson
 
PDF
Getting Started Running Apache Spark on Apache Mesos
Paco Nathan
 
PDF
Tachyon and Apache Spark
rhatr
 
PDF
Data processing platforms with SMACK: Spark and Mesos internals
Anton Kirillov
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lightbend
 
Lambda Architecture with Spark Streaming, Kafka, Cassandra, Akka, Scala
Helena Edelson
 
Using Spark, Kafka, Cassandra and Akka on Mesos for Real-Time Personalization
Patrick Di Loreto
 
xPatterns ... beyond Hadoop (Spark, Shark, Mesos, Tachyon)
Claudiu Barbura
 
Fast and Simplified Streaming, Ad-Hoc and Batch Analytics with FiloDB and Spa...
Helena Edelson
 
Reactive dashboard’s using apache spark
Rahul Kumar
 
Typesafe & William Hill: Cassandra, Spark, and Kafka - The New Streaming Data...
DataStax Academy
 
Recipes for Running Spark Streaming Applications in Production-(Tathagata Das...
Spark Summit
 
Using the SDACK Architecture to Build a Big Data Product
Evans Ye
 
Kafka spark cassandra webinar feb 16 2016
Hiromitsu Komatsu
 
Real time data viz with Spark Streaming, Kafka and D3.js
Ben Laird
 
Make 2016 your year of SMACK talk
DataStax Academy
 
Akka 2.4 plus new commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
Elassandra: Elasticsearch as a Cassandra Secondary Index (Rémi Trouville, Vin...
DataStax
 
Securing Spark Applications by Kostas Sakellis and Marcelo Vanzin
Spark Summit
 
Rethinking Streaming Analytics For Scale
Helena Edelson
 
Streaming Big Data & Analytics For Scale
Helena Edelson
 
Getting Started Running Apache Spark on Apache Mesos
Paco Nathan
 
Tachyon and Apache Spark
rhatr
 
Data processing platforms with SMACK: Spark and Mesos internals
Anton Kirillov
 

Viewers also liked (11)

PPTX
Alpine academy apache spark series #1 introduction to cluster computing wit...
Holden Karau
 
PDF
Real-Time Anomaly Detection with Spark MLlib, Akka and Cassandra
Natalino Busa
 
PPTX
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Robert "Chip" Senkbeil
 
PPTX
Intro to Apache Spark
Mammoth Data
 
PPTX
Data Science lifecycle with Apache Zeppelin and Spark by Moonsoo Lee
Spark Summit
 
PDF
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Helena Edelson
 
PDF
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Legacy Typesafe (now Lightbend)
 
PDF
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Anton Kirillov
 
PDF
H2O - the optimized HTTP server
Kazuho Oku
 
PDF
Container Orchestration Wars
Karl Isenberg
 
PDF
Linux 4.x Tracing Tools: Using BPF Superpowers
Brendan Gregg
 
Alpine academy apache spark series #1 introduction to cluster computing wit...
Holden Karau
 
Real-Time Anomaly Detection with Spark MLlib, Akka and Cassandra
Natalino Busa
 
Spark Kernel Talk - Apache Spark Meetup San Francisco (July 2015)
Robert "Chip" Senkbeil
 
Intro to Apache Spark
Mammoth Data
 
Data Science lifecycle with Apache Zeppelin and Spark by Moonsoo Lee
Spark Summit
 
Lambda Architecture with Spark, Spark Streaming, Kafka, Cassandra, Akka and S...
Helena Edelson
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Legacy Typesafe (now Lightbend)
 
Data processing platforms architectures with Spark, Mesos, Akka, Cassandra an...
Anton Kirillov
 
H2O - the optimized HTTP server
Kazuho Oku
 
Container Orchestration Wars
Karl Isenberg
 
Linux 4.x Tracing Tools: Using BPF Superpowers
Brendan Gregg
 
Ad

Similar to How to deploy Apache Spark 
to Mesos/DCOS (20)

PDF
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark Summit
 
PPTX
Productionizing Spark and the REST Job Server- Evan Chan
Spark Summit
 
PDF
Productionizing Spark and the Spark Job Server
Evan Chan
 
PDF
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
anynines GmbH
 
PPTX
Typesafe spark- Zalando meetup
Stavros Kontopoulos
 
PDF
Running Spark on Mesos
Peker Mert Öksüz
 
PDF
Apache spark - Installation
Martin Zapletal
 
PDF
Spark on Mesos
Jen Aman
 
PDF
Scaling Big Data with Hadoop and Mesos
Discover Pinterest
 
PDF
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
Athens Big Data
 
PDF
Building Distributed Systems from Scratch - Part 1
datamantra
 
PPTX
Introduction to NetGuardians' Big Data Software Stack
Jérôme Kehrli
 
PDF
Hadoop Spark Introduction-20150130
Xuan-Chao Huang
 
PDF
eScience Cluster Arch. Overview
Francesco Bongiovanni
 
PDF
xPatterns on Spark, Tachyon and Mesos - Bucharest meetup
Radu Chilom
 
PPTX
In Memory Analytics with Apache Spark
Venkata Naga Ravi
 
PPTX
Uncovering an Apache Spark 2 Benchmark - Configuration, Tuning and Test Results
DataWorks Summit
 
PPT
February 2016 HUG: Running Spark Clusters in Containers with Docker
Yahoo Developer Network
 
PDF
Hadoop to spark_v2
elephantscale
 
PPTX
CLOUD_COMPUTING_MODULE5_RK_BIG_DATA.pptx
bhuvankumar3877
 
Spark on Mesos-A Deep Dive-(Dean Wampler and Tim Chen, Typesafe and Mesosphere)
Spark Summit
 
Productionizing Spark and the REST Job Server- Evan Chan
Spark Summit
 
Productionizing Spark and the Spark Job Server
Evan Chan
 
Cloud Infrastructures Slide Set 8 - More Cloud Technologies - Mesos, Spark | ...
anynines GmbH
 
Typesafe spark- Zalando meetup
Stavros Kontopoulos
 
Running Spark on Mesos
Peker Mert Öksüz
 
Apache spark - Installation
Martin Zapletal
 
Spark on Mesos
Jen Aman
 
Scaling Big Data with Hadoop and Mesos
Discover Pinterest
 
15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos
Athens Big Data
 
Building Distributed Systems from Scratch - Part 1
datamantra
 
Introduction to NetGuardians' Big Data Software Stack
Jérôme Kehrli
 
Hadoop Spark Introduction-20150130
Xuan-Chao Huang
 
eScience Cluster Arch. Overview
Francesco Bongiovanni
 
xPatterns on Spark, Tachyon and Mesos - Bucharest meetup
Radu Chilom
 
In Memory Analytics with Apache Spark
Venkata Naga Ravi
 
Uncovering an Apache Spark 2 Benchmark - Configuration, Tuning and Test Results
DataWorks Summit
 
February 2016 HUG: Running Spark Clusters in Containers with Docker
Yahoo Developer Network
 
Hadoop to spark_v2
elephantscale
 
CLOUD_COMPUTING_MODULE5_RK_BIG_DATA.pptx
bhuvankumar3877
 
Ad

More from Legacy Typesafe (now Lightbend) (14)

PDF
The How and Why of Fast Data Analytics with Apache Spark
Legacy Typesafe (now Lightbend)
 
PDF
Reactive Design Patterns
Legacy Typesafe (now Lightbend)
 
PDF
Revitalizing Aging Architectures with Microservices
Legacy Typesafe (now Lightbend)
 
PPTX
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Legacy Typesafe (now Lightbend)
 
PDF
Reactive Revealed Part 3 of 3: Resiliency, Failures vs Errors, Isolation, Del...
Legacy Typesafe (now Lightbend)
 
PPTX
Akka 2.4 plus commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
PPTX
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Legacy Typesafe (now Lightbend)
 
PDF
Microservices 101: Exploiting Reality's Constraints with Technology
Legacy Typesafe (now Lightbend)
 
PPTX
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
Legacy Typesafe (now Lightbend)
 
PPTX
Modernizing Your Aging Architecture: What Enterprise Architects Need To Know ...
Legacy Typesafe (now Lightbend)
 
PDF
Reactive Streams 1.0.0 and Why You Should Care (webinar)
Legacy Typesafe (now Lightbend)
 
PPTX
Going Reactive in Java with Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
PPTX
Why Play Framework is fast
Legacy Typesafe (now Lightbend)
 
PDF
[Sneak Preview] Apache Spark: Preparing for the next wave of Reactive Big Data
Legacy Typesafe (now Lightbend)
 
The How and Why of Fast Data Analytics with Apache Spark
Legacy Typesafe (now Lightbend)
 
Reactive Design Patterns
Legacy Typesafe (now Lightbend)
 
Revitalizing Aging Architectures with Microservices
Legacy Typesafe (now Lightbend)
 
Typesafe Reactive Platform: Monitoring 1.0, Commercial features and more
Legacy Typesafe (now Lightbend)
 
Reactive Revealed Part 3 of 3: Resiliency, Failures vs Errors, Isolation, Del...
Legacy Typesafe (now Lightbend)
 
Akka 2.4 plus commercial features in Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
Reactive Revealed Part 2: Scalability, Elasticity and Location Transparency i...
Legacy Typesafe (now Lightbend)
 
Microservices 101: Exploiting Reality's Constraints with Technology
Legacy Typesafe (now Lightbend)
 
A Deeper Look Into Reactive Streams with Akka Streams 1.0 and Slick 3.0
Legacy Typesafe (now Lightbend)
 
Modernizing Your Aging Architecture: What Enterprise Architects Need To Know ...
Legacy Typesafe (now Lightbend)
 
Reactive Streams 1.0.0 and Why You Should Care (webinar)
Legacy Typesafe (now Lightbend)
 
Going Reactive in Java with Typesafe Reactive Platform
Legacy Typesafe (now Lightbend)
 
Why Play Framework is fast
Legacy Typesafe (now Lightbend)
 
[Sneak Preview] Apache Spark: Preparing for the next wave of Reactive Big Data
Legacy Typesafe (now Lightbend)
 

Recently uploaded (20)

PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PPTX
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Digital Circuits, important subject in CS
contactparinay1
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Agentforce World Tour Toronto '25 - MCP with MuleSoft
Alexandra N. Martinez
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 

How to deploy Apache Spark 
to Mesos/DCOS

  • 1. How to deploy Apache Spark
 to Mesos/DCOS with Iulian Dragoș
  • 2. Agenda • Intro Apache Spark • Apache Mesos • Why Spark on Mesos • A look under the hood 2
  • 4. Spark - lightning-fast cluster computing • next generation Big Data solution • analytics and data processing • up to 100x faster than Hadoop MapReduce • built with Scala and Akka • Apache top-level project 4
  • 5. Spark • It’s a next generation compute-engine • Does not replace the whole Hadoop ecosystem • just MapReduce • Integrates/works with HDFS, Hive, Hbase, etc. 5
  • 6. Spark API • Scala distributed collections • also available from Python and Java • interactive shell and job submission • streaming and batch modes • flourishing ecosystem (SparkSQL, MLLib, GraphX) 6
  • 8. Spark execution • local (for experimentation) • standalone (built-in cluster manager) • YARN (Hadoop cluster manager) • Mesos (general cluster manager) 8
  • 10. Why Apache Mesos? • General (a “distributed kernel”) • Efficient resource management • Proven technology (in production at Apple and Twitter) • Typesafe & Mesosphere maintain the Spark/Mesos framework 10 “Program against your datacenter as a single pool of resources”
  • 11. Frameworks running on Mesos • HDFS • Cassandra • ElasticSearch • Yarn (Myriad) • Marathon, etc. • and of course, Spark 11
  • 12. Resource scheduling with Mesos • 2-level scheduling • Mesos offers resources to frameworks • Frameworks accept or reject offers • Offers include • CPU cores, memory, ports, disk 12
  • 13. 13 Mesos Cluster master Mesos Master Key Mesos Spark HDFS master / client master / client node Mesos Slave Name Node Executor task1 … node DiskDiskDiskDiskDisk Mesos Slave Data Node Executor … … node … HDFS FW Sched. Job 1 Spark FW Sched. Job 1 1 (S1, 8CPU, 32GB, ...)
  • 14. 14 Mesos Cluster master Mesos Master Key Mesos Spark HDFS master / client master / client node Mesos Slave Name Node Executor task1 … node DiskDiskDiskDiskDisk Mesos Slave Data Node Executor … … node … HDFS FW Sched. Job 1 Spark FW Sched. Job 1 2 (S1, 8CPU, 32GB, ...) 1
  • 15. def foo(x: Int) 15 Mesos Cluster master Mesos Master Key Mesos Spark HDFS master / client master / client node Mesos Slave Name Node Executor task1 … node DiskDiskDiskDiskDisk Mesos Slave Data Node Executor … … node … HDFS FW Sched. Job 1 Spark FW Sched. Job 1 2 1 (S1, 2CPU, 8GB, ...) (S1, 2CPU, 8GB, ...) 3
  • 16. def foo(x: Int) 16 Mesos Cluster master Mesos Master Key Mesos Spark HDFS master / client master / client node Mesos Slave Name Node Executor task1 … node DiskDiskDiskDiskDisk Mesos Slave Data Node Executor … … node … HDFS FW Sched. Job 1 Spark FW Sched. Job 1 2 1 (S1, 2CPU, 8GB, ...) (S1, 2CPU, 8GB, ...) 3 4 Spark Executor task1 …
  • 17. 17 Spark Cluster Abstraction …NodeNode Spark Driver object MyApp { def main() { val sc = new SparkContext(…) … } } Cluster Manager Spark Executor task task task task Spark Executor task task task task …
  • 18. 18 Mesos Coarse Grained Mode …Node Node Mesos Executor …Mesos Executor master Spark Executor task task task task Spark Executor task task task task … Mesos Master Spark Framework Spark Driver object MyApp { def main() { val sc = new SparkContext(…) … } } Scheduler
  • 19. Mesos Coarse Grained Mode • Fast startup for tasks: • Better for interactive sessions. • But resources locked up in larger Mesos task. • (Dynamic allocation changes this is in 1.5) 19 …Node Node Mesos Executor …Mesos Executor master Spark Executor task task task task Spark Executor task task task task … Mesos Master Spark Framework Spark Driver object MyApp { def main() { val sc = new SparkContext(…) … } } Scheduler
  • 20. Mesos Fine Grained Mode 20 …NodeNode Spark Framework Mesos Executor … master Spark Driver object MyApp { def main() { val sc = new SparkContext(…) … } } task task task task … Mesos Master Mesos Executor Spark Exec task Spark Exec task Spark Exec task Spark Exec task Mesos Executor Spark Exec task Spark Exec task Spark Exec task Spark Exec task … Scheduler
  • 21. Mesos Fine Grained Mode • Better resource utilization. • Slower startup for tasks: • Fine for batch and relatively static streaming. 21 …NodeNode Spark Framework Mesos Executor … master Spark Driver object MyApp { def main() { val sc = new SparkContext(…) … } } task task task task … Mesos Master Mesos Executor Spark Exec task Spark Exec task Spark Exec task Spark Exec task Mesos Executor Spark Exec task Spark Exec task Spark Exec task Spark Exec task … Scheduler
  • 22. Dynamic allocation • Mesos support was added in Spark 1.5 • adds and removes executors based on load • when executors are idle, kills them • when tasks queue up in the scheduler, adds executors • needs external-shuffle-service to be running on each node 22
  • 23. Client vs Cluster mode • Where does the driver process run? • client-mode: on the machine that submits the job • cluster-mode: on a machine in the cluster 23
  • 24. Demo
  • 25. What’s next on Mesos • Oversubscription (0.23) • Persistence Volumes • Dynamic Reservations • Optimistic Offers • Isolations • More…. 25
  • 26. Closing words on Spark Streaming • Spark 1.5 improves resiliency by adding back-pressure inside Spark Streaming • slow-down receivers dynamically, based on load • Spark 1.6 will add the ability to connect to Reactive Streams • propagate back-pressure outside of Spark 26
  • 27. Key points • Spark is a next-generation compute engine for Big Data • Mesos is a next-generation cluster manager • better utilization of cluster resources across organization • Spark on Mesos is commercially supported by Typesafe • Typesafe&Mesosphere are the maintainers of Spark/Mesos 27
  • 28. EXPERT SUPPORT Why Contact Typesafe for Your Apache Spark Project? Ignite your Spark project with 24/7 production SLA, unlimited expert support and on-site training: • Full application lifecycle support for Spark Core, Spark SQL & Spark Streaming • Deployment to Standalone, EC2, Mesos clusters • Expert support from dedicated Spark team • Optional 10-day “getting started” services package Typesafe is a partner with Databricks, Mesosphere and IBM. Learn more about on-site trainingCONTACT US