35
1 © Copyright 2016 EMC Corporation. All rights reserved. 1 © Copyright 2016 EMC Corporation. All rights reserved. RUNNING STATEFUL SERVICES ON CLOUD NATIVE PLATFORMS WITH MESOS JONAS ROSLAND, EMC {code} DEVELOPER ADVOCATE & COMMUNITY MANAGER

EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

Embed Size (px)

Citation preview

Page 1: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

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

RUNNING STATEFUL SERVICES ON CLOUD NATIVE PLATFORMS WITH MESOSJONAS ROSLAND, EMC {code}DEVELOPER ADVOCATE & COMMUNITY MANAGER

Page 2: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

4© Copyright 2016 EMC Corporation. All rights reserved.

• How are Cloud Native Platforms managed?• Handling stateless apps and stateful services• Everything running in containers• Making the platforms understand data persistence

AGENDA

Page 3: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

5© Copyright 2016 EMC Corporation. All rights reserved.

• Clustered servers• Manual deployments• Redundancy, not necessarily high availability

BACK IN THE OLD DAYS

Page 4: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

6© Copyright 2016 EMC Corporation. All rights reserved.

• Infrastructure as a Service• Deploy virtual machines• Manual/half-automated way of deploying apps• Almost efficient

THEN SOME TIME AGO

Page 5: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

7© Copyright 2016 EMC Corporation. All rights reserved.

• Collection of compute resources• Spread out horizontally• Brings scale to your deployments

NOW – CLOUD NATIVE PLATFORMS

Page 6: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

8© Copyright 2016 EMC Corporation. All rights reserved.

Standard definitions

Page 7: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

9© Copyright 2016 EMC Corporation. All rights reserved.

PAAS SITS ON TOP OF SCHEDULERS

Page 8: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

10© Copyright 2016 EMC Corporation. All rights reserved.

• Manages all physical/virtualresources• Deploys and schedules apps• Handles hardware failures

RESOURCE MANAGERS AND SCHEDULERS

Page 9: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

11© Copyright 2016 EMC Corporation. All rights reserved.

SCHEDULING

Page 10: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

12© Copyright 2016 EMC Corporation. All rights reserved.

• Enables apps and infrato automatically findparts of each other• Keeps track of how to

connect and use theapplication services

SERVICE DISCOVERY

Page 11: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

13© Copyright 2016 EMC Corporation. All rights reserved.

SERVICE DISCOVERY

Java App

2.3.4.5:8080 Where isJava App?2.3.4.5:8080

Page 12: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

14© Copyright 2016 EMC Corporation. All rights reserved.

APPLICATIONS RUN IN CONTAINERS

Code Code andrequirements Container

Page 13: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

15© Copyright 2016 EMC Corporation. All rights reserved.

You don’t have torewrite your apps!

Page 14: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

16© Copyright 2016 EMC Corporation. All rights reserved.

• Storing data (state) is a critical component of any application• Where they store this state defines their class

– Connected database– In memory– Local disk

APPLICATION STATE DIFFERENCES

Page 15: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

17© Copyright 2016 EMC Corporation. All rights reserved.

• Store no critical data locally• Can be scaled as needed• Recovers quickly

STATELESS APPLICATIONS

Page 16: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

18© Copyright 2016 EMC Corporation. All rights reserved.

• Services that store state• Have usually been treated as HA apps• Can be scale-out or scale-up

STATEFUL SERVICES

Page 17: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

19© Copyright 2016 EMC Corporation. All rights reserved.

FROM oraclelinux:latest

ENV PACKAGE_URL https://repo.mysql.com/yum/mysql-5.7-community/docker/x86_64/mysql-community-server-minimal-5.7.12-1.el7.x86_64.rpm

RUN rpmkeys --import http://repo.mysql.com/RPM-GPG-KEY-mysql && yum install -y $PACKAGE_URL && yum install -y libpwquality && rm -rf /var/cache/yum/*

RUN mkdir /docker-entrypoint-initdb.d

VOLUME /var/lib/mysql

COPY docker-entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]

EXPOSE 3306 33060

CMD ["mysqld"]

MYSQL IN A CONTAINER

Page 18: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

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

APPLICATIONS BUILT FROM SERVICESFront End or Non-Persistent

Data Services (Persistent)

Scal

e-Up

Scale-Out

CassandraPostgresRedis CouchDB

Elastic SearchHadoop

MariaDB

Mysql

Nginx

HAProxy

MongoDB

RabbitMQTomcat

Memcached

ScaleIO ECS

ApacheRails

Language Specific HTTP

Page 19: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

21© Copyright 2016 EMC Corporation. All rights reserved.

• No!– Without proper storage mapped, the service will lose data– Data doesn’t travel with the service if it’s stored on local

disk• Yes!

– Automatically mapping modern storage backends such as ScaleIO, VMAX, XtremIO, Isilon and othersenables your data to be stored safely

STATEFUL SERVICES IN CONTAINERS?

Page 20: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

22© Copyright 2016 EMC Corporation. All rights reserved.

• Have been mostly focused on stateless apps• Working hard on making stateful services part of

their inventory• So how do you handle both types?

CLOUD NATIVE PLATFORMS

Page 21: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

23© Copyright 2016 EMC Corporation. All rights reserved.

• Data is stored outside the platform

EXAMPLE 1

Page 22: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

24© Copyright 2016 EMC Corporation. All rights reserved.

• Data is stored on the same platform

EXAMPLE 2

Page 23: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

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

Virtual Machine

PERSISTENCE AND P3

Platform 2 Platform 3

High Availability

Live Migration

Highly Available

Container Platform

Lifecycle Management

Container Platform

Lifecycle Management

Page 24: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

26© Copyright 2016 EMC Corporation. All rights reserved.

• Cloud native applications have no concept of local storage• They require state being stored somewhere else• So we need our platform to understand storage

CLOUD NATIVE APPS AND STORAGE

Page 25: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

27© Copyright 2016 EMC Corporation. All rights reserved.

Making the platformunderstand storage

Page 26: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

28© Copyright 2016 EMC Corporation. All rights reserved.

LET’S START WITH THE BASICS

GCE

?

AWSEMC OpenStack

Page 27: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

29© Copyright 2016 EMC Corporation. All rights reserved.

SAY HELLO TO MY LITTLE FRIEND – REX-RAY

Page 28: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

30© Copyright 2016 EMC Corporation. All rights reserved.

NOW WE’RE GETTING SOMEWHERE

GCEAWSEMC OpenStack

Page 29: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

31© Copyright 2016 EMC Corporation. All rights reserved.

AND NOW IT’S GETTING INTERESTING

GCEAWSEMC OpenStack

Mesos Kubernetes

Page 30: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

32© Copyright 2016 EMC Corporation. All rights reserved.

• Gives you the possibility to use any storage platform, and even multiple platforms at the same time• Always in sync with Docker’s development cycle• Integrated with Docker, Mesos and Kubernetes

REX-RAY BENEFITS

Page 31: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

33© Copyright 2016 EMC Corporation. All rights reserved.

How does Cloud Foundryand Mesos work together?

Page 32: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

35© Copyright 2016 EMC Corporation. All rights reserved.

• You already have your apps divided into stateless and stateful• Focus on your stateless apps first• Make real decisions to move from archaic master-

slave clusters• Move to new platforms to handle your old, new and

expanding apps

SUMMARY

Page 33: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

37© Copyright 2016 EMC Corporation. All rights reserved.

@EMCcode@jonasrosland

emccode.comcommunity.emccode.com

Questions?

Page 34: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos

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

Page 35: EMC World 2016 - code.16 Running Stateful Services on Cloud Native Platforms with Mesos