SlideShare une entreprise Scribd logo
1  sur  40
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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 - TutorialKenny 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 2014PARIKSHIT 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 EnterpriseNalee Jang
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny 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 2017Ivan 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 PracticesSven 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 PracticesKenny 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 Azurev1Brian Benz
 
2012 ohiolinuxfest replication
2012 ohiolinuxfest replication2012 ohiolinuxfest replication
2012 ohiolinuxfest replicationsqlhjalp
 
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 MySQLMiguel 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 DevelopersGunnar 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 GuidelinesMorgan Tocker
 
High-Availability using MySQL Fabric
High-Availability using MySQL FabricHigh-Availability using MySQL Fabric
High-Availability using MySQL FabricMats 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
 

Tendances (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...
 

Similaire à 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 PythonIvan Ma
 
Dockerization of Azure Platform
Dockerization of Azure PlatformDockerization of Azure Platform
Dockerization of Azure Platformnirajrules
 
Setting up a MySQL Docker Container
Setting up a MySQL Docker ContainerSetting up a MySQL Docker Container
Setting up a MySQL Docker ContainerVictor 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 @BASTAconMario-Leander Reimer
 
Practical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsPractical guide to Oracle Virtual environments
Practical guide to Oracle Virtual environmentsNelson 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 YeruvaMysql User Camp
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetesBen 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-finalMichel 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 2018Jessica Deen
 
Microservices with containers in the cloud
Microservices with containers in the cloudMicroservices with containers in the cloud
Microservices with containers in the cloudEugene 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 RecapPatrick Chanezon
 
Getting Started with MariaDB with Docker
Getting Started with MariaDB with DockerGetting Started with MariaDB with Docker
Getting Started with MariaDB with DockerMariaDB plc
 
MySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialMySQL Cluster 8.0 tutorial
MySQL Cluster 8.0 tutorialFrazer 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 MySQLpratik rathod
 
Cloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesCloud-native .NET Microservices mit Kubernetes
Cloud-native .NET Microservices mit KubernetesQAware GmbH
 
Using MySQL Containers
Using MySQL ContainersUsing MySQL Containers
Using MySQL ContainersMatt Lord
 
20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deploymentIvan 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
 

Similaire à 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!
 

Dernier

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 

Dernier (20)

BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva2.pdf Ejercicios de programación competitiva
2.pdf Ejercicios de programación competitiva
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 

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.