emc world 2016 - deep dive with mesos and persistent storage for applications

45
1 © Copyright 2016 EMC Corporation. All rights reserved.

Upload: david-vonthenen

Post on 22-Mar-2017

11 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

1© Copyright 2016 EMC Corporation. All rights reserved.

Page 2: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

2© Copyright 2016 EMC Corporation. All rights reserved. 2© Copyright 2016 EMC Corporation. All rights reserved.

DEEP DIVE WITH MESOS & PERSISTENT STORAGE FOR APPLICATIONSDAVID VONTHENEN, EMC {code}

Page 3: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

3© Copyright 2016 EMC Corporation. All rights reserved.

• David vonThenen, Developer Advocate - EMC {code}– Twitter: @dvonthenen– Blog: http://dvonthenen.com– Github: https://github.com/dvonthenen

PRESENTER

Page 4: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

4© Copyright 2016 EMC Corporation. All rights reserved.

• Quick Review of Mesos• Frameworks and Two Layer Scheduling• Production Applications• Demo• Q&A

AGENDA

Page 5: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

5© Copyright 2016 EMC Corporation. All rights reserved. 5© Copyright 2016 EMC Corporation. All rights reserved.

QUICK REVIEW OF MESOS

Page 6: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

6© Copyright 2016 EMC Corporation. All rights reserved.

• From a resource perspective, it’s a cluster manager:– Pools resources to be centrally managed as a single unit

• From an application perspective, it’s a scheduler:– Dispatches workloads to consume pooled resources

• Often described as a Data Center Operating System (DCOS)– Static versus Dynamic Partition of Resource– Efficient utilization of CPU, Memory, Disk

• Proven resource scheduler for production workloads

QUICK REVIEW OF MESOS

Page 7: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

7© Copyright 2016 EMC Corporation. All rights reserved.

SCHEDULERS ARE DIFFICULT TO BUILD

Page 8: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

8© Copyright 2016 EMC Corporation. All rights reserved.

• Master– Manages Mesos Agents– Enables fine-grained sharing of resources (CPU, RAM, …)

across frameworks in the form of resource offers.• Zookeeper

– Enables highly reliable distributed coordination (cluster state)

• Agent (aka Slave)– The entity that will be running the task

MESOS COMPONENTS

Page 9: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

9© Copyright 2016 EMC Corporation. All rights reserved.

MESOS ARCHITECTURE

Page 10: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

10© Copyright 2016 EMC Corporation. All rights reserved.

• Generic– Anything that can be run on a standard Linux shell– Provides a mechanism for deploying applications packages– Supports Docker workloads

• Framework– A plug-in to Mesos that allows you to implement a sub-

scheduler– specialize a workload by providing custom placement and

resource allocation

APPLICATION SUPPORT

Page 11: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

11© Copyright 2016 EMC Corporation. All rights reserved.

GENERIC APPLICATIONS

Page 12: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

12© Copyright 2016 EMC Corporation. All rights reserved. 12© Copyright 2016 EMC Corporation. All rights reserved.

FRAMEWORKS ANDTWO LAYER SCHEDULING

Page 13: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

13© Copyright 2016 EMC Corporation. All rights reserved.

• On the surface…• Allows specialization of

workload by providing custom placement and resource allocation• Provides monitoring of

these workloads to protect and react when things fail

MESOS FRAMEWORK

Page 14: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

14© Copyright 2016 EMC Corporation. All rights reserved.

• Scheduler– a scheduler that registers with the master to be offered

resources• Executor

– an executor process that is launched on slave nodes to run the framework’s tasks

FRAMEWORK COMPONENTS

Page 15: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

15© Copyright 2016 EMC Corporation. All rights reserved.

FRAMEWORK ARCHITECTURE

Page 16: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

16© Copyright 2016 EMC Corporation. All rights reserved.

FRAMEWORK ARCHITECTURE

Page 17: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

17© Copyright 2016 EMC Corporation. All rights reserved.

• Odds are you have been using at least 1 framework without realizing it…

AS IT TURNS OUT…

• Marathon is a framework– A framework for performing container

orchestration for long running tasks• Chronos is a framework

– A framework for performing batch or scheduled tasks

Page 18: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

18© Copyright 2016 EMC Corporation. All rights reserved.

• Zooming into the “Marathon” box…• Marathon is a Scheduler• Launching a Marathon task, the “generic”

applications are created inside a “generic” (or default) executor• Dogfooding!

MARATHON DISSECTED

Page 19: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

19© Copyright 2016 EMC Corporation. All rights reserved.

MESOS FRAMEWORKS

Page 20: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

20© Copyright 2016 EMC Corporation. All rights reserved.

• 2 layer scheduling or sub-scheduling of resources• Manages the lifecycle of your

workload through application specific monitoring• What does this mean

specifically?

DIGGING DEEPER

Page 21: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

21© Copyright 2016 EMC Corporation. All rights reserved.

BUILDING HADOOP CLUSTERS

Page 22: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

22© Copyright 2016 EMC Corporation. All rights reserved.

MANAGING HADOOP CLUSTERS

Page 23: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

23© Copyright 2016 EMC Corporation. All rights reserved.

APPLICATIONS USING HADOOP

Page 24: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

24© Copyright 2016 EMC Corporation. All rights reserved.

THIS SEEMS SILLY

Page 25: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

25© Copyright 2016 EMC Corporation. All rights reserved.

• Allows you to subsume the default scheduler such that:• You can install and configure your application• Resources can be allocated in a way that optimizes

your applications• Allows operation real-time automated improvements

for your applications– Scaling up for load balancing peak times– Scaling back to free up resources

2 LAYER SCHEDULING

Page 26: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

26© Copyright 2016 EMC Corporation. All rights reserved.

• The details of your applications are hidden from the end user!– Deployment– Operations– Growth– Disaster recovery– Performance

• Just a consumer of the application as a service!

THE NON-TECHNICAL VERSION

Page 27: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

27© Copyright 2016 EMC Corporation. All rights reserved.

• CouchBase Framework (doesn’t exist, let’s imagine it does)– CouchBase is a NoSQL DB

• Monitor the CouchBase instances, when nearing full– Dynamically add an node using “server-add”– Then call “rebalance”

• Reactive and Proactive but fully automated• I think we had all seen this movie…

FOR EXAMPLE

Page 28: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

28© Copyright 2016 EMC Corporation. All rights reserved.

SKYNET

Page 29: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

29© Copyright 2016 EMC Corporation. All rights reserved. 29© Copyright 2016 EMC Corporation. All rights reserved.

PRODUCTION APPLICATIONS

Page 30: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

30© Copyright 2016 EMC Corporation. All rights reserved.

• Containers are ephemeral therefore stateless• Quickly found the need for state

– Configuration– Data– Logging / Auditing

• Containerizers like Mesos and Docker introduced exporting to local storage• Failure of a node? hardware? A better way?

EVOLUTION OF STATEFUL

Page 31: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

31© Copyright 2016 EMC Corporation. All rights reserved.

• Persistent– Containers can come and go,

but continue where they left off– Application Data, Logs, Audit

Trail, etc• External

– Storage lives outside the Mesos Agent node

– High Availability– Tolerates node failure

PERSISTENT EXTERNAL STORAGE

Page 32: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

32© Copyright 2016 EMC Corporation. All rights reserved.

• REX-Ray– Provides a vendor agnostic storage orchestration engine– AWS, GCE, ScaleIO, XtremIO, many many more– Github: https://github.com/emccode/rexray

• mesos-module-dvdi– Provides a hook to Mesos agent nodes to provision, attach,

and detach external storage– Github: https://github.com/emccode/mesos-module-dvdi

HOW WE ACHIEVE THIS?

Page 33: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

33© Copyright 2016 EMC Corporation. All rights reserved.

• We can run “real world” applications• Persistence – DBs• Highly Available, Fault Tolerant• Audit trail – Transaction Logs• Not worry about the “2am call”

STATELESS TO STATEFUL

Page 34: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

34© Copyright 2016 EMC Corporation. All rights reserved.

LET’S FACE IT…

Page 35: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

35© Copyright 2016 EMC Corporation. All rights reserved.

• Trouble is… this still represents the “old way” of thinking• PREVENT THE CRASH OR FAILURE!• Problem is you can’t• What is the alternative?

STATEFUL 2.0?

Page 36: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

36© Copyright 2016 EMC Corporation. All rights reserved.

• Mesos frameworks can proactively monitor for thing going sideways• Leveraging external persistent storage and

frameworks fail fast and recover quicker!• Skynet!

FRAMEWORKS + STATEFUL 2.0

Page 37: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

37© Copyright 2016 EMC Corporation. All rights reserved. 37© Copyright 2016 EMC Corporation. All rights reserved.

DEMO

Page 38: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

38© Copyright 2016 EMC Corporation. All rights reserved.

• Running on Amazon EC2– Mesos– Marathon– Mesos DNS

• Production HA Cluster– 3 x Master + Zookeeper Nodes (t2.micros)– 5 x Slave Nodes with Docker Support (t2.medium)

DEMO CONFIGURATION

Page 39: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

39© Copyright 2016 EMC Corporation. All rights reserved.

• Elastic Search Framework– Create and mount external volume– Pour some data into Elastic Search– Github: https://github.com/mesos/elasticsearch

• Elastic Search Instances backed by Persistent External Storage– Using REX-Ray– Using mesos-module-dvdi

DEMO: FRAMEWORK + EXTERNAL STORAGE

Page 40: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

40© Copyright 2016 EMC Corporation. All rights reserved.

• Deploy Elastic Search Framework using REST API– Observe Scheduler creation– Using browser, log into the Elastic Search Framework UI– Observe Executor nodes get created and attaching to EBS

volumes• Simulate Failure

– Kill EC2 Instance– Watch executor recreation and reattach to EBS volumes

DEMO: FRAMEWORK + EXTERNAL STORAGE

Page 41: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

41© Copyright 2016 EMC Corporation. All rights reserved.

DEMO: AUTO DEPLOY ELASTIC SEARCH

Page 42: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

42© Copyright 2016 EMC Corporation. All rights reserved.

Data Persistence in the New Container WorldWednesday 3PM

Joshua BernsteinVP of Technology for ETD

Tobi Knaup CEO & Co-Founder of Mesosphere

Guru Session

Page 43: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

43© Copyright 2016 EMC Corporation. All rights reserved.

@EMCcode@dvonthenen

emccode.comcommunity.emccode.com

Come visit us at Booth #1044 or in the vLab

Questions?

Page 44: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications

44© Copyright 2016 EMC Corporation. All rights reserved. 44© Copyright 2016 EMC Corporation. All rights reserved.

Page 45: EMC World 2016 - Deep Dive with Mesos and Persistent Storage for Applications