SlideShare a Scribd company logo
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. |
Balasubramanian Kandasamy
Senior Software Development
Manager, MySQL Release Engineering
MySQL Day – November 14, 2019
MySQL on Docker and
Kubernetes
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied
upon in making purchasing decisions. The development, release, timing, and pricing
of any features or functionality described for Oracle’s products may change and
remains at the sole discretion of Oracle Corporation.
Safe Harbor
Agenda
• MySQL on Docker
• Official MySQL Containers
• MySQL InnoDB Cluster Setup using Docker
Compose Demo
• MySQL on Kubernetes
• Q & A
A Modern Database for the Digital Age
100%
Virtually all organizations
require their most critical
systems to be highly available
Introduction - Container
“A container image is a lightweight,
stand-alone, executable package of a
piece of software that includes
everything needed to run it: code,
runtime, system tools, system libraries,
settings. Available for both Linux and
Windows based apps, containerized
software will always run the same,
regardless of the environment.”
Introduction - Docker and Kubernetes
Docker Architecture

The Docker Engine:
- The docker server (dockerd)
- A REST API to interact with the server
- The docker command-line client

Optional orchestration tooling
- Compose and Swarm to manage more
complex applications
Official MySQL Containers
MySQL on Docker - CLI
• docker pull store/oracle/mysql-enterprise-server:8.0.13
docker ps -a
MySQL on Docker - Login
•
docker exec -it mysql-demo mysql -u root -p
Docker Containers: Use Cases
• For Developers
– Automates the repetitive tasks of setting up and configuring development environments so that
developers can focus on what matters: building great software.
• For Operations
– Streamlines software delivery. Develop and deploy bug fixes and new features without roadblocks. Scale
applications in real time.
• For the Enterprise
–Docker is a Containers-as-a-Service platform for the enterprise that manages and secures diverse
applications across disparate infrastructure, both on-premises and in the cloud. Docker EE fuels innovation
by bringing traditional applications and microservices built on Windows, Linux or Linux-on-mainframe into
a single, secure software supply chain. Organizations can modernize applications, infrastructure and
operational models by bringing forward existing IT investments while integrating new technology at the rate
of business.
Operational Problems to Solve
• Orchestration of MySQL (InnoDB Cluster)
• Securing data files
• Auditing
• Monitoring
Get InnoDB Cluster Running on Docker
MySQL Enterprise Edition that is
MySQL InnoDB Cluster and Docker
• To use Security Enhancements, we need
the Enterprise Edition of MySQL, available
from MOS
• Additionally, we need MySQL Enterprise
Monitor to measure replication
performance.
Securing MySQL in a Docker Container
Requirement Resolution
Denial of Service Survival Thread Pool
Secure Persisted Data Transparent Data Encryption
Login Management Authentication and LDAP
Answering Auditors Audit Log
* This in addition to online backups and monitoring
Download Docker Image Enterprise
Edition from My Oracle Support
Get Enterprise Edition Docker
Image from Support (Contd.)
Create Persisted Volumes
/var/lib/mysql is the data directory in the base
image, it needs to be persisted outside of the
container
This is done via
volumes:
-[host path]:[container path substituted]
We create a directory per MySQL instance
~/Docker/PersistedMounts
Docker-compose.yml Edits –Persisting Data
image: mysql/mysql-server:8.0.16
ports:
- "3301:3306"
command: ["mysqld","--server_id=1","--binlog_checksum=NONE","--gtid_mode=ON","--
enforce_gtid_consistency=ON","--log_bin","--log_slave_updates=ON","--
master_info_repository=TABLE","--relay_log_info_repository=TABLE","--
transaction_write_set_extraction=XXHASH64","--user=mysql","--skip-host-cache","--skip-
name-resolve", "--default_authentication_plugin=mysql_native_password"]
volumes:
- ~Docker/PersistedMounts/mysql-server-1:/var/lib/mysql
We’ve added a Docker Volumes identifier mapping the
container /var/lib/mysql/ path to a mountpoint referring
to ~Docker/PersistedMounts/[server-name] on the
container’s host
Docker Compose –Adding Plugins
...
command: ["mysqld","--server_id=1","--binlog_checksum=NONE","--gtid_mode=ON","--
enforce_gtid_consistency=ON","--log_bin","--log_slave_updates=ON","--
master_info_repository=TABLE","--relay_log_info_repository=TABLE","--
transaction_write_set_extraction=XXHASH64","--user=mysql","--skip-host-cache","--
skip-name-resolve", "--default_authentication_plugin=mysql_native_password",
”--early-plugin-load=keyring_file.so",
"--keyring_file_data=/var/lib/mysql-keyring/keyring", "--plugin-load-
add=audit_log.so"
]
...
We’re loading TDE (keyring.so) early, and setting the keyring_file_data directory
and Audit Logging (audit_log.so)
Demo - InnoDB Setup
using Docker compose
Introduction to Kubernetes
Introduction to Kubernetes

Kubelet, a process responsible for
communication between the
Kubernetes Master and the Node; it
manages the Pods and the
containers running on a machine.

A container runtime (like Docker, rkt)
Application deployment in Kubernetes

Deployment/ReplicaSet

Started in no specific order

Will scale if crash and
replace with another non
unique name
Database deployment in Kubernetes

Kubernetes Pods are mortal

Consistent Access

Database containers require
persistent storage

Database is a complex stateful
application

Don’t scale if unhealthy
StatefulSet
Cra
sh!
mysql-0
mysql-1
mysql-2
Don’t scale
and must
replace
mysql-2
Persistent Volume (PV) and Persistent
Volume Claim (PVC)
kubectl get pv
kubectl describe pv mysql-cluster-with-volume
Persistent Volume
(PV): definition of a
storage volume in the
cluster that has been
provisioned by
administrator.
Persistent Volume
Claim (PVC): definition
of specific size and
access mode against
the PV that can be
utilized and
Label and Node Selector
 Label is assigned to a group of worker node
 NodeSelector can be used to achieve node affinity to a specific group of worker node.
shell > kubectl label nodes k8s-worker-node1-20191015-1016 typenode=mysql
shell > kubectl label nodes instance-20191015-2224 typenode=router
Oracle MySQL Operator
- Automates deploying, managing and running custom application
- Operator calls API to customize the cluster behavior for custom resources
- Create and delete MySQL InnoDB Clusters in Kubernetes with ease
- Automate database backups, failure detection and recovery
- Schedule automated backups as part of Cluster definition
- Create “on-demand” backups.
Oracle MySQL Operator
Download MySQL Operator
shell > git clone
https://github.com/oracle/mysql-operator.git
Initialize helm and install tiller
shell > helm init
Create namespace for MySQL Operator
shell > kubectl create ns mysql-operator
Install mysql-operator chart using helm
shell > helm install --name mysql-operator mysql-operator
Note:

MySQL Operator will download and install MySQL CE 8.0.12

Database can be upgraded to the latest MySQL EE 8.0.18
(Download patch 30417240 from MOS for MySQL EE 8.0.18
docker image)
kubectl -n mysql-operator get pod
Kubectl -n kube-system get pod
Sample Configuration
Create ‘mysql-cluster’ Namespace and Apply RBAC
kubectl create ns mysql-cluster
kubectl create -f rbac.yaml
Apply YAML file
shell > kubectl apply –f
node1.yaml
shell > kubectl –n mysql-
cluster get pod
Wait until mysql-0 is running
and ready=“2/2”.
Apply YAML file
shell > kubectl apply –f
node2.yaml
shell > kubectl –n mysql-
cluster get pod
Wait until mysql-1 is running
and ready=“2/2”.
Apply YAML file
shell > kubectl apply –f
node3.yaml
shell > kubectl –n mysql-
cluster get pod
Wait until mysql-2 is running
and ready=“2/2”.
Rolling Upgrade to MySQL Enterprise Edition 8.0.18
shell > kubectl apply
shell > kubectl –n mysql-cluster edit statefulset mysql
Replace the value for “image” with the MySQL EE 8.0.18 docker image from “sudo docker images”
Wrapping up
• MySQL is up to the task of running InnoDB Cluster on Docker containers
• MySQL needs to be secured to mitigate Docker risk profile
• EE has the tools to secure MySQL/Docker
• Monitoring is a critical aspect of MySQL/Docker deployments that MySQL
Enterprise Edition solves
• Kubernetes can provide automation, orchestration and high availability
infrastructure
• MySQL InnoDB Cluster can be deployed rapidly in Kubernetes cluster as
stateful set providing isolation from other containers using shared resource,
and portability between environment.
Questions

More Related Content

What's hot

MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
Miguel Araújo
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
Kenny Gryp
 
Oracle on Azure at Windows Azure Conference 2014
Oracle on Azure at Windows Azure Conference 2014Oracle on Azure at Windows Azure Conference 2014
Oracle on Azure at Windows Azure Conference 2014
PARIKSHIT SAVJANI
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
Geir Høydalsvik
 
OpenStack in Enterprise
OpenStack in EnterpriseOpenStack in Enterprise
OpenStack in Enterprise
Nalee Jang
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
Kenny Gryp
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Miguel Araújo
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
Ivan Ma
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Sven Sandberg
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
Kenny Gryp
 
Tech ED 2014 Running Oracle Databases and Application Servers on Azurev1
Tech ED 2014   Running Oracle Databases and Application Servers on Azurev1Tech ED 2014   Running Oracle Databases and Application Servers on Azurev1
Tech ED 2014 Running Oracle Databases and Application Servers on Azurev1
Brian Benz
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replication
sqlhjalp
 
MySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQLMySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQL
Miguel Araújo
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
Kenny Gryp
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring Developers
Gunnar Hillert
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
Krishna-Kumar
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
Vitor Oliveira
 
MySQL Usability Guidelines
MySQL Usability GuidelinesMySQL Usability Guidelines
MySQL Usability Guidelines
Morgan Tocker
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL Fabric
Mats Kindahl
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
Kasun Gajasinghe
 

What's hot (20)

MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
MySQL Shell - A DevOps-engineer day with MySQL’s development and administrati...
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
Oracle on Azure at Windows Azure Conference 2014
Oracle on Azure at Windows Azure Conference 2014Oracle on Azure at Windows Azure Conference 2014
Oracle on Azure at Windows Azure Conference 2014
 
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
The State of the Dolphin, MySQL Keynote at Percona Live Europe 2019, Amsterda...
 
OpenStack in Enterprise
OpenStack in EnterpriseOpenStack in Enterprise
OpenStack in Enterprise
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
Disaster Recovery with MySQL InnoDB ClusterSet - What is it and how do I use it?
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best PracticesOracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
Oracle OpenWorld 2013 - HOL9737 MySQL Replication Best Practices
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
 
Tech ED 2014 Running Oracle Databases and Application Servers on Azurev1
Tech ED 2014   Running Oracle Databases and Application Servers on Azurev1Tech ED 2014   Running Oracle Databases and Application Servers on Azurev1
Tech ED 2014 Running Oracle Databases and Application Servers on Azurev1
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replication
 
MySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQLMySQL Shell - The DevOps Tool for MySQL
MySQL Shell - The DevOps Tool for MySQL
 
MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)MySQL Group Replication - Ready For Production? (2018-04)
MySQL Group Replication - Ready For Production? (2018-04)
 
Cloud Foundry for Spring Developers
Cloud Foundry for Spring DevelopersCloud Foundry for Spring Developers
Cloud Foundry for Spring Developers
 
Containers and workload security an overview
Containers and workload security an overview Containers and workload security an overview
Containers and workload security an overview
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
MySQL Usability Guidelines
MySQL Usability GuidelinesMySQL Usability Guidelines
MySQL Usability Guidelines
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL Fabric
 
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
[WSO2] Deployment Synchronizer for Deployment Artifact Synchronization Betwee...
 

Similar to MySQL on Docker and Kubernetes

Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
Ivan Ma
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
nirajrules
 
Setting up a MySQL Docker Container
Setting up a MySQL Docker ContainerSetting up a MySQL Docker Container
Setting up a MySQL Docker Container
Victor S. Recio
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Mario-Leander Reimer
 
Practical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsPractical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environments
Nelson Calero
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana Yeruva
Mysql User Camp
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
Michel Schildmeijer
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
Olivier DASINI
 
DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018
Jessica Deen
 
Microservices with containers in the cloud
Microservices with containers in the cloudMicroservices with containers in the cloud
Microservices with containers in the cloud
Eugene Fedorenko
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
Patrick Chanezon
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
MariaDB plc
 
MySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialMySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorial
Frazer Clement
 
Kubernetes - Using Persistent Disks with WordPress and MySQL
Kubernetes - Using Persistent Disks with WordPress and MySQLKubernetes - Using Persistent Disks with WordPress and MySQL
Kubernetes - Using Persistent Disks with WordPress and MySQL
pratik rathod
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
QAware GmbH
 
Using MySQL Containers
Using MySQL ContainersUsing MySQL Containers
Using MySQL Containers
Matt Lord
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deployment
Ivan Ma
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Patrick Chanezon
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
SolarWinds
 

Similar to MySQL on Docker and Kubernetes (20)

Exploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in PythonExploring MySQL Operator for Kubernetes in Python
Exploring MySQL Operator for Kubernetes in Python
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platform
 
Setting up a MySQL Docker Container
Setting up a MySQL Docker ContainerSetting up a MySQL Docker Container
Setting up a MySQL Docker Container
 
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAconCloud-native .NET-Microservices mit Kubernetes @BASTAcon
Cloud-native .NET-Microservices mit Kubernetes @BASTAcon
 
Practical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsPractical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environments
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana Yeruva
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
Pro2516 10 things about oracle and k8s.pptx-final
Pro2516   10 things about oracle and k8s.pptx-finalPro2516   10 things about oracle and k8s.pptx-final
Pro2516 10 things about oracle and k8s.pptx-final
 
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...MySQL High Availability Solutions  -  Avoid loss of service by reducing the r...
MySQL High Availability Solutions - Avoid loss of service by reducing the r...
 
DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018DevOps with Kubernetes and Helm - OSCON 2018
DevOps with Kubernetes and Helm - OSCON 2018
 
Microservices with containers in the cloud
Microservices with containers in the cloudMicroservices with containers in the cloud
Microservices with containers in the cloud
 
Weave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 RecapWeave User Group Talk - DockerCon 2017 Recap
Weave User Group Talk - DockerCon 2017 Recap
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with Docker
 
MySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialMySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorial
 
Kubernetes - Using Persistent Disks with WordPress and MySQL
Kubernetes - Using Persistent Disks with WordPress and MySQLKubernetes - Using Persistent Disks with WordPress and MySQL
Kubernetes - Using Persistent Disks with WordPress and MySQL
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit Kubernetes
 
Using MySQL Containers
Using MySQL ContainersUsing MySQL Containers
Using MySQL Containers
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deployment
 
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
Docker Azure Friday OSS March 2017 - Developing and deploying Java & Linux on...
 
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
Hi! Ho! Hi! Ho! SQL Server on Linux We Go!
 

Recently uploaded

Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Julian Hyde
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
Ayan Halder
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
Łukasz Chruściel
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
VALiNTRY360
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
Peter Muessig
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
Peter Muessig
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
Peter Muessig
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
Green Software Development
 

Recently uploaded (20)

Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)Measures in SQL (SIGMOD 2024, Santiago, Chile)
Measures in SQL (SIGMOD 2024, Santiago, Chile)
 
Requirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional SafetyRequirement Traceability in Xen Functional Safety
Requirement Traceability in Xen Functional Safety
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf2024 eCommerceDays Toulouse - Sylius 2.0.pdf
2024 eCommerceDays Toulouse - Sylius 2.0.pdf
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdfTop Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
Top Benefits of Using Salesforce Healthcare CRM for Patient Management.pdf
 
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s EcosystemUI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
UI5con 2024 - Keynote: Latest News about UI5 and it’s Ecosystem
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
UI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design SystemUI5con 2024 - Bring Your Own Design System
UI5con 2024 - Bring Your Own Design System
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling ExtensionsUI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
UI5con 2024 - Boost Your Development Experience with UI5 Tooling Extensions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, FactsALGIT - Assembly Line for Green IT - Numbers, Data, Facts
ALGIT - Assembly Line for Green IT - Numbers, Data, Facts
 

MySQL on Docker and Kubernetes

  • 1. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | Balasubramanian Kandasamy Senior Software Development Manager, MySQL Release Engineering MySQL Day – November 14, 2019 MySQL on Docker and Kubernetes
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Safe Harbor
  • 3. Agenda • MySQL on Docker • Official MySQL Containers • MySQL InnoDB Cluster Setup using Docker Compose Demo • MySQL on Kubernetes • Q & A
  • 4. A Modern Database for the Digital Age
  • 5. 100% Virtually all organizations require their most critical systems to be highly available
  • 6. Introduction - Container “A container image is a lightweight, stand-alone, executable package of a piece of software that includes everything needed to run it: code, runtime, system tools, system libraries, settings. Available for both Linux and Windows based apps, containerized software will always run the same, regardless of the environment.”
  • 7. Introduction - Docker and Kubernetes
  • 8. Docker Architecture  The Docker Engine: - The docker server (dockerd) - A REST API to interact with the server - The docker command-line client  Optional orchestration tooling - Compose and Swarm to manage more complex applications
  • 10. MySQL on Docker - CLI • docker pull store/oracle/mysql-enterprise-server:8.0.13 docker ps -a
  • 11. MySQL on Docker - Login • docker exec -it mysql-demo mysql -u root -p
  • 12. Docker Containers: Use Cases • For Developers – Automates the repetitive tasks of setting up and configuring development environments so that developers can focus on what matters: building great software. • For Operations – Streamlines software delivery. Develop and deploy bug fixes and new features without roadblocks. Scale applications in real time. • For the Enterprise –Docker is a Containers-as-a-Service platform for the enterprise that manages and secures diverse applications across disparate infrastructure, both on-premises and in the cloud. Docker EE fuels innovation by bringing traditional applications and microservices built on Windows, Linux or Linux-on-mainframe into a single, secure software supply chain. Organizations can modernize applications, infrastructure and operational models by bringing forward existing IT investments while integrating new technology at the rate of business.
  • 13. Operational Problems to Solve • Orchestration of MySQL (InnoDB Cluster) • Securing data files • Auditing • Monitoring
  • 14. Get InnoDB Cluster Running on Docker MySQL Enterprise Edition that is
  • 15. MySQL InnoDB Cluster and Docker • To use Security Enhancements, we need the Enterprise Edition of MySQL, available from MOS • Additionally, we need MySQL Enterprise Monitor to measure replication performance.
  • 16. Securing MySQL in a Docker Container Requirement Resolution Denial of Service Survival Thread Pool Secure Persisted Data Transparent Data Encryption Login Management Authentication and LDAP Answering Auditors Audit Log * This in addition to online backups and monitoring
  • 17. Download Docker Image Enterprise Edition from My Oracle Support
  • 18. Get Enterprise Edition Docker Image from Support (Contd.)
  • 19. Create Persisted Volumes /var/lib/mysql is the data directory in the base image, it needs to be persisted outside of the container This is done via volumes: -[host path]:[container path substituted] We create a directory per MySQL instance ~/Docker/PersistedMounts
  • 20. Docker-compose.yml Edits –Persisting Data image: mysql/mysql-server:8.0.16 ports: - "3301:3306" command: ["mysqld","--server_id=1","--binlog_checksum=NONE","--gtid_mode=ON","-- enforce_gtid_consistency=ON","--log_bin","--log_slave_updates=ON","-- master_info_repository=TABLE","--relay_log_info_repository=TABLE","-- transaction_write_set_extraction=XXHASH64","--user=mysql","--skip-host-cache","--skip- name-resolve", "--default_authentication_plugin=mysql_native_password"] volumes: - ~Docker/PersistedMounts/mysql-server-1:/var/lib/mysql We’ve added a Docker Volumes identifier mapping the container /var/lib/mysql/ path to a mountpoint referring to ~Docker/PersistedMounts/[server-name] on the container’s host
  • 21. Docker Compose –Adding Plugins ... command: ["mysqld","--server_id=1","--binlog_checksum=NONE","--gtid_mode=ON","-- enforce_gtid_consistency=ON","--log_bin","--log_slave_updates=ON","-- master_info_repository=TABLE","--relay_log_info_repository=TABLE","-- transaction_write_set_extraction=XXHASH64","--user=mysql","--skip-host-cache","-- skip-name-resolve", "--default_authentication_plugin=mysql_native_password", ”--early-plugin-load=keyring_file.so", "--keyring_file_data=/var/lib/mysql-keyring/keyring", "--plugin-load- add=audit_log.so" ] ... We’re loading TDE (keyring.so) early, and setting the keyring_file_data directory and Audit Logging (audit_log.so)
  • 22. Demo - InnoDB Setup using Docker compose
  • 24. Introduction to Kubernetes  Kubelet, a process responsible for communication between the Kubernetes Master and the Node; it manages the Pods and the containers running on a machine.  A container runtime (like Docker, rkt)
  • 25. Application deployment in Kubernetes  Deployment/ReplicaSet  Started in no specific order  Will scale if crash and replace with another non unique name
  • 26. Database deployment in Kubernetes  Kubernetes Pods are mortal  Consistent Access  Database containers require persistent storage  Database is a complex stateful application  Don’t scale if unhealthy StatefulSet Cra sh! mysql-0 mysql-1 mysql-2 Don’t scale and must replace mysql-2
  • 27. Persistent Volume (PV) and Persistent Volume Claim (PVC) kubectl get pv kubectl describe pv mysql-cluster-with-volume Persistent Volume (PV): definition of a storage volume in the cluster that has been provisioned by administrator. Persistent Volume Claim (PVC): definition of specific size and access mode against the PV that can be utilized and
  • 28.
  • 29. Label and Node Selector  Label is assigned to a group of worker node  NodeSelector can be used to achieve node affinity to a specific group of worker node. shell > kubectl label nodes k8s-worker-node1-20191015-1016 typenode=mysql shell > kubectl label nodes instance-20191015-2224 typenode=router
  • 30. Oracle MySQL Operator - Automates deploying, managing and running custom application - Operator calls API to customize the cluster behavior for custom resources - Create and delete MySQL InnoDB Clusters in Kubernetes with ease - Automate database backups, failure detection and recovery - Schedule automated backups as part of Cluster definition - Create “on-demand” backups.
  • 31. Oracle MySQL Operator Download MySQL Operator shell > git clone https://github.com/oracle/mysql-operator.git Initialize helm and install tiller shell > helm init Create namespace for MySQL Operator shell > kubectl create ns mysql-operator Install mysql-operator chart using helm shell > helm install --name mysql-operator mysql-operator Note:  MySQL Operator will download and install MySQL CE 8.0.12  Database can be upgraded to the latest MySQL EE 8.0.18 (Download patch 30417240 from MOS for MySQL EE 8.0.18 docker image) kubectl -n mysql-operator get pod Kubectl -n kube-system get pod
  • 33. Create ‘mysql-cluster’ Namespace and Apply RBAC kubectl create ns mysql-cluster kubectl create -f rbac.yaml
  • 34. Apply YAML file shell > kubectl apply –f node1.yaml shell > kubectl –n mysql- cluster get pod Wait until mysql-0 is running and ready=“2/2”.
  • 35. Apply YAML file shell > kubectl apply –f node2.yaml shell > kubectl –n mysql- cluster get pod Wait until mysql-1 is running and ready=“2/2”.
  • 36. Apply YAML file shell > kubectl apply –f node3.yaml shell > kubectl –n mysql- cluster get pod Wait until mysql-2 is running and ready=“2/2”.
  • 37. Rolling Upgrade to MySQL Enterprise Edition 8.0.18 shell > kubectl apply shell > kubectl –n mysql-cluster edit statefulset mysql Replace the value for “image” with the MySQL EE 8.0.18 docker image from “sudo docker images”
  • 38.
  • 39. Wrapping up • MySQL is up to the task of running InnoDB Cluster on Docker containers • MySQL needs to be secured to mitigate Docker risk profile • EE has the tools to secure MySQL/Docker • Monitoring is a critical aspect of MySQL/Docker deployments that MySQL Enterprise Edition solves • Kubernetes can provide automation, orchestration and high availability infrastructure • MySQL InnoDB Cluster can be deployed rapidly in Kubernetes cluster as stateful set providing isolation from other containers using shared resource, and portability between environment.