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

Post on 18-Mar-2018

221 Views

Category:

Documents

2 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

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

@unterstein @joerg_schad @dcos @jaxdevops

© 2016 Mesosphere, Inc. All Rights Reserved. 2

Jörg SchadDistributed Systems Engineer

@joerg_schad

Johannes UntersteinDistributed Applications Engineer

@unterstein

© 2017 Mesosphere, Inc. All Rights Reserved. 3

In the beginning there was a big

Monolith

© 2017 Mesosphere, Inc. All Rights Reserved.

Hardware

Operating System

Application

4

COMPUTERS

© 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

© 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

© Gerard Julien/AFP

Run everything in containers!

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 9

Demo 1Chuck Norris Jokes via HTTP

Code @https://git.io/vXUoy

© 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

© 2017 Mesosphere, Inc. All Rights Reserved.

CONTAINER SCHEDULING

11

© 2017 Mesosphere, Inc. All Rights Reserved.

RESOURCE MANAGEMENT

12

© 2017 Mesosphere, Inc. All Rights Reserved.

SERVICE MANAGEMENT

13

© 2017 Mesosphere, Inc. All Rights Reserved. 14

CONTAINERSCHEDULING

RESOURCE MANAGEMENT

SERVICE MANAGEMENT

- Load Balancing- Readiness Checking

CONTAINER ORCHESTRATION

© 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

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 17

MapReduce is crunching Data

Meanwhile...

© 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

© 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

© 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

© 2016 Mesosphere, Inc. All Rights Reserved. 21

Micro-Batching

EXECUTION MODEL

Native Streaming

© 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

Datastores

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 25

Datacenter

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 27

© 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

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 30

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

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, ...

33

34

THEUNIVERSE

35

© 2017 Mesosphere, Inc. All Rights Reserved. 36

Demo 2Scaling DC/OS with Chuck Norris

Code @https://git.io/vXUoy

© 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

© 2016 Mesosphere, Inc. All Rights Reserved. 38

DC/OS SDKFor Stateful Services

© 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

© 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

© 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

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 43

Keep it running!

© 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

© 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

© 2017 Mesosphere, Inc. All Rights Reserved. 46

Questions?

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

http://grnh.se/ie76ru

top related