container 2 - jax finance 2018 · pdf file- rapid deployment - dependency ... - spreadsheet...

46
1 Container 2.0 Container: check! But what about persistent data, big data or fast data?! @unterstein @joerg_schad @dcos @jaxdevops

Upload: vokhuong

Post on 18-Mar-2018

221 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

1

Container 2.0Container: check! But what about persistent data, big data or fast data?!

@unterstein @joerg_schad @dcos @jaxdevops

Page 2: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 2

Jörg SchadDistributed Systems Engineer

@joerg_schad

Johannes UntersteinDistributed Applications Engineer

@unterstein

Page 3: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 3

In the beginning there was a big

Monolith

Page 4: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

Hardware

Operating System

Application

4

COMPUTERS

Page 5: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 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

Page 6: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

Operating System

Operating System

Operating System

ServiceApp ServiceServiceAppApp

6

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

types/groups- Dependency hell

Machine

Infrastructure

Machine Machine

ServiceService ServiceServiceServiceService

Page 7: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© Gerard Julien/AFP

Run everything in containers!

Page 8: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

ServiceApp ServiceServiceAppApp

OS

8

CONTAINERS- Rapid deployment- Dependency

vendoring- Container image

repositories- Spreadsheet

scheduling

OS OS

Machine

Infrastructure

Machine Machine

Container Runtime Container Runtime Container Runtime

ServiceService ServiceServiceServiceService

Page 9: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 9

Demo 1Chuck Norris Jokes via HTTP

Code @https://git.io/vXUoy

Page 10: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

ServiceApp ServiceServiceAppApp

OS

10

CONTAINERS- Rapid deployment- Dependency

vendoring- Container image

repositories- Spreadsheet

scheduling

OS OS

Machine

Infrastructure

Machine Machine

Container Runtime Container Runtime Container Runtime

ServiceService ServiceServiceServiceService

Page 11: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

CONTAINER SCHEDULING

11

Page 12: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

RESOURCE MANAGEMENT

12

Page 13: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

SERVICE MANAGEMENT

13

Page 14: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 14

CONTAINERSCHEDULING

RESOURCE MANAGEMENT

SERVICE MANAGEMENT

- Load Balancing- Readiness Checking

CONTAINER ORCHESTRATION

Page 15: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 15

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

Page 16: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

Orc

hest

ratio

n

16

Machine Infrastructure

Web Apps & Services

Scheduling

Resource Management

Container Runtime

Machine & OS

Service Management

CONTAINERORCHESTRATION

Machine & OS Machine & OS

Container Runtime Container Runtime

Page 17: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 17

MapReduce is crunching Data

Meanwhile...

Page 18: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 18

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

Page 19: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 19

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

Page 20: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 20

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

Google Cloud Dataflow

STREAM PROCESSING

Page 21: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 21

Micro-Batching

EXECUTION MODEL

Native Streaming

Page 22: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 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

Page 23: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 23

Datastores

Page 24: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 24

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

Page 25: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 25

Datacenter

Page 26: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 26

NAIVE APPROACH

Typical Datacentersiloed, over-provisioned servers,

low utilization

Industry Average12-15% utilization

mySQL

microservice

Cassandra

Spark/Hadoop

Kafka

Page 27: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 27

Page 28: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 28

MULTIPLEXING OF DATA, SERVICES, USERS, ENVIRONMENTS

Typical Datacentersiloed, over-provisioned servers,

low utilization

Mesos, DC/OSautomated schedulers, workload multiplexing onto the

same machines

mySQL

microservice

Cassandra

Spark/Hadoop

Kafka

Page 29: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 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

29

Apache Mesos

Page 30: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 30

Page 31: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

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)31

Page 32: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

32

THEBASICS

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

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

+ Roadmap and designs+ Docs and tutorials

● Not limited in any way● Familiar, with more features

+ Networking, Security, CLI, UI, Service Discovery, Load Balancing, Packages, ...

Page 33: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

33

Page 34: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

34

THEUNIVERSE

Page 35: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

35

Page 36: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 36

Demo 2Scaling DC/OS with Chuck Norris

Code @https://git.io/vXUoy

Page 37: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 37

● Default Sandbox

Simple to use, Task failures

● Local Persistent Volumes

Task failures, (permanent) Node failures

● Distributed File System/External Storage

Node failures, non-local writes

Container Storage

Page 38: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 38

DC/OS SDKFor Stateful Services

Page 39: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 39

● a State Machine for each task:

● state kept in zookeeper

● framework runs event loop

● and handles state changes

State Machine on Mesos

Page 40: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 40

Simple things should be simple; complicated things should be complicated

~1,000 LOC

~100 LOC

10K+ LOC

● Simple YAML interface● Default, customizable behaviors● Most services probably fall here

● Need to be a service expert● Need to write a little Java code● Don’t need to understand DC/OS

● Can’t use the defaults● Don't mind writing a lot of Java ● Willing to understand DC/OS

CustomPlans & Strategies

Build Your Own Schedulerwith commons libraries

Defaults

Page 41: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 41

Simple things should be simple; complicated things should be complicated

~1,000 LOC

~100 LOC

10K+ LOC

● Simple YAML interface● Default, customizable behaviors● Most services probably fall here

● Need to be a service expert● Need to write a little Java code● Don’t need to understand DC/OS

● Can’t use the defaults● Don't mind writing a lot of Java ● Willing to understand DC/OS

CustomPlans & Strategies

Build Your Own Schedulerwith commons libraries

Defaults

Page 42: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved.

name: "helloworld"principal: "helloworld-principal"zookeeper: master.mesos:2181api-port: 8080pods: helloworld: count: 5 tasks: server: goal: RUNNING cmd: "echo hello world >> hello-container-path/output && sleep 1000" cpus: 1 mem: 256 volumes: - path: "hello-container-path" type: ROOT size: 5000

42

Hello-World: YAML

Page 43: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 43

Keep it running!

Page 44: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 44

Monitoring- Collecting metrics- Routing events- Downstream processing

- Alerting- Dashboards- Storage (long-term retention)

Logging- Scopes- Local vs. Central- Security considerations

Keep it running

Page 45: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2016 Mesosphere, Inc. All Rights Reserved. 45

Maintenance - Cluster Upgrades- Cluster Resizing- Capacity Planning- User & Package Management- Networking Policies- Auditing- Backups & Disaster Recovery

Troubleshooting- Debugging

- Services- System

- Tracing- Chaos Engineering

Keep it running

Page 46: Container 2 - JAX Finance 2018 · PDF file- Rapid deployment - Dependency ... - Spreadsheet scheduling OS OS Machine Infrastructure Machine Machine Container Runtime Container

© 2017 Mesosphere, Inc. All Rights Reserved. 46

Questions?

Code: https://git.io/vXUoyPsssssssst …… we are hiring!

http://grnh.se/ie76ru