SlideShare a Scribd company logo
Running Spark on
Mesos
Christos Sidiropoulos, Lead DevOps Engineer,
Encode
Agenda
● About
● Alternatives
● Mesos architecture
● DC/OS
● Spark installation/configuration
● Submitting spark applications
● Monitoring spark applications
● Viewing the logs
About
● Advanced Security Analytics and Response Orchestration
● Early compromise detection.
● Capture and analyze traffic logs.
Alternatives
● Standalone
○ Easy to deploy (scripts are bundled with spark distribution).
○ Can easily run on localhost for development.
○ Master-Worker setup.
○ HA supported utilizing Zookeeper.
○ Web UI for monitoring cluster and job statistics.
● Hadoop YARN
○ Harder to bring up.
○ Combination of the ResourceManager, NodeManager, Application Master & Container.
○ HA Supported utilizing Zookeeper.
○ ResourceManager/NodeManager UI.
● Kubernetes
○ Still experimental (v2.4.0).
○ Easy to get up and running if you are already familiar with k8s.
● Nomad
○ Good if you are into experimenting with hashicorp products.
A few things about Mesos
● Using the same principles as the Linux kernel, only at a different level of abstraction.
● Dynamic resource sharing and isolation (CPU, RAM, …).
● Turn your data center into one very large computer (global resource manager).
● Dominant Resource Fairness.
● Scales on 10,000s of nodes.
● Packages and commercial support through Mesosphere
● Even YARN can run on mesos(myriad).
● Three main components
○ Mesos Master
○ Mesos Agent
○ Mesos Framework
Mesos Architecture
Resource Offers
DC/OS
● Distributed operating system based on the Apache Mesos distributed systems kernel.
● A Cluster Manager.
● A Container Platform.
● An Operating System.
● Great documentation.
● Easy to spin up.
● A great catalog with packages (Universe).
DC/OS
DC/OS UI
Bring it up
● Cloudformation
● Terraform/Ansible
● Manual
https://github.com/dcos-labs/ansible-dcos
os = "centos_7.4"
state = "none"
dcos_version = "1.11.4"
#
num_of_masters = "1"
num_of_private_agents = "5"
num_of_public_agents = "1"
num_of_spark_spot_agents = "0"
num_of_spark_dev_agents = "1"
num_of_private_spark_agents = "3"
#
aws_region = "eu-west-1"
aws_bootstrap_instance_type = "t3.large"
aws_master_instance_type = "t3.2xlarge"
aws_agent_instance_type = "t3.xlarge"
aws_spark_spot_agent_instance_type = "r3.2xlarge"
aws_spark_dev_agent_instance_type = "t3.2xlarge"
aws_spark_agent_instance_type = "m5.4xlarge"
aws_public_agent_instance_type = "t3.large"
ssh_key_name = "csidi"
ssh_spark_agents_key_name = "ansible"
ssh_spark_agents_private_key_filename =
"/home/ansible/.ssh/id_rsa"
Spark Installation
● dcos package install spark (et voila!)
● Alternatively we can use the Web UI.
Spark on Mesos
● Client Mode
○ A Spark Mesos framework is launched directly on the client machine and waits for the driver
output.
● Cluster mode
○ The driver is launched in the cluster and the client can find the results of the driver from the Mesos
Web UI.
● Mesos run modes:
○ Fine-grained mode (deprecated)
○ Coarse-grained mode, each Spark executor is represented by a single Mesos task. As a result,
executors have a constant size throughout their lifetime.
Submitting spark applications
● dcos spark cli
○ dcos spark run --submit-args="--class org.apache.spark.examples.SparkPi
https://downloads.mesosphere.com/spark/assets/spark-examples_2.11-2.0.1.jar 30"
● spark-submit (from inside the cluster)
○ /opt/spark/dist/bin/spark-submit --deploy-mode cluster --master
mesos://spark-dispatcher.marathon.l4lb.thisdcos.directory:7077 ---class
org.apache.spark.examples.SparkPi
https://downloads.mesosphere.com/spark/assets/spark-examples_2.11-2.0.1.jar 30
Notable configuration options when
submitting an application
● spark.mesos.executor.docker.image
● spark.mesos.uris
● spark.mesos.role
● spark.executor.memory
● spark.executor.cores
● spark.cores.max ( Number of executors: spark.cores.max/spark.executor.cores )
Viewing the logs
● Mesos sandbox
● dcos spark log
Viewing the logs
● dcos spark log
dcos spark log driver-20181126153522-0001 --file="stderr" --lines_count=4
18/11/26 16:05:36 INFO ShutdownHookManager: Deleting directory
/tmp/spark-19fad8b1-b162-44c4-a6ad-3cf3d9f3f004
18/11/26 16:05:36 INFO ShutdownHookManager: Deleting directory
/tmp/spark-19fad8b1-b162-44c4-a6ad-3cf3d9f3f004/pyspark-b93f92bc-bf9e-40b7-8ccd-65
8d18c7eade
I1126 16:05:37.522994 7645 executor.cpp:675] Container exited with status 137
W1126 16:05:37.522994 7644 logging.cpp:93] RAW: Received signal SIGTERM from process
2589 of user 0; exiting
Viewing the logs
● filebeat
filebeat.prospectors:
- input_type: log
paths:
- /var/lib/mesos/slave/slaves/*/frameworks/*/executors/*/runs/latest/stdout*
- /var/lib/mesos/slave/slaves/*/frameworks/*/executors/*/runs/latest/stderr*
- /var/log/mesos/*.log
- /var/log/dcos/dcos.log
exclude_files: ["stdout.logrotate.state", "stdout.logrotate.conf", "stderr.logrotate.state",
"stderr.logrotate.conf"]
tail_files: true
output.elasticsearch:
hosts: ["http://elasticsearch.marathon.l4lb.thisdcos.directory:9200"
Monitoring of a Spark Job
● Graphite
● Grafana
Monitoring mesos nodes
● Prometheus/Grafana
● TICK
Future Work / Sum up
● Scaling
● Dynamic resource allocation
● Multi tenant
Thank you!

More Related Content

PDF
BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open So...
PDF
Meteor Meets Mallory
PDF
Distributed Data Processing Workshop - SBU
PDF
WordPress Security 101: Essential Security Practices Simplified
PDF
An Introduction to Elasticsearch for Beginners
PDF
konfigurasi freeradius + daloradius in debian 9
PDF
Elasticsearch 1.x Cluster Installation (VirtualBox)
PPTX
OpenStack Day 2 Operations
BSides Rochester 2018: Chaim Sanders: Easily Deploying and Optimizing Open So...
Meteor Meets Mallory
Distributed Data Processing Workshop - SBU
WordPress Security 101: Essential Security Practices Simplified
An Introduction to Elasticsearch for Beginners
konfigurasi freeradius + daloradius in debian 9
Elasticsearch 1.x Cluster Installation (VirtualBox)
OpenStack Day 2 Operations

What's hot (20)

PPTX
OpenStack Day 2 Operations (Toronto)
PDF
Suricata
PDF
NoSql Injection
PPTX
Building of a redundant management cluster for your Cloud
ODP
Fusker - A NodeJS Security Framework
PDF
Elassandra
PPT
Intrusion Detection System using Snort
PDF
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
PDF
Breach > ATT&CK > Osquery: Cross-platform Endpoint Monitoring with Osquery
PPT
Nodejs quick start
PDF
Deploying Percona XtraDB Cluster in Openshift
PDF
Modern Cassandra for Developers
PPT
Node.js
PPTX
Cloud stack monitoring with zenoss
ODP
Elastic search
PDF
Node in Real Time - The Beginning
PPTX
Rails with MongoDB - RORLab 47th
PPTX
Six Degrees of Domain Admin - BloodHound at DEF CON 24
PDF
Visual Programming Framework for Unity - UniFlow のご紹介
PDF
Nessus and Reporting Karma
OpenStack Day 2 Operations (Toronto)
Suricata
NoSql Injection
Building of a redundant management cluster for your Cloud
Fusker - A NodeJS Security Framework
Elassandra
Intrusion Detection System using Snort
Hadoop 2.x HDFS Cluster Installation (VirtualBox)
Breach > ATT&CK > Osquery: Cross-platform Endpoint Monitoring with Osquery
Nodejs quick start
Deploying Percona XtraDB Cluster in Openshift
Modern Cassandra for Developers
Node.js
Cloud stack monitoring with zenoss
Elastic search
Node in Real Time - The Beginning
Rails with MongoDB - RORLab 47th
Six Degrees of Domain Admin - BloodHound at DEF CON 24
Visual Programming Framework for Unity - UniFlow のご紹介
Nessus and Reporting Karma
Ad

Similar to 15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos (20)

PDF
Declarative Infrastructure Tools
PDF
Null Bachaav - May 07 Attack Monitoring workshop.
PPTX
Attack monitoring using ElasticSearch Logstash and Kibana
PDF
The elastic stack on docker
PDF
AWS DevOps - Terraform, Docker, HashiCorp Vault
PDF
2012-03-15 What's New at Red Hat
PPTX
I hunt sys admins 2.0
PPTX
Devops in Networking
PDF
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
PDF
Introduction to node js - From "hello world" to deploying on azure
PDF
How We Learned To Love The Data Center Operating System
KEY
Building HTTP API's with NodeJS and MongoDB
PDF
Crikeycon 2019 Velociraptor Workshop
PPTX
OpenNMS - My Notes
PDF
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
PDF
Large-scaled Deploy Over 100 Servers in 3 Minutes
PDF
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
PPTX
Unit IV database intergration with node js
PDF
Practical Chaos Engineering
PPTX
Managing Your Security Logs with Elasticsearch
Declarative Infrastructure Tools
Null Bachaav - May 07 Attack Monitoring workshop.
Attack monitoring using ElasticSearch Logstash and Kibana
The elastic stack on docker
AWS DevOps - Terraform, Docker, HashiCorp Vault
2012-03-15 What's New at Red Hat
I hunt sys admins 2.0
Devops in Networking
I Just Want to Run My Code: Waypoint, Nomad, and Other Things
Introduction to node js - From "hello world" to deploying on azure
How We Learned To Love The Data Center Operating System
Building HTTP API's with NodeJS and MongoDB
Crikeycon 2019 Velociraptor Workshop
OpenNMS - My Notes
IstSec'14 - İbrahim BALİÇ - Automated Malware Analysis
Large-scaled Deploy Over 100 Servers in 3 Minutes
Scalable Monitoring Using Prometheus with Apache Spark Clusters with Diane F...
Unit IV database intergration with node js
Practical Chaos Engineering
Managing Your Security Logs with Elasticsearch
Ad

More from Athens Big Data (20)

PDF
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
PDF
21st Athens Big Data Meetup - 2nd Talk - Dive into ClickHouse storage system
PDF
19th Athens Big Data Meetup - 2nd Talk - NLP: From news recommendation to wor...
PDF
21st Athens Big Data Meetup - 3rd Talk - Dive into ClickHouse query execution
PDF
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
PDF
20th Athens Big Data Meetup - 2nd Talk - Druid: under the covers
PDF
20th Athens Big Data Meetup - 3rd Talk - Message from our sponsor: Velti
PDF
20th Athens Big Data Meetup - 1st Talk - Druid: the open source, performant, ...
PDF
19th Athens Big Data Meetup - 1st Talk - NLP understanding
PDF
18th Athens Big Data Meetup - 2nd Talk - Run Spark and Flink Jobs on Kubernetes
PDF
18th Athens Big Data Meetup - 1st Talk - Timeseries Forecasting as a Service
PDF
17th Athens Big Data Meetup - 2nd Talk - Data Flow Building and Calculation P...
PDF
17th Athens Big Data Meetup - 1st Talk - Speedup Machine Application Learning...
PDF
16th Athens Big Data Meetup - 2nd Talk - A Focus on Building and Optimizing M...
PDF
16th Athens Big Data Meetup - 1st Talk - An Introduction to Machine Learning ...
PDF
5th Athens Big Data Meetup - PipelineIO Workshop - Real-Time Training and Dep...
PDF
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
PDF
13th Athens Big Data Meetup - 2nd Talk - Training Neural Networks With Enterp...
PDF
11th Athens Big Data Meetup - 2nd Talk - Beyond Bitcoin; Blockchain Technolog...
PDF
9th Athens Big Data Meetup - 2nd Talk - Lead Scoring And Grading
22nd Athens Big Data Meetup - 1st Talk - MLOps Workshop: The Full ML Lifecycl...
21st Athens Big Data Meetup - 2nd Talk - Dive into ClickHouse storage system
19th Athens Big Data Meetup - 2nd Talk - NLP: From news recommendation to wor...
21st Athens Big Data Meetup - 3rd Talk - Dive into ClickHouse query execution
21st Athens Big Data Meetup - 1st Talk - Fast and simple data exploration wit...
20th Athens Big Data Meetup - 2nd Talk - Druid: under the covers
20th Athens Big Data Meetup - 3rd Talk - Message from our sponsor: Velti
20th Athens Big Data Meetup - 1st Talk - Druid: the open source, performant, ...
19th Athens Big Data Meetup - 1st Talk - NLP understanding
18th Athens Big Data Meetup - 2nd Talk - Run Spark and Flink Jobs on Kubernetes
18th Athens Big Data Meetup - 1st Talk - Timeseries Forecasting as a Service
17th Athens Big Data Meetup - 2nd Talk - Data Flow Building and Calculation P...
17th Athens Big Data Meetup - 1st Talk - Speedup Machine Application Learning...
16th Athens Big Data Meetup - 2nd Talk - A Focus on Building and Optimizing M...
16th Athens Big Data Meetup - 1st Talk - An Introduction to Machine Learning ...
5th Athens Big Data Meetup - PipelineIO Workshop - Real-Time Training and Dep...
14th Athens Big Data Meetup - Landoop Workshop - Apache Kafka Entering The St...
13th Athens Big Data Meetup - 2nd Talk - Training Neural Networks With Enterp...
11th Athens Big Data Meetup - 2nd Talk - Beyond Bitcoin; Blockchain Technolog...
9th Athens Big Data Meetup - 2nd Talk - Lead Scoring And Grading

Recently uploaded (20)

PDF
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
PDF
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
PDF
Getting started with AI Agents and Multi-Agent Systems
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PDF
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
PDF
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
PDF
August Patch Tuesday
PPT
Geologic Time for studying geology for geologist
PPT
Module 1.ppt Iot fundamentals and Architecture
PDF
Hybrid model detection and classification of lung cancer
PDF
Getting Started with Data Integration: FME Form 101
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Tartificialntelligence_presentation.pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
NewMind AI Weekly Chronicles – August ’25 Week III
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Enhancing emotion recognition model for a student engagement use case through...
DOCX
search engine optimization ppt fir known well about this
A Late Bloomer's Guide to GenAI: Ethics, Bias, and Effective Prompting - Boha...
From MVP to Full-Scale Product A Startup’s Software Journey.pdf
Getting started with AI Agents and Multi-Agent Systems
O2C Customer Invoices to Receipt V15A.pptx
Hybrid horned lizard optimization algorithm-aquila optimizer for DC motor
TrustArc Webinar - Click, Consent, Trust: Winning the Privacy Game
August Patch Tuesday
Geologic Time for studying geology for geologist
Module 1.ppt Iot fundamentals and Architecture
Hybrid model detection and classification of lung cancer
Getting Started with Data Integration: FME Form 101
A contest of sentiment analysis: k-nearest neighbor versus neural network
A review of recent deep learning applications in wood surface defect identifi...
Tartificialntelligence_presentation.pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
NewMind AI Weekly Chronicles – August ’25 Week III
Final SEM Unit 1 for mit wpu at pune .pptx
A comparative study of natural language inference in Swahili using monolingua...
Enhancing emotion recognition model for a student engagement use case through...
search engine optimization ppt fir known well about this

15th Athens Big Data Meetup - 1st Talk - Running Spark On Mesos

  • 1. Running Spark on Mesos Christos Sidiropoulos, Lead DevOps Engineer, Encode
  • 2. Agenda ● About ● Alternatives ● Mesos architecture ● DC/OS ● Spark installation/configuration ● Submitting spark applications ● Monitoring spark applications ● Viewing the logs
  • 3. About ● Advanced Security Analytics and Response Orchestration ● Early compromise detection. ● Capture and analyze traffic logs.
  • 4. Alternatives ● Standalone ○ Easy to deploy (scripts are bundled with spark distribution). ○ Can easily run on localhost for development. ○ Master-Worker setup. ○ HA supported utilizing Zookeeper. ○ Web UI for monitoring cluster and job statistics. ● Hadoop YARN ○ Harder to bring up. ○ Combination of the ResourceManager, NodeManager, Application Master & Container. ○ HA Supported utilizing Zookeeper. ○ ResourceManager/NodeManager UI. ● Kubernetes ○ Still experimental (v2.4.0). ○ Easy to get up and running if you are already familiar with k8s. ● Nomad ○ Good if you are into experimenting with hashicorp products.
  • 5. A few things about Mesos ● Using the same principles as the Linux kernel, only at a different level of abstraction. ● Dynamic resource sharing and isolation (CPU, RAM, …). ● Turn your data center into one very large computer (global resource manager). ● Dominant Resource Fairness. ● Scales on 10,000s of nodes. ● Packages and commercial support through Mesosphere ● Even YARN can run on mesos(myriad). ● Three main components ○ Mesos Master ○ Mesos Agent ○ Mesos Framework
  • 8. DC/OS ● Distributed operating system based on the Apache Mesos distributed systems kernel. ● A Cluster Manager. ● A Container Platform. ● An Operating System. ● Great documentation. ● Easy to spin up. ● A great catalog with packages (Universe).
  • 11. Bring it up ● Cloudformation ● Terraform/Ansible ● Manual https://github.com/dcos-labs/ansible-dcos os = "centos_7.4" state = "none" dcos_version = "1.11.4" # num_of_masters = "1" num_of_private_agents = "5" num_of_public_agents = "1" num_of_spark_spot_agents = "0" num_of_spark_dev_agents = "1" num_of_private_spark_agents = "3" # aws_region = "eu-west-1" aws_bootstrap_instance_type = "t3.large" aws_master_instance_type = "t3.2xlarge" aws_agent_instance_type = "t3.xlarge" aws_spark_spot_agent_instance_type = "r3.2xlarge" aws_spark_dev_agent_instance_type = "t3.2xlarge" aws_spark_agent_instance_type = "m5.4xlarge" aws_public_agent_instance_type = "t3.large" ssh_key_name = "csidi" ssh_spark_agents_key_name = "ansible" ssh_spark_agents_private_key_filename = "/home/ansible/.ssh/id_rsa"
  • 12. Spark Installation ● dcos package install spark (et voila!) ● Alternatively we can use the Web UI.
  • 13. Spark on Mesos ● Client Mode ○ A Spark Mesos framework is launched directly on the client machine and waits for the driver output. ● Cluster mode ○ The driver is launched in the cluster and the client can find the results of the driver from the Mesos Web UI. ● Mesos run modes: ○ Fine-grained mode (deprecated) ○ Coarse-grained mode, each Spark executor is represented by a single Mesos task. As a result, executors have a constant size throughout their lifetime.
  • 14. Submitting spark applications ● dcos spark cli ○ dcos spark run --submit-args="--class org.apache.spark.examples.SparkPi https://downloads.mesosphere.com/spark/assets/spark-examples_2.11-2.0.1.jar 30" ● spark-submit (from inside the cluster) ○ /opt/spark/dist/bin/spark-submit --deploy-mode cluster --master mesos://spark-dispatcher.marathon.l4lb.thisdcos.directory:7077 ---class org.apache.spark.examples.SparkPi https://downloads.mesosphere.com/spark/assets/spark-examples_2.11-2.0.1.jar 30
  • 15. Notable configuration options when submitting an application ● spark.mesos.executor.docker.image ● spark.mesos.uris ● spark.mesos.role ● spark.executor.memory ● spark.executor.cores ● spark.cores.max ( Number of executors: spark.cores.max/spark.executor.cores )
  • 16. Viewing the logs ● Mesos sandbox ● dcos spark log
  • 17. Viewing the logs ● dcos spark log dcos spark log driver-20181126153522-0001 --file="stderr" --lines_count=4 18/11/26 16:05:36 INFO ShutdownHookManager: Deleting directory /tmp/spark-19fad8b1-b162-44c4-a6ad-3cf3d9f3f004 18/11/26 16:05:36 INFO ShutdownHookManager: Deleting directory /tmp/spark-19fad8b1-b162-44c4-a6ad-3cf3d9f3f004/pyspark-b93f92bc-bf9e-40b7-8ccd-65 8d18c7eade I1126 16:05:37.522994 7645 executor.cpp:675] Container exited with status 137 W1126 16:05:37.522994 7644 logging.cpp:93] RAW: Received signal SIGTERM from process 2589 of user 0; exiting
  • 18. Viewing the logs ● filebeat filebeat.prospectors: - input_type: log paths: - /var/lib/mesos/slave/slaves/*/frameworks/*/executors/*/runs/latest/stdout* - /var/lib/mesos/slave/slaves/*/frameworks/*/executors/*/runs/latest/stderr* - /var/log/mesos/*.log - /var/log/dcos/dcos.log exclude_files: ["stdout.logrotate.state", "stdout.logrotate.conf", "stderr.logrotate.state", "stderr.logrotate.conf"] tail_files: true output.elasticsearch: hosts: ["http://elasticsearch.marathon.l4lb.thisdcos.directory:9200"
  • 19. Monitoring of a Spark Job ● Graphite ● Grafana
  • 20. Monitoring mesos nodes ● Prometheus/Grafana ● TICK
  • 21. Future Work / Sum up ● Scaling ● Dynamic resource allocation ● Multi tenant