Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th...

54
Apache Mesos Delivering mixed batch & real-time data infrastructure 2015-11-17, Galway, Ireland Naoise Dunne , Insight Centre for Data Analytics Michael Hausenblas , Mesosphere Inc. http://www.meetup.com/Galway-Data-Meetup/events/226672887/

Transcript of Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th...

Page 1: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Apache MesosDelivering mixed batch & real-time data infrastructure

2015-11-17, Galway, Ireland

Naoise Dunne, Insight Centre for Data AnalyticsMichael Hausenblas, Mesosphere Inc.

http://www.meetup.com/Galway-Data-Meetup/events/226672887/

Page 2: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Types of Workloads

2

batch streaming PaaS

MapReduce

Page 4: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Intro

Page 5: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

• A top-level ASF project• A cluster resource negotiator• Scalable to 10,000s of nodes

but also useful for a handful of nodes

• Fault-tolerant, battle-tested• An SDK for distributed apps• Native Docker support

5

Apache Mesos

Page 6: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

What is a Data Center Scheduler?

● Schedulers run your Distributed Apps● An operating system kernel for the cloud● Schedulers coordinate execution of work on cluster

Page 7: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

A Quick History of Schedulers

Page 8: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Quick history of distributed schedulers

2004 mapreduce paper

2004 Google Borg

2011 Hadoop1.02003 Google filesystem

2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015

2008 Hadoop released

2013 Yarn

2010 Spark Paper

2010 Nexus (Mesos)

2005 Hadoop started

2013 Mesos Released

2011 Mesos Paper

2014 Kubernetes

2014 Google Omega paper

History of Datacenter Schedulers

2003 Slurm

Page 9: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Hadoop - Original O/S SchedulerMonolithic scheduler: Original open source datacenter scheduler

● jobs are batched and executed● Designed only to run Mapreduce jobs● No concurrency between apps● Evolving into yarn

Hadoop

Linux Server Linux Server

hadoop- resource management

mesos slavemesos slave

Linked datat m/r job

Linked datat m/r job

Linked datat app

Page 10: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos - a Great Leap Forward2 level scheduler : More flexible

● Can Schedule many kinds of applications● Frameworks (such as spark) are delegated

the per application scheduling● Mesos responsible for resource distribution

between applications and enforcing overall fairness

● Very modular, due to 2 level scheduling. frameworks manage apps as they like

Mesos

Linux Server Linux Server

Mesos - resource management

Mesos - scheduler jobs

frameworkchronos

mesos slave

frameworkspark

frameworkmarathon

mesos slave

Hadoop M/R job

Linked data job

Linked datat app

Page 11: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

How Mesos Works

Page 12: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Architecture

12

http://mesos.berkeley.edu/mesos_tech_report.pdf

Page 13: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Resources

● resource == anything a task/executor consumes in order

to do their work

● standard resources: cpu, mem, disk, ports

● DRF

Page 14: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 14

Page 15: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 15

Page 16: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 16

Page 17: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 17

Page 18: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 18

Page 19: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 19

Page 20: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 20

Page 21: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 21

Page 22: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 22

Page 23: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 23

Page 24: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 24

Page 25: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 25

Page 26: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 26

Page 27: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 27

Page 28: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 28

Page 29: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

© 2015 Mesosphere, Inc. 29

Page 30: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Benefits of using a Scheduler

● Efficiency - best use of computing resources● Agility - change your application mix with no turnaround● Scalability - grow to the current demand of your app● Modularity - 2 level schedulers have plugin frameworks

that allow quick repurposing of core and no reliance on one vendor (more later)

Page 31: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Ecosystem

Page 32: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Ecosystem

Mesos

Mesos - scheduler short jobs Mesos - scheduler long run jobs

Spark Fwk Chronos Fwk

Marathon Framework

OS Monitor

Mesos Monitor

Linux Server Linux Server Linux Server

Mesos - resource management

mesos client Docker mesos

client Docker mesos client Docker

Resources cpu mem disk Managed by Mesos

Applications work with frameworks to get resources they need

Frameworks Negotiate with mesos to run their jobs

DatastoresHDT, Neo4JgraphX Granatum RevealedGraph

Jobs

Docker manages isolation on Linux servers

Page 33: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Ecosystem

Mesos

Linux Server Linux Server Linux Server

Mesos - resource management

Mesos - scheduler short jobs Mesos - scheduler long run jobs

Spark Fwk Chronos Fwk Marathon fwk

mesos client Docker mesos

client Docker mesos client Docker

HDFS

Zookeeper

We need HDFS for large storage on Spark Jobs

Marathon can now use HDFS to store large Dependencies

Docker Registry

Universe/MultiverseDCOS DCOS DCOS

Mesos & frameworks needs zookeeper

you will need docker reg for marathon

To run mesos you will need dcos or glue

Mesos DNS

Need Mesos DNS for service discovery

Page 34: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Datacenter schedulers: Why?

Schedulers help you focus on your own work and not the infrastructure.“its great to be able to focus on what it is you want to be doing rather than worrying about how do you get what it is you need in order to be able to get stuff done”

- John Wilkes (Google)

Page 35: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Best Practices

Page 36: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Mesos Best Practices● Discovery

● Orchestration

● Composition

Page 37: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Discovery

Page 38: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Orchestration

Page 39: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Orchestration

Page 40: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Orchestration

Page 41: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Composition

● Marathon: apps and groups

● Kubernetes: pods and services

● Reusability, affinity and loose coupling

Page 42: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Monitoring

Page 43: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Monitoring

Page 44: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Enter DCOS

Page 45: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Local OS vs. Distributed OS

45http://bitly.com/os-vs-dcos

Page 46: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

DCOS, A Distributed Operating System

46

• kernel (Apache Mesos, written in C++) scales to 10,000 of nodes

• fault-tolerant in all components, rolling upgrades throughout

• containers first class citizens (LXC, Docker)

• local OS per node (+container enabled)

• scheduling (long-lived, batch)

• service discovery, monitoring, logging, debugging

Page 47: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

DCOS High Level Overview

47

Any Service or Container

Any Infrastructure

Mesosphere DCOS

Your favorite services, container formats, and those yet to come

Build apps once on DCOS, and run it anywhere

Runs distributed apps anywhere as simply as running apps on your laptop

Page 48: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

DCOS Benefits

48

• Run stateless services such as Web servers, app servers (via Marathon) and stateful services like Spark, Kafka, HDFS, Cassandra, ArangoDB etc. together on one cluster

• Dynamic partitioning of your cluster, depending on your needs (business requirements)

• Increased utilization (10% → 80% and more)

Page 49: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

DCOS Architecture

49https://docs.mesosphere.com/getting-started/dcosarchitecture/

Page 50: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

It’s demo time …

Page 54: Delivering mixed batch & real-time data infrastructure 2015-11-17, …files.meetup.com/18245106/4th Meetup Apache Mesos.pdf · 2015-11-24 · Apache Mesos Delivering mixed batch &

Q & A