SlideShare a Scribd company logo
marc@sloppy.io
Introduction to Apache Mesos
marc@sloppy.io
Overview
● Introduction
● Architecture
● Security
● Container
● High availability
marc@sloppy.io
Introduction
● First release in 2009 at the Berkley University
● Framework to use datacenter resources
efficiently
● Combine Cpu, storage, memory etc. to one big
shared virtual resource
● A distributed systems kernel
● 10.000 lines C++ code
marc@sloppy.io
Introduction - Definitions
● Master - Scheduler
● Slaves – Working Nodes
● Frameworks – Application running on Mesos
● Executors – Run tasks on the slaves
● Executor-Task - Running job on the slave
● Resource Offer - Slave resources which could
be used by the frameworks
marc@sloppy.io
Architecture
marc@sloppy.io
Introduction - Frameworks
https://docs.mesosphere.com/frameworks/
marc@sloppy.io
Resource Allocation
marc@sloppy.io
Resource Allocation
1) 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.
2) The master sends a resource offer describing
what is available on slave 1 to framework 1.
marc@sloppy.io
Resource Allocation
3) 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.
2) 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
marc@sloppy.io
Resource Allocation - DRF
● Resource offer decision are made by the
Resource Allocation Modul in the master
● In a heterogeneous environment resource
allocation is difficult
● What is a fair share, when:
User a require 1 CPU, 4GB RAM
User b require 3 CPUs, 1 GB RAM
● Mesos: Dominant Resource Fairness
marc@sloppy.io
DRF
● A modified fair share algorithm
● The goal is that each framework receives a fair
share of the the resources most needed by the
framework
● Dominant resource: Resource most demand by
the framework
● Dominant Share: The highest percentage of
shares owned across all resources of a
framework
marc@sloppy.io
DRF - Example
● Resource offer: 9 Cpu, 18GB RAM
● Tasks User A: 1CPU, 4 GB RAM - RAM=DR
● Tasks User B: 3CPUs, 1GB RAM – CPU=DR
● Each Framework has 2/3 of its DS
marc@sloppy.io
DRF - Example
● Framework1: 1CPU, 4GB RAM
● Framework2: 3CPU, 1GB RAM
● Buggy tasks could be killed by mesos
● Framework can have guaranteed allocation, non
of its tasks should be killed
marc@sloppy.io
RA Master Configuration
Name Default Example
allocation_interval 1s
framework_sorter drf
user_sorter drf
offer_timeout 5 minutes
roles - marathon,jenkins
weights - marathon=2,jenkins=1
marc@sloppy.io
RA Slave Configuration
Name Default Example
attributes ssd:true,rack:2
default_role *
resources cpus(jenkins):1;disk(jenkins):10000;
cpus(marathon):3;mem(marathon):2000
marc@sloppy.io
Mesos Security
● Default configuration = No security
Name Example
Master authenticate_slaves true
credentials /etc/mesos.pw
authenticators crammd5
authenticate true
Slave credential /etc/mesos.pw
marc@sloppy.io
Framework Security
1) Framework to (re-)register with authorized roles
2)Framework to launch task/executors as authorized
users
3)Authorized principals to shutdown frameworks
through “/shutdown” HTTP endpoint
marc@sloppy.io
Security ACLs
Subjects Action Object
principals register_framework roles
usernames run_tasks users
shutdown_frameworks framework_principals
● A set of subjects can perform an action
on a set of objects
marc@sloppy.io
Security ACLs Example
marc@sloppy.io
Extract of the mesos api
URL Function
master:5050/help REST Documentation
master:5050/metrics/snapshot Metrics of the cluster
master:5050/master/tasks.json List mesos tasks
master:5050/master/redirect 307 to the leading master
master:5050/master/shutdown Shutdown Framework
master:5050/registrar(1)/registry Content of the current registry
slave:5051/files/browse.json?path=pathOnSlave Browse files in sandbox
slave:5051/files/read.json?path=stdoutOnSlave Read stdout from sandbox
slave:5051/system/stats.json Local system metrics
marc@sloppy.io
Resource Isolation
● Mesos supports Docker - and Mesos Container
● Resource isolation with cgroups or posix
marc@sloppy.io
Mesos and Docker
marc@sloppy.io
Mesos HA
marc@sloppy.io
Mesos Tasks States
TaskState Int Description
TASK_STARTING 0
TASK_RUNNING 1 Task
TASK_FINISHED 2 TERMINAL: The task finished successfully
TASK_FAILED 3 TERMINAL: The task failed to finished
TASK_KILLED 4 TERMINAL: The task was killed by executor
TASK_LOST 5 TERMINAL: The task was failed but can
rescheduled
TASK_STAGING 6 Initial State
TASK_ERROR 7 TERMINAL: Task description contains an error
marc@sloppy.io
References
● http://mesos.apache.org/documentation/latest/
● Mesos: A Platform for Fine-Grained Resource Sharing in the Data Center
● Dominant Resource Fairness: Fair Allocation of Multiple Resource Types
● playing-traffic-cop-resource-allocation-in-apache-mesos
● https://mesosphere.com/
marc@sloppy.io
Thank you

More Related Content

What's hot

Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache Zookeeper
Anshul Patel
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
Knoldus Inc.
 
8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker
Fabio Fumarola
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016
Viet-Dung TRINH
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache Zookeeper
Alex Ehrnschwender
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Action
juvenxu
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesday
Andrei Savu
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
hastexo
 
Cassandra and Rails at LA NoSQL Meetup
Cassandra and Rails at LA NoSQL MeetupCassandra and Rails at LA NoSQL Meetup
Cassandra and Rails at LA NoSQL Meetup
Michael Wynholds
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
Jimmy Lai
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbit
Redis Labs
 
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on DockerRunning High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Sematext Group, Inc.
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replication
satejsahu
 
Mysql data replication
Mysql data replicationMysql data replication
Mysql data replication
Tuấn Ngô
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
Kris Buytaert
 
Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
jhao niu
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
MongoDB
 
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API ExamplesApache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Binu George
 
How to Run Solr on Docker and Why
How to Run Solr on Docker and WhyHow to Run Solr on Docker and Why
How to Run Solr on Docker and Why
Sematext Group, Inc.
 

What's hot (20)

Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache Zookeeper
 
Introduction to Apache Mesos
Introduction to Apache MesosIntroduction to Apache Mesos
Introduction to Apache Mesos
 
8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker8a. How To Setup HBase with Docker
8a. How To Setup HBase with Docker
 
Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016Apache zookeeper seminar_trinh_viet_dung_03_2016
Apache zookeeper seminar_trinh_viet_dung_03_2016
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache Zookeeper
 
Zookeeper In Action
Zookeeper In ActionZookeeper In Action
Zookeeper In Action
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Apache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesdayApache ZooKeeper TechTuesday
Apache ZooKeeper TechTuesday
 
MySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the PacemakerMySQL High Availability Sprint: Launch the Pacemaker
MySQL High Availability Sprint: Launch the Pacemaker
 
Cassandra and Rails at LA NoSQL Meetup
Cassandra and Rails at LA NoSQL MeetupCassandra and Rails at LA NoSQL Meetup
Cassandra and Rails at LA NoSQL Meetup
 
Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...Distributed system coordination by zookeeper and introduction to kazoo python...
Distributed system coordination by zookeeper and introduction to kazoo python...
 
Background Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbitBackground Tasks in Node - Evan Tahler, TaskRabbit
Background Tasks in Node - Evan Tahler, TaskRabbit
 
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on DockerRunning High Performance & Fault-tolerant Elasticsearch Clusters on Docker
Running High Performance & Fault-tolerant Elasticsearch Clusters on Docker
 
Intro to MySQL Master Slave Replication
Intro to MySQL Master Slave ReplicationIntro to MySQL Master Slave Replication
Intro to MySQL Master Slave Replication
 
Mysql data replication
Mysql data replicationMysql data replication
Mysql data replication
 
MySQL HA with PaceMaker
MySQL HA with  PaceMakerMySQL HA with  PaceMaker
MySQL HA with PaceMaker
 
Zookeeper Introduce
Zookeeper IntroduceZookeeper Introduce
Zookeeper Introduce
 
Backup, Restore, and Disaster Recovery
Backup, Restore, and Disaster RecoveryBackup, Restore, and Disaster Recovery
Backup, Restore, and Disaster Recovery
 
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API ExamplesApache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
Apache Zookeeper Explained: Tutorial, Use Cases and Zookeeper Java API Examples
 
How to Run Solr on Docker and Why
How to Run Solr on Docker and WhyHow to Run Solr on Docker and Why
How to Run Solr on Docker and Why
 

Similar to Introduction to Mesos

advanced Google file System
advanced Google file Systemadvanced Google file System
advanced Google file System
diptipan
 
google file system
google file systemgoogle file system
google file system
diptipan
 
Google file system
Google file systemGoogle file system
Google file system
Lalit Rastogi
 
Lalit
LalitLalit
Lalit
diptipan
 
Google File System
Google File SystemGoogle File System
Google File System
Junyoung Jung
 
Google file system
Google file systemGoogle file system
Google file system
Roopesh Jhurani
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
butest
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
butest
 
GOOGLE FILE SYSTEM
GOOGLE FILE SYSTEMGOOGLE FILE SYSTEM
GOOGLE FILE SYSTEM
JYoTHiSH o.s
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation in
RahulBhole12
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
Arnab Biswas
 
The Google Chubby lock service for loosely-coupled distributed systems
The Google Chubby lock service for loosely-coupled distributed systemsThe Google Chubby lock service for loosely-coupled distributed systems
The Google Chubby lock service for loosely-coupled distributed systems
Romain Jacotin
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
ITviec
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
Salman Baset
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Phil Estes
 
Introduction to mesos
Introduction to mesosIntroduction to mesos
Introduction to mesos
Omid Vahdaty
 
Advance google file system
Advance google file systemAdvance google file system
Advance google file system
Lalit Rastogi
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
Jesang Yoon
 
Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerun
idsecconf
 
Benchmarking Solr Performance
Benchmarking Solr PerformanceBenchmarking Solr Performance
Benchmarking Solr Performance
Lucidworks
 

Similar to Introduction to Mesos (20)

advanced Google file System
advanced Google file Systemadvanced Google file System
advanced Google file System
 
google file system
google file systemgoogle file system
google file system
 
Google file system
Google file systemGoogle file system
Google file system
 
Lalit
LalitLalit
Lalit
 
Google File System
Google File SystemGoogle File System
Google File System
 
Google file system
Google file systemGoogle file system
Google file system
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
Cloud Computing
Cloud ComputingCloud Computing
Cloud Computing
 
GOOGLE FILE SYSTEM
GOOGLE FILE SYSTEMGOOGLE FILE SYSTEM
GOOGLE FILE SYSTEM
 
Cloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation inCloud computing UNIT 2.1 presentation in
Cloud computing UNIT 2.1 presentation in
 
Machine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkMLMachine Learning With H2O vs SparkML
Machine Learning With H2O vs SparkML
 
The Google Chubby lock service for loosely-coupled distributed systems
The Google Chubby lock service for loosely-coupled distributed systemsThe Google Chubby lock service for loosely-coupled distributed systems
The Google Chubby lock service for loosely-coupled distributed systems
 
[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions[Hanoi-August 13] Tech Talk on Caching Solutions
[Hanoi-August 13] Tech Talk on Caching Solutions
 
Unraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production CloudUnraveling Docker Security: Lessons From a Production Cloud
Unraveling Docker Security: Lessons From a Production Cloud
 
Tokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker SecurityTokyo OpenStack Summit 2015: Unraveling Docker Security
Tokyo OpenStack Summit 2015: Unraveling Docker Security
 
Introduction to mesos
Introduction to mesosIntroduction to mesos
Introduction to mesos
 
Advance google file system
Advance google file systemAdvance google file system
Advance google file system
 
node.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoonnode.js 실무 - node js in practice by Jesang Yoon
node.js 실무 - node js in practice by Jesang Yoon
 
Linux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - WonokaerunLinux kernel-rootkit-dev - Wonokaerun
Linux kernel-rootkit-dev - Wonokaerun
 
Benchmarking Solr Performance
Benchmarking Solr PerformanceBenchmarking Solr Performance
Benchmarking Solr Performance
 

Introduction to Mesos

Editor's Notes

  1. Blue: PaaS Green: Big Data Processing Violet: Batch Scheduling Pink. Data Storage
  2. allocation_interval:
  3. -docker_remove_delay=VALUE