services on dc/os (v2.0) running database - percona · 2018-04-27 · open source technologies with...

31
Gabriel Ciciliani - April 24th, 2018 Running database services on DC/OS (v2.0)

Upload: others

Post on 20-May-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

Gabriel Ciciliani - April 24th, 2018

Running database services on DC/OS (v2.0)

Page 2: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

AGENDA

© 2017 Pythian. Confidential 2

- A fairly brief introduction to DC/OS

- Stateful services

- What we did

- Q&A

Page 3: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 3

A fairly brief introduction to DC/OS

Page 4: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

DC/OS is basically a distributed operating system based on Apache Mesos

Page 5: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 5

A fairly brief introduction to DC/OS

Page 6: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 6

A fairly brief introduction to DC/OS

Page 7: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 7

A fairly brief introduction to DC/OS

Page 8: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 8

A fairly brief introduction to DC/OS

SchedulerMesos master process

Mesos agent Executor “Task”

Page 9: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 9

The scheduler will not only take care of launching service’s tasks, but also restarting, migrating and terminating them

A fairly brief introduction to DC/OS

Page 10: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 10

● Custom Scheduler and/or executor (framework)

● Service-specific scheduling needs

● Custom executors will launch app-specific processes

● Netflix’s Titus, Apple’s J.A.R.V.I.S., Uber’s cassandra framework

● Default Scheduler and executors

A fairly brief introduction to DC/OS

Page 11: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 11

A fairly brief introduction to DC/OS

SchedulerMesos master process

Mesos agent Executor “Task”

Mesos master process

Mesos agent

Docker executor

Page 12: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 12

● Apps could be deployed from:

● Public package repository (Mesosphere Universe)

● Private package repository (Local Universe)

● Public docker registry (ie. Docker Hub)

● Private registry

A fairly brief introduction to DC/OS

Page 13: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

13© The Pythian Group Inc., 2018

13

Some of this reminds me to Kubernetes..

Page 14: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 14

DC/OS and Kubernetes

Page 15: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 15

DC/OS and Kubernetes

Page 16: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 16

DC/OS and Kubernetes

DC/OS K8s

Package repository ✓ ✓(Lower integration)

VIPs and load balancing ✓ ✓

Persistent internal and external volumes ✓ ✓

Web GUI ✓ ✓

Container agnostic ✓ ✓

Pods ✓ ✓

Page 17: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 17

DC/OS and KubernetesDC/OS K8s

Secrets store ✓(Enterprise only)

Jobs ✓ ✓

Autoscaling ✓(Lower integration)

Page 18: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 18

Ok, but how’s DC/OS different from Kubernetes

-Kubernetes is also container agnostic, although most people uses docker-Kubernetes also have node agents (kubelet)-Not using rexray apparently (for the GCE deployment)

DC/OS offers:- Secret store passing to containers- Pods- cron containers (jobs)- load balancing- auto-scaling (both containers and underlying infra)- RBAC for deployments/UI- private container image repo- built in REX-ray to transfer container data across slaves.

-Is there a way to create an auto-scaling policy on dc/os?Yes, and zero downtime upgrade policies

kube has this `- built in REX-ray to transfer container data across slaves.`not sure if it's rexray though but I tested a MySQL service using external volumes and it was transparently migrated upon node failure

Bill Fraser [12:36 PM]k8s has secrets and pods and load balancing and scaling and RBACalso DNS

John Laham [12:37 PM]DNS < == > Service Discovery

Bill Fraser [12:38 PM]there is kube-dns for container resolution within cluster, and there are mechanisms for integrating with external DNS (like route53) as well (edited)

Page 19: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 19

Stateful services

Page 20: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 20

● Storage needs to be persistent

● Data needs to be available on any slave node

● Automatic scaling (up or down)

Stateful services - challenges

Page 21: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 21

● Non-persistent storage (local and ephemeral)

● Persistent storage (local)

● External persistent storage (non-local)

● Non-persistent storage (local and ephemeral)

● Persistent storage (local)

● External persistent storage (non-local)

Stateful services - storage options in DC/OS

Page 22: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 22

● Resource requirements cannot be changed (cpu, memory, storage)

● External persistent volumes are not removed when a service is scaled down or removed. Also, Local persistent volumes may need to be wiped out before reusing them

● Absolute or relative mount points with “/” require a workaround

Stateful services - DC/OS limitations

Page 23: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 23

What we did

Page 24: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 24

What we did

Requirements:

● Highly available MySQL services on DC/OS

● InnoDB only

● Ability to scale up

● Ability to scale out too

Page 25: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 25

What we did

Three DC/OS services:

● PXC, running three tasks/containers/mysqld instances

● Marathon load balancer (aka HAProxy)

● etcd for PXC metadata *

* based on Vadim Tkachenko PXC docker image in DockerHub

Page 26: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 26

● No Universe app available to deploy PXC on DC/OS nativelyWe created a customized private image in DockerHub

● Storage needs to be persistentExternal persistent volumes

● Data needs to be replicated across slave nodes when scalingPXC SST

What we did

Page 27: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 27

● Data needs to follow you container REXRay + EBS

● Resource requirements cannot be changed (cpu, memory, storage)Spawn a new service (cluster) and manipulate etcd metadata to replicate from the existing cluster

What we did

Page 28: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 28

Conclusions

Page 29: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 29

● DC/OS is an innovative solution to distribute apps and services across your infrastructure (cloud or on-premises)

● DC/OS is complex under the hood, and it integrates several different open source technologies with Apache Mesos.

● It’s feasible to run database services on DC/OS but a few things need to be considered first, specially with RDBMS

● PXC integrates very well with this model, as it handles replication, cluster membership and recovery.

Conclusions

Page 30: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 30

Page 31: services on DC/OS (v2.0) Running database - Percona · 2018-04-27 · open source technologies with Apache Mesos. It’s feasible to run database services on DC/OS but a few things

© 2017 Pythian. Confidential 31

THANK YOU!Gabriel CicilianiInternal Principal [email protected]@gabocic