operating microservices @unterstein @dcos @bedcon...

Post on 18-Mar-2018

219 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Operating microservices with Apache Mesos and DC/OS

@unterstein @dcos @bedcon #bedcon

© 2017 Mesosphere, Inc. All Rights Reserved. 2

Johannes UntersteinSoftware Engineer @Mesosphere

@unterstein

@unterstein.mesosphere

© 2016 Mesosphere, Inc. All Rights Reserved. 3

In the beginning there was a big

Monolith

© 2016 Mesosphere, Inc. All Rights Reserved.

Hardware

Operating System

Application

4

COMPUTERS

© 2016 Mesosphere, Inc. All Rights Reserved.

Hardware

Operating System

Web Application

5

INTERNET- Remote Users!

© 2016 Mesosphere, Inc. All Rights Reserved.

Web App

Hardware

Operating System

6

DISTRIBUTION- Horizontal Scale- Fault Tolerance- Availability- Load Balancing

Operating System

Operating System

Hardware Hardware

Web App Web App

© 2016 Mesosphere, Inc. All Rights Reserved.

Service Service Service

Web App Web App Web App

Hardware

Operating System

7

SERVICE-ORIENTEDARCHITECTURE

- Separation of concerns

- Optimization of bottlenecks

- Smaller teams- API Contracts- Data replication- Complicated

provisioning- Dependency

management

Operating System

Operating System

Hardware Hardware

© 2016 Mesosphere, Inc. All Rights Reserved.

Service Service Service

Web App Web App Web App

Machine

Operating System

8

HARDWAREVIRTUALIZATION

- Fast provisioning- Isolation- Portability- Utilization- Configuration

Management- Virtual Networking- Credential

management

Operating System

Operating System

Infrastructure

Machine Machine

© 2016 Mesosphere, Inc. All Rights Reserved.

Operating System

Operating System

Operating System

ServiceApp ServiceServiceAppApp

9

MICROSERVICES- Polyglot- Single Responsibility- Smaller Teams- Utilization- Machine

types/groups- Dependency hell

Machine

Infrastructure

Machine Machine

ServiceService ServiceServiceServiceService

© 2016 Mesosphere, Inc. All Rights Reserved.

noun | ˈmīkrō/ /ˈsərvəs/ :

an approach to application development in which a large application is built as a suite of modular services. Each module supports a specific business goal and uses a simple, well-defined interface to communicate with other modules.*

Microservices are designed to be flexible, resilient, efficient, robust, and individually scalable.

*From whatis.com

OVERVIEW

© 2016 Mesosphere, Inc. All Rights Reserved.

Operating System

Operating System

Operating System

ServiceApp ServiceServiceAppApp

11

MICROSERVICES- Polyglot- Single Responsibility- Smaller Teams- Utilization- Machine

types/groups- Dependency hell

Machine

Infrastructure

Machine Machine

ServiceService ServiceServiceServiceService

Run everything in containers!

© 2016 Mesosphere, Inc. All Rights Reserved.

ServiceApp ServiceServiceAppApp

OS

13

CONTAINERS- Rapid deployment- Dependency

vendoring- Container image

repositories- Spreadsheet

scheduling

OS OS

Machine

Infrastructure

Machine Machine

Container Runtime Container Runtime Container Runtime

ServiceService ServiceServiceServiceService

© 2016 Mesosphere, Inc. All Rights Reserved.

CONTAINER SCHEDULING

14

© 2016 Mesosphere, Inc. All Rights Reserved.

RESOURCE MANAGEMENT

15

© 2016 Mesosphere, Inc. All Rights Reserved.

SERVICE MANAGEMENT

16

© 2016 Mesosphere, Inc. All Rights Reserved. 17

CONTAINERSCHEDULING

RESOURCE MANAGEMENT

SERVICE MANAGEMENT

- Load Balancing- Readiness Checking

CONTAINER ORCHESTRATION

© 2016 Mesosphere, Inc. All Rights Reserved. 18

CONTAINERSCHEDULING

- Placement- Replication/Scaling- Resurrection- Rescheduling- Rolling Deployment- Upgrades- Downgrades- Collocation

RESOURCE MANAGEMENT

- Memory- CPU- GPU- Volumes- Ports- IPs- Images/Artifacts

SERVICE MANAGEMENT

- Labels- Groups/Namespaces- Dependencies- Load Balancing- Readiness Checking

CONTAINER ORCHESTRATION

© 2016 Mesosphere, Inc. All Rights Reserved.

Orc

hest

ratio

n

19

Machine Infrastructure

Web Apps & Services

Scheduling

Resource Management

Container Runtime

Machine & OS

Service Management

CONTAINERORCHESTRATION

Machine & OS Machine & OS

Container Runtime Container Runtime

© 2016 Mesosphere, Inc. All Rights Reserved. 20

MapReduce is crunching Data

Meanwhile...

© 2017 Mesosphere, Inc. All Rights Reserved. 21

DATA PROCESSING AT HYPERSCALE

EVENTSUbiquitous data streams from connected devices

INGEST

Apache Kafka

STORE

Apache Spark

ANALYZE

Apache Cassandra

ACT

Akka

Ingest millions of events per second

Distributed & highly scalable database

Real-time and batch process data

Visualize data and build data driven applications

DC/OS

Sensors

Devices

Clients

© 2017 Mesosphere, Inc. All Rights Reserved. 22

DATA PROCESSING AT HYPERSCALE

EVENTSUbiquitous data streams from connected devices

INGEST

Apache Kafka

STORE

Apache Spark

ANALYZE

Apache Cassandra

ACT

Akka

Ingest millions of events per second

Distributed & highly scalable database

Real-time and batch process data

Visualize data and build data driven applications

DC/OS

Sensors

Devices

Clients

© 2017 Mesosphere, Inc. All Rights Reserved. 23

● Apache Storm● Apache Spark● Apache Samza● Apache Flink● Apache Apex● Concord● cloud-only: AWS Kinesis,

Google Cloud Dataflow

STREAM PROCESSING

© 2017 Mesosphere, Inc. All Rights Reserved. 24

Micro-Batching

EXECUTION MODEL

Native Streaming

© 2017 Mesosphere, Inc. All Rights Reserved. 25

DATA PROCESSING AT HYPERSCALE

EVENTSUbiquitous data streams from connected devices

INGEST

Apache Kafka

STORE

Apache Spark

ANALYZE

Apache Cassandra

ACT

Akka

Ingest millions of events per second

Distributed & highly scalable database

Real-time and batch process data

Visualize data and build data driven applications

DC/OS

Sensors

Devices

Clients

© 2017 Mesosphere, Inc. All Rights Reserved. 26

Datastores

© 2017 Mesosphere, Inc. All Rights Reserved. 27

Key-Value

Data Model

GraphRelational Document● Schema● SQL ● Foreign

Keys/Joins● OLTP/OLAP

● Simple● Scalable● Cache

FilesTime-Series● Complex

relations● Social Graph● Recommend

ation● Fraud

detections

● Schema-Less● Semi-structu

red queries● Product

catalogue● Session data

© 2016 Mesosphere, Inc. All Rights Reserved. 28

Modern datacenter

Flink Cassandra µServices Spark RDB

Flink Cassandra µServices Spark RDB

© 2016 Mesosphere, Inc. All Rights Reserved. 31

A naive approach to handling varied app requirements: static partitioning.

Maintaining sufficient headroom to handle peak workloads on all partitions leads to poor utilization overall.

KEEP IT STATIC

time

© 2016 Mesosphere, Inc. All Rights Reserved. 32

Multiple frameworks can use the same cluster resources, with their share adjusting dynamically.

SHARED RESOURCES

time

© 2016 Mesosphere, Inc. All Rights Reserved. 33

SILOS OF DATA, SERVICES, USERS, ENVIRONMENTS

Typical Datacentersiloed, over-provisioned servers,

low utilization

Modern Datacenterautomated schedulers, workload multiplexing onto the

same machines

Industry Average12-15% utilization

Multiplexing30-40% utilization, more at some users

4X

mySQL

microservices

Cassandra

Spark/Hadoop

Kafka

© 2016 Mesosphere, Inc. All Rights Reserved. 34

© 2016 Mesosphere, Inc. All Rights Reserved. 35

THE BIRTH OF MESOS

TWITTER TECH TALKThe grad students working on Mesos

give a tech talk at Twitter.

March 2010

APACHE INCUBATIONMesos enters the Apache Incubator.

Spring 2009

CS262BBen Hindman, Andy Konwinski and

Matei Zaharia create “Nexus” as their CS262B class project.

MESOS PUBLISHEDMesos: A Platform for Fine-Grained

Resource Sharing in the Data Center is published as a technical report.

September 2010

December 2010

DC/OS

April 2016

© 2016 Mesosphere, Inc. All Rights Reserved.

• A top-level Apache project• A cluster resource

negotiator• Scalable to 10,000s of

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

36

Apache Mesos

© 2016 Mesosphere, Inc. All Rights Reserved. 37

ARCHITECTUREMESOS FUNDAMENTALS

© 2016 Mesosphere, Inc. All Rights Reserved. 38

● Default Sandbox

Simple to use, Task failures

● Persistent Volumes

Task failures, (permanent) Node failures

● Distributed File System/External Storage

Node failures, non-local writes

STORAGE OPTIONS

© 2017 Mesosphere, Inc. All Rights Reserved. 39

Datacenter Operating System (DC/OS)

Distributed Systems Kernel (Mesos)

DC/OS ENABLES MODERN DISTRIBUTED APPS

Big Data + Analytics EnginesMicroservices (in containers)

Streaming

Batch

Machine Learning

Analytics

Functions & Logic

Search

Time Series

SQL / NoSQL

Databases

Modern App Components

Any Infrastructure (Physical, Virtual, Cloud)40

41

THEBASICS

DC/OS is … ● 100% open source (ASL2.0)

+ A big, diverse community● An umbrella for ~30 OSS projects

+ Roadmap and designs+ Docs, tutorials, setup installations..+ Check https://dcos.io

● Familiar, with more features+ Networking, Security, CLI, UI,

Service Discovery, Load Balancing, Packages, ...

© 2016 Mesosphere, Inc. All Rights Reserved. 42

Best Practices

© 2016 Mesosphere, Inc. All Rights Reserved. 43

● Deployment● Service Discovery● Monitoring● Logging

GOING TO PRODUCTION

© 2016 Mesosphere, Inc. All Rights Reserved. 44

DEPLOYMENTBEST PRACTICES

● Version configurations● Private registries● Resource limits● Make it HA

© 2016 Mesosphere, Inc. All Rights Reserved.

● Dynamic ports● Virtual IPs● DNS● Overlay networks● External tools

45

SERVICE DISCOVERYBEST PRACTICES

© 2016 Mesosphere, Inc. All Rights Reserved.

● Application metrics● Health checks● Alerting● Aggregate logs● Consistent service logs

46

MONITORING & LOGGINGBEST PRACTICES

© 2017 Mesosphere, Inc. All Rights Reserved. 47

Questions?

Code: https://git.io/v1DjV https://git.io/vXUoy@unterstein

github.com/unterstein

@mesosphere / mesosphere.com@dcos / dcos.io / chat.dcos.io

top related