SlideShare a Scribd company logo
Mesos
“There's Just No Getting around It: You're Building a Distributed System”
-Mark Cavage
A simple presentation on mesos by Gladson Manuel
What is Mesos?
● Mesos is a kernel designed to run on
distributed systems.
● In a distributed environment, Mesos runs on
every machine.
● Scheduler capable of handling multiple
resources.
Why Mesos?
● Scalability
● Fault tolerant
● Support Docker
● Isolation between tasks and linux containers
● Frameworks can be built on
Java/Python/Scala/C/C++
● WebUI
Architecture
Before and after Mesos
Structure of kernel
Representation
Mesos, because static partitioning is harmful
Mesos partitioning
● Mesos is datacentre kernel, so resources of a
node is not for that one node. It is for the whole
distributed system.
Zookeeper:
● Used to elect master if a running master is failed.
--It is recommended to keep the number of slaves as odd. As leader
election is based on a strict majority, zookeeper splits the available
number of masters into two and select the set with higher number of
Nodes.
Zookeeper quorum:
A limited number of zookeeper servers.
The Flow
● Slave 1 reports to the master that it has 4 CPUs and 4 GB of
memory free. The master then invokes the allocation policy
module, which tells it that framework 1 should be offered all
available resources.
● The master sends a resource offer describing what is available on
slave 1 to framework 1.
● The framework’s scheduler replies to the master with information
about two tasks to run on the slave, using <2 CPUs, 1 GB RAM>
for the first task, and <1 CPUs, 2 GB RAM> for the second task.
● Finally, the master sends the tasks to the slave, which allocates
appropriate resources to the framework’s executor, which in turn
launches the two tasks (depicted with dotted-line borders in the
figure). Because 1 CPU and 1 GB of RAM are still unallocated,
the allocation module may now offer them to framework 2.
● In addition, this resource offer process repeats when tasks finish
and new resources become free.
Getting Started
● Download source install dependencies and build
$ wget http://www.apache.org/dist/mesos/0.20.1/mesos-0.20.1.tar.gz
● Clone from git repository
$ git clone http://git-wip-us.apache.org/repos/asf/mesos.git
Common issues while build
● Java home not set
● Fix: export JAVA_HOME=/usr/java/<jdk_as_mentioned_by
mesos>/bin/java
● Maven downloads nothing
● Set maven proxy in ~/.m2/settings.xml
● DELAY!!
● Sorry its a compilation process. Either upgrade your hardware to
moster configuration or try compiled packages like
mesosphere(practical workaround).
Mesosphere installation
● Add Key of mesosphere repository
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF
DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]')
CODENAME=$(lsb_release -cs)
● Add mesosphere repository to ubuntu sources
echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | 
sudo tee /etc/apt/sources.list.d/mesosphere.list
sudo apt-get -y update
sudo apt-get install mesosphere
Build is done(finally). Now what?
● Start mesos master
./bin/mesos-master.sh --ip=127.0.0.1 –work_dir=/var/lib/mesos
● Start mesos slave
./bin/mesos-slave.sh –master=127.0.0.1:5050
● Access WebUI
http://127.0.0.1:5050
Running example frameworks
● ./src/examples/python/test-framework
127.0.0.1:5050
Frameworks in detail
Components:
Scheduler: Receives resource offers and Launch tasks
Executor: Executor is launched by the slave to execute tasks on the slave
Flow of Execution
● slave notifies master about its available
resources
● tasks is scheduled by the scheduler.So
scheduler have info about available tasks
● Scheduler sends the tasks to the right slave
based on the available resources of the slave
● Slave check of executor that is already
running,if not it launches a new one and
execute the task on the executor.
Status Updates
● non-terminal updates(TASK_RUNNING)
● terminal updates(TASK_FINISHED). Terminal
updates are very important since it is the only
way mesos get informed that a task in done.
Only then the resources are freed
● TASK_LOST(slave terminated)
Activities
● Callbacks
Callbacks are synchronous and single threaded. Since
only one one call is made at a time no blocks will
occur
--registered(frameworkId,masterInfo)
--resourceOffers(offers)
--statusUpdate(taskStatus)
● Actions
Asynchronous, for example
sendStatusUpdate() gets queued in the driver
--launchTasks(offerId,taskInfo,filters)
--killTask(taskId)
--declineOffer(offerId,filters)
Whats going on in the code?
● Every request is looped through each offer
● If offer satisfies a request, MesosTask is created by
calling driver.launchTasks(offer.getId,tasks,filters)
● Task is executed and perform an exit()
Available frameworks
● Scala: Chronos,Spark
● Java: hadoop, jenkins, storm
● Python: dpark

More Related Content

PDF
Introduction to Apache Mesos
PPTX
Introduction to Apache Mesos
PDF
Building Web Scale Apps with Docker and Mesos by Alex Rukletsov (Mesosphere)
PDF
Mesos: The Operating System for your Datacenter
PPTX
Introduction to Apache Mesos
PDF
DEPLOYING A DOCKERIZED DISTRIBUTED APPLICATION IN MESOS
PDF
Introduction To Apache Mesos
PDF
Building and deploying a distributed application with Docker, Mesos and Marathon
Introduction to Apache Mesos
Introduction to Apache Mesos
Building Web Scale Apps with Docker and Mesos by Alex Rukletsov (Mesosphere)
Mesos: The Operating System for your Datacenter
Introduction to Apache Mesos
DEPLOYING A DOCKERIZED DISTRIBUTED APPLICATION IN MESOS
Introduction To Apache Mesos
Building and deploying a distributed application with Docker, Mesos and Marathon

What's hot (20)

PDF
Musings on Mesos: Docker, Kubernetes, and Beyond.
PDF
DockerCon14 Cluster Management and Containerization
PDF
Container Orchestration @Docker Meetup Hamburg
PDF
Mesos ♥ Docker
PPTX
Mesos and Kubernetes ecosystem overview
PPTX
DC/OS: The definitive platform for modern apps
PDF
Docker on mesos
ODP
Introduction to Mesos
PPTX
Docker, Mesos, Spark
PPTX
HA Kubernetes on Mesos / Marathon
PDF
Federated mesos clusters for global data center designs
PDF
Mesos and containers
PDF
Introduction to mesos bay
PDF
Kubernetes on Top of Mesos on Top of DCOS
PDF
Performance Benchmarking of Clouds Evaluating OpenStack
PDF
Orchestrating Redis & K8s Operators
PPTX
Platform as a Service with Kubernetes and Mesos
PPTX
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
PDF
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
PDF
Getting Started Hacking OpenNebula - Fosdem-2013
Musings on Mesos: Docker, Kubernetes, and Beyond.
DockerCon14 Cluster Management and Containerization
Container Orchestration @Docker Meetup Hamburg
Mesos ♥ Docker
Mesos and Kubernetes ecosystem overview
DC/OS: The definitive platform for modern apps
Docker on mesos
Introduction to Mesos
Docker, Mesos, Spark
HA Kubernetes on Mesos / Marathon
Federated mesos clusters for global data center designs
Mesos and containers
Introduction to mesos bay
Kubernetes on Top of Mesos on Top of DCOS
Performance Benchmarking of Clouds Evaluating OpenStack
Orchestrating Redis & K8s Operators
Platform as a Service with Kubernetes and Mesos
Orchestration tool roundup - OpenStack Israel summit - kubernetes vs. docker...
Leonid Vasilyev "Building, deploying and running production code at Dropbox"
Getting Started Hacking OpenNebula - Fosdem-2013
Ad

Viewers also liked (20)

PPTX
Building and Deploying Application to Apache Mesos
PDF
Datacenter Computing with Apache Mesos - BigData DC
PDF
DockerCon SF 2015: Scaling New Services
PPTX
Docker based Hadoop provisioning - anywhere
PPTX
Cloudbreak - Technical Deep Dive
PDF
Mesos
PDF
Mesos university - Devoxx France 2015 - part 1
PDF
Introduction to docker
PDF
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
PDF
Shell script
PDF
Managing computational resources with Apache Mesos
PDF
An introduction to predictionIO
PDF
Apache mahout - introduction
PDF
PC = Personal Cloud (or how to use your development machine with Vagrant and ...
PDF
Introduction to CFEngine
PPT
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
PPTX
Building Web Apps in Ratpack
Building and Deploying Application to Apache Mesos
Datacenter Computing with Apache Mesos - BigData DC
DockerCon SF 2015: Scaling New Services
Docker based Hadoop provisioning - anywhere
Cloudbreak - Technical Deep Dive
Mesos
Mesos university - Devoxx France 2015 - part 1
Introduction to docker
Un jenkins amélioré avec docker mesos et marathon à Devoxx 2015
Shell script
Managing computational resources with Apache Mesos
An introduction to predictionIO
Apache mahout - introduction
PC = Personal Cloud (or how to use your development machine with Vagrant and ...
Introduction to CFEngine
Service Oriented UI Architecture in the world of web, desktop, & mobile appli...
Building Web Apps in Ratpack
Ad

Similar to Apache Mesos: a simple explanation of basics (20)

PPTX
Apache mesos - overview
PDF
Spark on Mesos
PDF
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
ODP
Enabling ceph-mgr to control Ceph services via Kubernetes
PDF
Building Distributed Systems from Scratch - Part 1
PDF
Container Orchestration from Theory to Practice
PDF
A Travel Through Mesos
PDF
Prologue O/S - Improving the Odds of Job Success
PPTX
Making Distributed Data Persistent Services Elastic (Without Losing All Your ...
PDF
Buytaert kris my_sql-pacemaker
PPTX
Retrofitting Continuous Delivery
PDF
Apache spark - Installation
PPTX
Data Engineer's Lunch #80: Apache Spark Resource Managers
PDF
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
PDF
Docker Introduction + what is new in 0.9
PDF
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
PDF
Our Puppet Story (Linuxtag 2014)
PDF
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
PDF
Seastar / ScyllaDB, or how we implemented a 10-times faster Cassandra
ODP
Apache Spark Internals
Apache mesos - overview
Spark on Mesos
Apache Cassandra Lunch #41: Cassandra on Kubernetes - Docker/Kubernetes/Helm ...
Enabling ceph-mgr to control Ceph services via Kubernetes
Building Distributed Systems from Scratch - Part 1
Container Orchestration from Theory to Practice
A Travel Through Mesos
Prologue O/S - Improving the Odds of Job Success
Making Distributed Data Persistent Services Elastic (Without Losing All Your ...
Buytaert kris my_sql-pacemaker
Retrofitting Continuous Delivery
Apache spark - Installation
Data Engineer's Lunch #80: Apache Spark Resource Managers
Docker Introduction, and what's new in 0.9 — Docker Palo Alto at RelateIQ
Docker Introduction + what is new in 0.9
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
Our Puppet Story (Linuxtag 2014)
FIWARE Tech Summit - Docker Swarm Secrets for Creating Great FIWARE Platforms
Seastar / ScyllaDB, or how we implemented a 10-times faster Cassandra
Apache Spark Internals

Recently uploaded (20)

PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPT
Teaching material agriculture food technology
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Cloud computing and distributed systems.
PDF
Empathic Computing: Creating Shared Understanding
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Approach and Philosophy of On baking technology
PDF
Machine learning based COVID-19 study performance prediction
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
KodekX | Application Modernization Development
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Digital-Transformation-Roadmap-for-Companies.pptx
Review of recent advances in non-invasive hemoglobin estimation
Teaching material agriculture food technology
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Cloud computing and distributed systems.
Empathic Computing: Creating Shared Understanding
Unlocking AI with Model Context Protocol (MCP)
Approach and Philosophy of On baking technology
Machine learning based COVID-19 study performance prediction
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
KodekX | Application Modernization Development
“AI and Expert System Decision Support & Business Intelligence Systems”
NewMind AI Monthly Chronicles - July 2025
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...

Apache Mesos: a simple explanation of basics

  • 1. Mesos “There's Just No Getting around It: You're Building a Distributed System” -Mark Cavage A simple presentation on mesos by Gladson Manuel
  • 2. What is Mesos? ● Mesos is a kernel designed to run on distributed systems. ● In a distributed environment, Mesos runs on every machine. ● Scheduler capable of handling multiple resources.
  • 3. Why Mesos? ● Scalability ● Fault tolerant ● Support Docker ● Isolation between tasks and linux containers ● Frameworks can be built on Java/Python/Scala/C/C++ ● WebUI
  • 8. Mesos, because static partitioning is harmful
  • 9. Mesos partitioning ● Mesos is datacentre kernel, so resources of a node is not for that one node. It is for the whole distributed system.
  • 10. Zookeeper: ● Used to elect master if a running master is failed. --It is recommended to keep the number of slaves as odd. As leader election is based on a strict majority, zookeeper splits the available number of masters into two and select the set with higher number of Nodes. Zookeeper quorum: A limited number of zookeeper servers.
  • 12. ● Slave 1 reports to the master that it has 4 CPUs and 4 GB of memory free. The master then invokes the allocation policy module, which tells it that framework 1 should be offered all available resources. ● The master sends a resource offer describing what is available on slave 1 to framework 1. ● The framework’s scheduler replies to the master with information about two tasks to run on the slave, using <2 CPUs, 1 GB RAM> for the first task, and <1 CPUs, 2 GB RAM> for the second task. ● Finally, the master sends the tasks to the slave, which allocates appropriate resources to the framework’s executor, which in turn launches the two tasks (depicted with dotted-line borders in the figure). Because 1 CPU and 1 GB of RAM are still unallocated, the allocation module may now offer them to framework 2. ● In addition, this resource offer process repeats when tasks finish and new resources become free.
  • 13. Getting Started ● Download source install dependencies and build $ wget http://www.apache.org/dist/mesos/0.20.1/mesos-0.20.1.tar.gz ● Clone from git repository $ git clone http://git-wip-us.apache.org/repos/asf/mesos.git
  • 14. Common issues while build ● Java home not set ● Fix: export JAVA_HOME=/usr/java/<jdk_as_mentioned_by mesos>/bin/java ● Maven downloads nothing ● Set maven proxy in ~/.m2/settings.xml ● DELAY!! ● Sorry its a compilation process. Either upgrade your hardware to moster configuration or try compiled packages like mesosphere(practical workaround).
  • 15. Mesosphere installation ● Add Key of mesosphere repository sudo apt-key adv --keyserver keyserver.ubuntu.com --recv E56151BF DISTRO=$(lsb_release -is | tr '[:upper:]' '[:lower:]') CODENAME=$(lsb_release -cs) ● Add mesosphere repository to ubuntu sources echo "deb http://repos.mesosphere.io/${DISTRO} ${CODENAME} main" | sudo tee /etc/apt/sources.list.d/mesosphere.list sudo apt-get -y update sudo apt-get install mesosphere
  • 16. Build is done(finally). Now what? ● Start mesos master ./bin/mesos-master.sh --ip=127.0.0.1 –work_dir=/var/lib/mesos ● Start mesos slave ./bin/mesos-slave.sh –master=127.0.0.1:5050 ● Access WebUI http://127.0.0.1:5050
  • 17. Running example frameworks ● ./src/examples/python/test-framework 127.0.0.1:5050
  • 18. Frameworks in detail Components: Scheduler: Receives resource offers and Launch tasks Executor: Executor is launched by the slave to execute tasks on the slave
  • 19. Flow of Execution ● slave notifies master about its available resources ● tasks is scheduled by the scheduler.So scheduler have info about available tasks ● Scheduler sends the tasks to the right slave based on the available resources of the slave ● Slave check of executor that is already running,if not it launches a new one and execute the task on the executor.
  • 20. Status Updates ● non-terminal updates(TASK_RUNNING) ● terminal updates(TASK_FINISHED). Terminal updates are very important since it is the only way mesos get informed that a task in done. Only then the resources are freed ● TASK_LOST(slave terminated)
  • 21. Activities ● Callbacks Callbacks are synchronous and single threaded. Since only one one call is made at a time no blocks will occur --registered(frameworkId,masterInfo) --resourceOffers(offers) --statusUpdate(taskStatus)
  • 22. ● Actions Asynchronous, for example sendStatusUpdate() gets queued in the driver --launchTasks(offerId,taskInfo,filters) --killTask(taskId) --declineOffer(offerId,filters)
  • 23. Whats going on in the code? ● Every request is looped through each offer ● If offer satisfies a request, MesosTask is created by calling driver.launchTasks(offer.getId,tasks,filters) ● Task is executed and perform an exit()
  • 24. Available frameworks ● Scala: Chronos,Spark ● Java: hadoop, jenkins, storm ● Python: dpark