MySQL and Docker Strategies Patrick Galbraith Giuseppe Maxia

Similar documents
MySQL operations with Docker A quick guide for the uninitiated

MySQL operations in Docker. Giuseppe Maxia QA Architect VMware, Inc

CS-580K/480K Advanced Topics in Cloud Computing. Container III

Deployment Patterns using Docker and Chef

Kuber-what?! Learn about Kubernetes

SQL Server inside a docker container. Christophe LAPORTE SQL Server MVP/MCM SQL Saturday 735 Helsinki 2018

Virtual Infrastructure: VMs and Containers

DevOps Course Content

Running MarkLogic in Containers (Both Docker and Kubernetes)

Docker and Oracle Everything You Wanted To Know

개발자와운영자를위한 DevOps 플랫폼 OpenShift Container Platform. Hyunsoo Senior Solution Architect 07.Feb.2017

DevOps Technologies. for Deployment

Cloud & container monitoring , Lars Michelsen Check_MK Conference #4

/ Cloud Computing. Recitation 5 February 14th, 2017

Think Small to Scale Big

Travis Cardwell Technical Meeting

Midterm Presentation Schedule

Getting Started With Containers

Automation and Programmability using Cisco Open NXOS and DevOps Tools

DEVOPS TRAINING COURSE CONTENT

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

An Introduction to Kubernetes

OpenStack Magnum Hands-on. By Saulius Alisauskas and Bryan Havenstein

Docker und IBM Digital Experience in Docker Container

Important DevOps Technologies (3+2+3days) for Deployment

Continuous Integration using Docker & Jenkins

Arup Nanda VP, Data Services Priceline.com

Launching StarlingX. The Journey to Drive Compute to the Edge Pilot Project Supported by the OpenStack

ROBIN SYSTEMS. Containerizing Oracle: Not Thinking About It Yet? You Should Be!!!

Docker for Development: Getting Started

The age of orchestration

DevOps Workflow. From 0 to kube in 60 min. Christian Kniep, v Technical Account Manager, Docker Inc.

dbdeployer the future of MySQL sandboxes Giuseppe Maxia Software explorer

Using MySQL Containers

UP! TO DOCKER PAAS. Ming

Kubernetes made easy with Docker EE. Patrick van der Bleek Sr. Solutions Engineer NEMEA

Buenos Aires 31 de Octubre de 2018

Amir Zipory Senior Solutions Architect, Redhat Israel, Greece & Cyprus

Lightweight Containerization at Facebook

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

DevOps in the Cloud A pipeline to heaven?! Robert Cowham BCS CMSG Vice Chair

Dr. Roland Huß, Red

The four forces of Cloud Native

Orchestrating Docker containers at scale

Cloud I - Introduction

Convergence of VM and containers orchestration using KubeVirt. Chunfu Wen

CONTINUOUS DELIVERY WITH DC/OS AND JENKINS

Upcoming Services in OpenStack Rohit Agarwalla, Technical DEVNET-1102

Red Hat Atomic Details Dockah, Dockah, Dockah! Containerization as a shift of paradigm for the GNU/Linux OS

Installation Guide for Kony Fabric Containers Solution On-Premises

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Kubernetes 101. Doug Davis, STSM September, 2017

Brainstorm K Containerization with Docker. Crown Palm 2:30-3:30. Adam W Zheng Nebraska Educational Service Unit 10

Infoblox Kubernetes1.0.0 IPAM Plugin

The new Docker networking put into action to spin up a SLURM cluster

Docker II - Judgement Day

Infrastructure at your Service. Oracle over Docker. Oracle over Docker

ovirt and Docker Integration

Container-based virtualization: Docker

There's More to Docker than the Container The Docker Platform

Splunk N Box. Splunk Multi-Site Clusters In 20 Minutes or Less! Mohamad Hassan Sales Engineer. 9/25/2017 Washington, DC

/ Cloud Computing. Recitation 5 September 26 th, 2017

Using Network Virtualization in DevOps environments Yves Fauser, 22. March 2016 (Technical Product Manager VMware NSBU)

Logging, Monitoring, and Alerting

Full Scalable Media Cloud Solution with Kubernetes Orchestration. Zhenyu Wang, Xin(Owen)Zhang

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

agenda PAE Docker Docker PAE

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

Code: Slides:

Managing and Protecting Persistent Volumes for Kubernetes. Xing Yang, Huawei and Jay Bryant, Lenovo

Docker for HPC? Yes, Singularity! Josef Hrabal

Best Practices for Developing & Deploying Java Applications with Docker

How to Put Your AF Server into a Container

[Docker] Containerization

More Containers, More Problems

CNA1699BU Running Docker on your Existing Infrastructure with vsphere Integrated Containers Martijn Baecke Patrick Daigle VMworld 2017 Content: Not fo

An introduction to Docker

Baremetal with Apache CloudStack

CONTINUOUS DELIVERY WITH MESOS, DC/OS AND JENKINS

EVERYTHING AS CODE A Journey into IT Automation and Standardization. Raphaël Pinson

CONTAINERS AND MICROSERVICES WITH CONTRAIL

Con$nuous Deployment with Docker Andrew Aslinger. Oct

Xen and CloudStack. Ewan Mellor. Director, Engineering, Open-source Cloud Platforms Citrix Systems

VMware s (Open Source) Way of Container. Dr. Udo Seidel

Getting Started With Amazon EC2 Container Service

Introduction to Docker. Antonis Kalipetis Docker Athens Meetup

Investigating Containers for Future Services and User Application Support

Containerization Dockers / Mesospere. Arno Keller HPE

LENS Server Maintenance Guide JZ 2017/07/28

Run containerized applications from pre-existing images stored in a centralized registry

Deploying PXC in Kubernetes / Openshift. Alexander Rubin, Percona

RED HAT GLUSTER TECHSESSION CONTAINER NATIVE STORAGE OPENSHIFT + RHGS. MARCEL HERGAARDEN SR. SOLUTION ARCHITECT, RED HAT BENELUX April 2017

Kubernetes introduction. Container orchestration

S Implementing DevOps and Hybrid Cloud

Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2

Using DC/OS for Continuous Delivery

How Container Runtimes matter in Kubernetes?

The Post-Cloud. Where Google, DevOps, and Docker Converge

Docker. Master the execution environment of your applications. Aurélien Dumez. Inria Bordeaux - Sud-Ouest. Tuesday, March 24th 2015

Installation and setup guide of 1.1 demonstrator

Transcription:

MySQL and Docker Strategies Patrick Galbraith Giuseppe Maxia

About the speakers Patrick Galbraith (patg@patg.net) HP Advanced Technology Group Has worked at Blue Gecko, MySQL AB, Classmates, Slashdot, Cobalt Group, US Navy, K-mart MySQL projects: memcached UDFs, DBD::mysql, federated storage engine New technologies and automaron Family Outdoors

About the speakers Giuseppe Maxia, a.k.a. "The Data Charmer" QA Architect at VMware 25+ years development and DB experience Long Rmer MySQL community member. Oracle ACE Director Blog: hzp://datacharmer.blogspot.com TwiZer: @datacharmer

What are containers? Server Host OS Hypervisor Guest OS Guest OS Guest OS Bins/ Libs Bins/ Libs Mysql Bins/ Libs Mysql App Server Host OS Bins/Libs Bins/Libs M y s q l M y s q l A p p A p p A p p M y s q l D o c k e r VM Containers

Containers vs. VMs MulRple isolated userspace instances Only libraries and components needed for applicaron Runs on the same kernel (using Cgroups). Much smaller, easier to package VERY fast to start! Container runs using (a) specific process(es) SSH not needed Security limited to app

What is Docker? Both a daemon and a command line tool ApplicaRon that manages containers (CLI, API) Automates the deployment of applicarons inside soaware containers WriZen in Go, Opensource dotcloud Uses union file system (AUFS) Can use CLI to search Docker repos for images Used to be awsome sauce around lxc, now using libcontainer No dependency hell

Two ways to Docker For tesrng Quick manual deployment (1 10 containers) Easy configuraron Rapid deploy-test-destroy-retry cycle Works everywhere For producron Quick tool-assisted deployment (100, 1000, N containers) Maintained by orchestrators Perishable by default Easy to replace

Virtual Machines

Containers

Docker concepts

Giuseppe s Agenda (20 min) Difference between VMs and Containers (Patrick) Two cases for containers (test and prod) Seven key points (full system Linux minimal passwords isolaron volumes configuraron ) Shared volume for backup Simple example More complex example InspecRng a container (Quick demo)

Installing Docker 1. GO TO hzps://docs.docker.com/engine/installaron/ 2. Follow the instrucrons for your O.S.

First off: get the MySQL image $ docker pull mysql/mysql-server Using default tag: latest latest: Pulling from mysql/mysql-server 5e7ce0e805ba: Pull complete 4b9736773855: Pull complete 4fb9c55b1f85: Pull complete 19452ca711c2: Pull complete 0c660f33db44: Pull complete b8e96405c8c7: Pull complete 9bdbb574fa66: Pull complete 24c2343e048d: Pull complete Digest: sha256:da24eddcb99cbeba979d7da8170991278ca59838401a7c7bf17c66 307acc641c Status: Downloaded newer image for mysql/mysql-server:latest

SEVEN key points

#1 - Containers are FULL systems Every container contains an executable layer It's a full O.S.

#2 Containers are always Linux Linux flavor in the container is independent from the host But they have a comparble kernel That s why containers are faster than VMs

#3 The O.S. in the container is minimal Don t expect all the tools you get from a Ubuntu DVD You will have only the bare essenrals

#4 MySQL installayon requires a password Security varies depending on the maintainer You may use files (recommended) You may generate a random password (don t)

#5 Containers are ISOLATED You can access containerized MySQL from other containers You need explicit access from the exterior.

#6 Data storage can be tricky By default, the data directory is inside the container Containers are volarle by default and by design You must use volumes to preserve your data

#7 ConfiguraYon is done by adding files With VM, you deploy and then configure. This takes Rme With container, you deploy and add configuraron files on-the-fly Containers are ready to work from the start.

Examples

Simple MySQL deployment docker run \ --name mybox \ -e MYSQL_ROOT_PASSWORD=secret \ -d \ mysql/mysql-server 06d3392543500455adcfe6cba36736739c46688de8028647d38109 c0ec3cf250 # WILL RUN WITH DEFAULT VALUES

Adding log-bin and server-id (1) ## OPTION 1 : on the command line docker run \ --name mybox \ -e MYSQL_ROOT_PASSWORD=secret \ -d \ mysql/mysql-server --log-bin --server-id=100

Adding log-bin and server-id (2) ## OPTION 2 : with a "volume" file $ cat minimal.cnf [mysqld] user=mysql log-bin=mysql-bin server-id=100 $ docker run \ --name mybox \ -e MYSQL_ROOT_PASSWORD=secret \ -d --hostname mybox \ -v $PWD/minimal.cnf:/etc/my.cnf mysql/mysql-server

InspecYng a container docker exec -ti mybox bash [root@mybox /]# mysql -p Enter password: [...] Server version: 5.7.11-log MySQL Community Server (GPL) [...] mysql> select @@server_id; +-------------+ @@server_id +-------------+ 100 +-------------+ 1 row in set (0.00 sec)

Shared backup with containers database server Shared container Physical host shared folder database server database server

Shared backup with containers $ docker create -v /dbdata \ --name dbdata mysql/mysql-server /bin/true $ docker run --name mysql1 \ -e MYSQL_ROOT_PASSWORD=secret \ --volumes-from dbdata -d mysql/mysql-server $ docker run --name mysql2 \ -e MYSQL_ROOT_PASSWORD=secret \ --volumes-from dbdata -d mysql/mysql-server

Demo

Shared backup with containers $ docker create -v /dbdata \ --name dbdata mysql/mysql-server /bin/true $ docker run --name mysql1 \ -e MYSQL_ROOT_PASSWORD=secret \ --volumes-from dbdata -d mysql/mysql-server $ docker run --name mysql2 \ -e MYSQL_ROOT_PASSWORD=secret \ --volumes-from dbdata -d mysql/mysql-server

Container AutomaYon Ansible (hzp://docs.ansible.com/ansible/docker_module.html) YAML Define any number of containers Various ansible modules for building, running, and fact-gathering and service discovery of containers as well as managing images dynamic inventory plugin. Docker Compose (hzps://docs.docker.com/compose/) Define and run mulrple containerized applicarons

Container AutomaYon (cont) Chef (hzps://docs.chef.io/containers.html) Docker cookbook -- install and manage Docker, manage containers and images Etcd and consul cookbooks service discovery Puppet (hzps://forge.puppet.com/puppetlabs/docker_plaporm) Packer (hzps://www.packer.io) crearng idenrcal machine images for mulrple plaporms from a single source configuraron

Ansible Example --- - hosts: "{{ target default('docker') }} sudo: false tasks: - name: run db1 container local_action: module: docker name: db1 pull: missing

Ansible Example (cont) image: registry-host:443/db-img hostname: db1 state: started restart_policy: always volumes: - /var/data/db1-data:/var/lib/mysql - /var/data/backups:/var/data/site/backups - /home:/home detach: True ansible-playbook i inv.txt db1.yaml

Container Clustering Kubernetes -- hzp://kubernetes.io/ CoreOS -- hzps://coreos.com/ Swarm -- hzps://docs.docker.com/swarm/overview/ Mesos -- hzp://mesos.apache.org/ RancherOS -- hzp://rancher.com/rancher-os/ Deis -- hzp://deis.io/ Kupack Redspread KPM

Kubernetes

Galera on Kubernetes For more info 4:30pm to 5:20pm Ballroom A pxc_node1 pod and service file pxc_node2 pod and service file pxc_node3 pod and service file kubectl Api server pxc_cluster Service file pxc_node1 pod pxc_node2 pod pxc_node3 pod pxc container pxc container pxc container pxc_node1 service pxc_node2 service pxc_cluster service pxc_node3 service

Demo

Summary Technology rapidly evolving Containers good for prototyping (manually) And for producron (with tools) Great for distriburng soaware (dev & prod use the same bits) NOT virtual machines (even if they play one on TV)

More on this topic hzp://www.datacharmer.blogspot.com/ hzp://patg.net