Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ......

33
The Emergence of the Datacenter Developer Tobi Knaup, Mesosphere · @superguenter

Transcript of Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ......

Page 1: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

The Emergence of the Datacenter Developer

Tobi Knaup, Mesosphere · @superguenter

Page 2: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

A Brief History of Operating Systems

2

Page 3: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Mainframes

Punchcards

No operating systems

Time Sharing

Computing as a utility

1950’s

3

Page 4: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

UNIX

Small, composable programs

Machine-independent language (C)

Multitasking & Multiuser

Everything is a file

Shell

1960’s

4

Page 5: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

PC OS

Windows, Mac OS, Amiga

GUI

Mouse

Virtual Memory

1980’s

5

Page 6: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Mobile OS

iOS, Android

Touchscreen

Camera

GPS, Accelerometer

2000’s

6

Page 7: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Datacenter OS

Apache Mesos

Linux Containers

Cluster Scheduling

API for the datacenter

2010’s

7

Page 8: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

The Datacenter Developer

8

Page 9: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

What is a Datacenter Developer?

9

A developer who uses a datacenter SDK to build distributed systems that can dynamically leverage all the resources available in a datacenter.

Page 10: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Without Mesos

10

Building Distributed Systems

Application Code

Task Management Monitoring

Deployment Isolation & QoS

Resource Allocation

Scheduler

Page 11: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

With Mesos

11

Building Distributed Systems

Application Code

Task Management Monitoring

Deployment Isolation & QoS

Resource Allocation

Application Scheduler

Mesos Scheduler

handled by theMesos SDK{

Page 12: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… uses Containers to isolate tasks

12

Linux: process isolationprivate address space, file descriptors, e.g stdout

Mesos: linux containersTime share of CPU, private memory/pid/user namespace, chrootDisk and network QoS

A Mesos Datacenter Developer…

Page 13: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… can populate cluster nodes dynamically

13

No need to provision new nodes or write recipes

Mesos fetches immutable artifacts via HTTP/HDFS or Docker

Can also be used to deploy config, models, …

A Mesos Datacenter Developer…

Page 14: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets task lifecycle management

14

Mesos manages task distribution: starting, monitoring, killing, cleanup

Metadata

A Mesos Datacenter Developer…

Page 15: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… can easily respond to failures

15

Machine and network failure detection

Health checks: HTTP, TCP, or custom program

A Mesos Datacenter Developer…

Page 16: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets notified of failed tasks

16

TaskStatus {

task_id: “dispatch.45b70272-d88c-11e4-98ef-a689777343be”,

state: TASK_FAILED,

source: SOURCE_SLAVE,

reason: REASON_COMMAND_EXECUTOR_FAILED,

message: “Command exited with status 1”

}

A Mesos Datacenter Developer…

Page 17: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets notified when tasks run out of memory

17

TaskStatus {

task_id: “dispatch.45b70272-d88c-11e4-98ef-a689777343be”,

state: TASK_FAILED,

source: SOURCE_SLAVE,

reason: REASON_MEMORY_LIMIT,

message: “Task exceeded its memory limit” // TODO: MESOS-2035

}

A Mesos Datacenter Developer…

Page 18: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets notified of failing machines

18

TaskStatus {

task_id: “dispatch.45b70272-d88c-11e4-98ef-a689777343be”,

state: TASK_LOST,

source: SOURCE_MASTER,

reason: REASON_SLAVE_DISCONNECTED,

message: “Slave disconnected”

}

A Mesos Datacenter Developer…

Page 19: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets easy access to logs

19

$ mesos tail -f poseidon.* ==>poseidon.4729069a-d87d-11e4-8cee-f20d55470486:stdout<== [2015-04-07 19:37:23,842] INFO 104.236.41.240 - - [07/Apr/2015:19:37:23 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:37:33,915] INFO 104.236.41.240 - - [07/Apr/2015:19:37:33 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:37:43,877] INFO 104.236.41.240 - - [07/Apr/2015:19:37:43 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:38:44,037] INFO 104.236.41.240 - - [07/Apr/2015:19:38:43 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:38:54,004] INFO 104.236.41.240 - - [07/Apr/2015:19:38:53 +0000] "GET /ping HTTP/1.1" ==>poseidon.15bb96b9-d63a-11e4-93c0-f6e64c94ec3c:stdout<== [2015-04-07 19:37:23,905] INFO 104.236.41.240 - - [07/Apr/2015:19:37:23 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:37:33,891] INFO 104.236.41.240 - - [07/Apr/2015:19:37:33 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:37:43,924] INFO 104.236.41.240 - - [07/Apr/2015:19:37:43 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:38:44,022] INFO 104.236.41.240 - - [07/Apr/2015:19:38:43 +0000] "GET /ping HTTP/1.1" [2015-04-07 19:38:54,042] INFO 104.236.41.240 - - [07/Apr/2015:19:38:53 +0000] "GET /ping HTTP/1.1"

A Mesos Datacenter Developer…

Page 20: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… gets powerful resource monitoring

20

$ curl http://localhost:5051/monitor/statistics.json { "statistics": { "cpus_limit": 0.35, "cpus_nr_periods": 520883, "cpus_nr_throttled": 2163, "cpus_system_time_secs": 154.42, "cpus_throttled_time_secs": 145.96, "cpus_user_time_secs": 258.74, "mem_anon_bytes": 109137920, "mem_file_bytes": 30613504, "mem_limit_bytes": 167772160, "mem_mapped_file_bytes": 8192,

A Mesos Datacenter Developer…

Page 21: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… can run her apps next to the data

21

Data-heavy applications can run where the data is stored.

A Mesos Datacenter Developer…

Page 22: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… programs against a whole datacenter

22

Virtual memory: no longer program against physical addresses

Mesos: no longer program against machines, but the whole datacenter

Apps can allocate more resources on existing machines or populate new ones via an API

A Mesos Datacenter Developer…

Page 23: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… can build her own cluster scheduler easily

23

Linux: Completely Fair Scheduler (CFS) for process scheduling, maximizes utilization and performance

Mesos: Dominant Resource Fairness (DRF), two level schedulerProvides fair resource allocation while allowing applications to implement their own specialized schedulers

A Mesos Datacenter Developer…

Page 24: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

… has more time to focus on her application

24

Scheduler, Executor, Task, FrameworkMessage are high level APIs that abstract the plumbing.

Developers only need to know which resources they need, not where they are.

Developers can focus on their application instead of solving hard low level distributed systems problems.

A Mesos Datacenter Developer…

Page 25: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Projects built on top of Mesos

25

Page 26: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Apache Projects ported to Mesos

26

Storm

Cassandra

Kafka

Myriad (YARN)

Page 27: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Other Projects ported to Mesos

27

Jenkins

Kubernetes

ElasticSearch

Page 28: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Projects based on Mesos

28

Apache Aurora

Apache Spark

ArangoDB

Condor

Crate.IO

Marathon

Chronos

Page 29: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

An Example

29

Page 30: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Anatomy of a Web App

Millions of users

Lots of data

Data products

Twitter

30

Page 31: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Anatomy of a Web App

31

Frontend App

Database

QueueStreaming Analytics

Batch Analytics

Data Product

Tweets

ClicksTrends

Who to follow

Page 32: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Anatomy of a Web App - entirely on Mesos

32

App + Marathon

Cassandra

Kafka Storm

Spark

Custom Framework

Tweets

ClicksTrends

Who to follow

Page 33: Datacenter Developer (WIP) - events.static.linuxfound.org · A Mesos Datacenter Developer ... Anatomy of a Web App 31 Frontend App Database Queue ... Akka/Scala:

© 2015 Mesosphere, Inc.

Become a Datacenter Developer!

33

Mesos Docs: https://mesos.apache.org/documentation/latest/

RENDLER: https://github.com/mesosphere/RENDLER

Go: https://github.com/mesos/mesos-go

Akka/Scala: https://github.com/drexin/akka-mesos

Clojure: https://github.com/dgrnbrg/clj-mesos