In this tutorial, we cover the different deployment possibilities of the MySQL architecture depending on the business requirements for the data. We also deploy some architecture and see how to evolve to the next one.
The tutorial covers the new MySQL Solutions like InnoDB ReplicaSet, InnoDB Cluster, and InnoDB ClusterSet.
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
MySQL InnoDB Cluster is a very easy HA solution to deploy. However it's also a very customizable solution able to respond to most needs. During this session I will give an overview of settings that you may tune like those related to quorum lost, level of consistency, but also some you may not know like how to change recovery system, effect of increasing the event horizon. We will also discus about maintenance operations like how to stream large transactions, how to deal with DDL in multi-primary environments...
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMiguel Araújo
MySQL InnoDB ClusterSet brings multi-datacenter capabilities to our solutions and makes it very easy to set up a disaster recovery architecture. Think multiple MySQL InnoDB Clusters into one single database architecture, fully managed from MySQL Shell and with full MySQL Router integration to make it easy to access the entire architecture.
This presentation covers the various solutions of MySQL for High Availability, Replication, and Disaster Recovery, with a special focus on InnoDB ClusterSet:
- The various features of InnoDB Clusterset
- How to setup MySQL InnoDB ClusterSet
- Ways to migrate from an existing MySQL InnoDB Cluster into MySQL InnoDB ClusterSet
- How to deal with various failures
- The various features of router integration make the connection to the database architecture easy.
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudMarkus Michalewicz
This presentation discusses the support guidelines for using Oracle Real Application Clusters (RAC) in virtualized environments, for which general Oracle Database support guidelines are discussed shortly first.
First presented during DOAG 2021 User Conference, this presentation replaces its predecessor from 2016: https://www.slideshare.net/MarkusMichalewicz/how-to-use-oracle-rac-in-a-cloud-a-support-question
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
MySQL InnoDB Cluster is a very easy HA solution to deploy. However it's also a very customizable solution able to respond to most needs. During this session I will give an overview of settings that you may tune like those related to quorum lost, level of consistency, but also some you may not know like how to change recovery system, effect of increasing the event horizon. We will also discus about maintenance operations like how to stream large transactions, how to deal with DDL in multi-primary environments...
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMiguel Araújo
MySQL InnoDB ClusterSet brings multi-datacenter capabilities to our solutions and makes it very easy to set up a disaster recovery architecture. Think multiple MySQL InnoDB Clusters into one single database architecture, fully managed from MySQL Shell and with full MySQL Router integration to make it easy to access the entire architecture.
This presentation covers the various solutions of MySQL for High Availability, Replication, and Disaster Recovery, with a special focus on InnoDB ClusterSet:
- The various features of InnoDB Clusterset
- How to setup MySQL InnoDB ClusterSet
- Ways to migrate from an existing MySQL InnoDB Cluster into MySQL InnoDB ClusterSet
- How to deal with various failures
- The various features of router integration make the connection to the database architecture easy.
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudMarkus Michalewicz
This presentation discusses the support guidelines for using Oracle Real Application Clusters (RAC) in virtualized environments, for which general Oracle Database support guidelines are discussed shortly first.
First presented during DOAG 2021 User Conference, this presentation replaces its predecessor from 2016: https://www.slideshare.net/MarkusMichalewicz/how-to-use-oracle-rac-in-a-cloud-a-support-question
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
Oracle's MySQL solutions make it easy to setup various database architectures and achieve high availability with the introduction MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet meeting various high availability requirements. MySQL InnoDB ClusterSet provides a popular disaster recovery solution.
Completely built in-house and supported by Oracle, many enterprises large and small have adopted these solutions into business critical applications.
In this presentation the various database architecture solutions for high availability and disaster recovery will be covered and help you choose the right solutions based on your business requirements.
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
At the beginning of a project, the database is just a single MySQL instance (maybe not even running on its own hardware)... but with the evolution of the business requirements, the database must change to also meet the new targets of data loss and uptime. During this session we will follow the journey of a single MySQL server from the simple instance to a High Available Architecture with multi-site Disaster Recovery. We will discover easy manageable native solutions like MySQL InnoDB ReplicaSet, MySQL InnoDB Cluster and MySQL InnoDB ClusterSet. The session is also illustrated with commands and examples.
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesKenny Gryp
MySQL InnoDB Cluster provides a complete high availability solution for MySQL. MySQL Shell includes AdminAPI which enables you to easily configure and administer a group of at least three MySQL server instances to function as an InnoDB cluster.
This talk includes best practices.
Oracle Active Data Guard: Best Practices and New Features Deep Dive Glen Hawkins
Oracle Data Guard and Oracle Active Data Guard have long been the answer for the real-time protection, availability, and usability of Oracle data. This presentation provides an in-depth look at several key new features that will make your life easier and protect your data in new and more flexible ways. Learn how Oracle Active Data Guard 19c has been integrated with Oracle Database In-Memory and offers a faster application response after a role transition. See how DML can now be redirected from an Oracle Active Data Guard standby to its primary for more flexible data protection in today’s data centers or your data clouds. This technical deep dive on Active Data Guard is designed to give you a glimpse into upcoming new features brought to you by Oracle Development.
Percona Live 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
From a single MySQL instance to multi-site high availability, this is what you will find out in this presentation. You will learn how to make this transition and which solutions best suit changing business requirements (RPO, RTO). Recently, MySQL has extended the possibilities for easy deployment of architecture with integrated tools. Come and discover these open source solutions that are part of MySQL.
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
Following MySQL InnoDB Cluster as our first, fully integrated MySQL High Availability solution based on Group Replication, MySQL Shell 8.0.19 includes MySQL InnoDB ReplicaSet which delivers another complete solution, this time based on MySQL Replication.
The basic idea for InnoDB ReplicaSet is to do the same for classic MySQL Replication as InnoDB Cluster did for Group Replication. We take a strong technology that is very powerful but can be complex, and provide an easy-to-use AdminAPI for it in the MySQL Shell.
In just a few easy to use Shell commands, a MySQL Replication database architecture can be configured from scratch including:
Data provisioning using MySQL CLONE, Setting up replication,
Performing manual switchover/failover.
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
In this session, I will cover under-the-hood features that power Oracle Real Application Clusters (Oracle RAC) 19c specifically around Cache Fusion and Service management. Improvements in Oracle RAC helps in integration with features such as Multitenant and Data Guard. In fact, these features benefit immensely when used with Oracle RAC. Finally we will talk about changes to the broader Oracle RAC Family of Products stack and the algorithmic changes that helps quickly detect sick/dead nodes/instances and the reconfiguration improvements to ensure that the Oracle RAC Databases continue to function without any disruption
Oracle Data Guard ensures high availability, disaster recovery and data protection for enterprise data. This enable production Oracle databases to survive disasters and data corruptions. Oracle 18c and 19c offers many new features it will bring many advantages to organization.
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
This presentation by Krzysztof Książek at Percona Live 2017 in Santa Clara, California gives detailed descriptions and comparisons of the leading open source database load balancing technologies
MySQL Database Architectures - MySQL InnoDB ClusterSet 2021-11Kenny Gryp
Oracle's MySQL solutions make it easy to setup various database architectures and achieve high availability with the introduction MySQL InnoDB Cluster and MySQL InnoDB ReplicaSet meeting various high availability requirements. MySQL InnoDB ClusterSet provides a popular disaster recovery solution.
Completely built in-house and supported by Oracle, many enterprises large and small have adopted these solutions into business critical applications.
In this presentation the various database architecture solutions for high availability and disaster recovery will be covered and help you choose the right solutions based on your business requirements.
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
At the beginning of a project, the database is just a single MySQL instance (maybe not even running on its own hardware)... but with the evolution of the business requirements, the database must change to also meet the new targets of data loss and uptime. During this session we will follow the journey of a single MySQL server from the simple instance to a High Available Architecture with multi-site Disaster Recovery. We will discover easy manageable native solutions like MySQL InnoDB ReplicaSet, MySQL InnoDB Cluster and MySQL InnoDB ClusterSet. The session is also illustrated with commands and examples.
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesKenny Gryp
MySQL InnoDB Cluster provides a complete high availability solution for MySQL. MySQL Shell includes AdminAPI which enables you to easily configure and administer a group of at least three MySQL server instances to function as an InnoDB cluster.
This talk includes best practices.
Oracle Active Data Guard: Best Practices and New Features Deep Dive Glen Hawkins
Oracle Data Guard and Oracle Active Data Guard have long been the answer for the real-time protection, availability, and usability of Oracle data. This presentation provides an in-depth look at several key new features that will make your life easier and protect your data in new and more flexible ways. Learn how Oracle Active Data Guard 19c has been integrated with Oracle Database In-Memory and offers a faster application response after a role transition. See how DML can now be redirected from an Oracle Active Data Guard standby to its primary for more flexible data protection in today’s data centers or your data clouds. This technical deep dive on Active Data Guard is designed to give you a glimpse into upcoming new features brought to you by Oracle Development.
Percona Live 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
From a single MySQL instance to multi-site high availability, this is what you will find out in this presentation. You will learn how to make this transition and which solutions best suit changing business requirements (RPO, RTO). Recently, MySQL has extended the possibilities for easy deployment of architecture with integrated tools. Come and discover these open source solutions that are part of MySQL.
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
Following MySQL InnoDB Cluster as our first, fully integrated MySQL High Availability solution based on Group Replication, MySQL Shell 8.0.19 includes MySQL InnoDB ReplicaSet which delivers another complete solution, this time based on MySQL Replication.
The basic idea for InnoDB ReplicaSet is to do the same for classic MySQL Replication as InnoDB Cluster did for Group Replication. We take a strong technology that is very powerful but can be complex, and provide an easy-to-use AdminAPI for it in the MySQL Shell.
In just a few easy to use Shell commands, a MySQL Replication database architecture can be configured from scratch including:
Data provisioning using MySQL CLONE, Setting up replication,
Performing manual switchover/failover.
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
In this session, I will cover under-the-hood features that power Oracle Real Application Clusters (Oracle RAC) 19c specifically around Cache Fusion and Service management. Improvements in Oracle RAC helps in integration with features such as Multitenant and Data Guard. In fact, these features benefit immensely when used with Oracle RAC. Finally we will talk about changes to the broader Oracle RAC Family of Products stack and the algorithmic changes that helps quickly detect sick/dead nodes/instances and the reconfiguration improvements to ensure that the Oracle RAC Databases continue to function without any disruption
Oracle Data Guard ensures high availability, disaster recovery and data protection for enterprise data. This enable production Oracle databases to survive disasters and data corruptions. Oracle 18c and 19c offers many new features it will bring many advantages to organization.
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...Severalnines
This presentation by Krzysztof Książek at Percona Live 2017 in Santa Clara, California gives detailed descriptions and comparisons of the leading open source database load balancing technologies
MySQL Database Service Webinar: Installing Drupal in oci with mdsFrederic Descamps
How to Install Drupal in OCI using MySQL Database Service.
Discover in this talk two ways to install Drupal on OCI using MDS:
- easy way: using Resource Manager Stacks
- usual way: creating everything manually
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...Frederic Descamps
Logical dumps are becoming popular again. MySQL Shell parallel dump & load utility changed to way to deal with logical dumps, certainly when using instances in the cloud. MySQL 8.0 released also an awesome physical snapshot feature with CLONE.
In this session, I will show how to use these two ways of saving your data and how to use the generated backup to perform point-in-time recovery like a rockstar with MySQL 8.0 in 2022 !
Présentation de MySQL 8.0 est des nouveautés récentes dans les toutes dernières versions ainsi que des informations sur la prochaine beta du MySQL Operator for Kubernetes
UAE MySQL Users Group Meet-up : MySQL Shell Document Store & more...Frederic Descamps
Discover MySQL 8.0 Document Store and how to use CRUD operations from the MySQL Shell. Also discover how to extend the MySQL Shell with User Defined Reports and Plugins
State of the Dolphin 2020 - 25th Anniversary of MySQL with 8.0.20Frederic Descamps
This is the online live version of the State of The Dolphin during Percona Live Online in May 2020.Discover what's new in MySQL 8.0, the Document Store, CTEs, Window Functions, Lateral, JSON_TABLE, the new Volcano Iterator, EXPLAIN ANLYZE, HASH JOIN, the new double write buffer, binlog compression, InnoDB Cluster, InnoDB ReplicaSet, DNS-SRV.... and last but not least our Contributors who made MySQL 8.0 so Great !
Slides from the MySQL Cluster 8.0 tutorial given at MySQL preFOSDEM days in Brussels, January 2020.
There is an accompanying text file with commands and example output.
MySQL 8.0 : High Availability Solution for EverybodyFrederic Descamps
WePay & MySQL Virtual Meetup: check how easy it's do deploy and High Available Solution for your MySQL Database using MySQL Shell.
Abandon complex architectures and opt for turnkey solutions supported by MySQL.
A solution for all your needs and constraints...
In the presentation, we will learn on how to set up InnoDB cluster using the official MySQL Docker containers and run them with docker-compose. This presentation covers a demo, including how to connect to the cluster through MySQL Router using a simple application.
Similar to Percona Live 2022 - MySQL Architectures (20)
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...Frederic Descamps
Découvrez un nouveau monde où l'on peut gérer ses données sans la moindre ligne de SQL.
MySQL Document Store utilise le nouveau protocol MySQL X, qui est également présent avec MySQL Database Service sur OCI, et permet aux développeurs d'écrire du code simple et efficace.
Mais attention, si nécessaire, MySQL Document Store peut également traiter les document JSON comme s'ils étaient des tables relationnelles et permettre des requêtes très poussées...
Open Source 101 2022 - MySQL Indexes and HistogramsFrederic Descamps
Nobody complains that the database is too fast. But when things slow down, the complaints come quickly. The two most popular approaches to speeding up queries are indexes and histograms. But there are so many options and types on indexes that it can get confusing. Histograms are fairly new to MySQL but they do not work for all types of data. This talk covers how indexes and histograms work and show you how to test just how effective they are so you can measure the performance of your queries.
Pi Day 2022 - from IoT to MySQL HeatWave Database ServiceFrederic Descamps
HeatWave is a massively parallel, high performance, in-memory query accelerator for Oracle MySQL Database Service that accelerates MySQL performance by orders of magnitude for analytics and mixed workloads. But how do you collect data from an Internet of Things Environment so you can use HeatWave to process it? In one hour you will see how data collected by a Raspberry PI or other Internet of Things device can be uploaded to the MySQL Database Service and then processed by HeatWave.
D'une simple instance MysQL à une haute-disponibilité multi-sites, voici ce que vous décrouvrirez dans cette présentation. Comment effectuer cette transition et quelles solutions conviennent les mieux aux évolutions des exigences commerciales (RPO, RTO). Récemment, MySQL a étendu les possibilités de déploiement aisé d'architecture avec des outils intégrés. Venez découvrir ces solution Open Source qui font partie de MySQL.
MySQL Tech Café #8: MySQL 8.0 for Python DevelopersFrederic Descamps
Usually it seems Python developers don't always think about MySQL as their first choice.... However when test test it with the right connector and MySQL 8.0 they love it !
Join this talk to learn how Python with mysql-connector-python can take advantages of MySQL 8.0.
This means using Standard MySQL Protocol but much nicer the X Protocol. During this session you will see how you can use MySQL Document Store and MySQL as RDBMS on the same session to benefits from both worlds.
OpenExpo Virtual Experience 2020: MySQL 8.0 Document Store - Discovery of a n...Frederic Descamps
MySQL Document Store enables us to work with SQL relational tables and schema-less JSON collections. So instead of having a mixed bag of databases, you can just rely on MySQL, where the JSON documents can be stored in collections and managed with CRUD operations. All you need to do is install the X plugin. In this session, you will learn what a document store is, how to install and use it, and all the reasons for considering it. We will also see several specific features helping developers and illustrate how the usual MySQL DBA can manage this new world.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Albert Hoitingh
In this session I delve into the encryption technology used in Microsoft 365 and Microsoft Purview. Including the concepts of Customer Key and Double Key Encryption.
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Key Trends Shaping the Future of Infrastructure.pdfCheryl Hung
Keynote at DIGIT West Expo, Glasgow on 29 May 2024.
Cheryl Hung, ochery.com
Sr Director, Infrastructure Ecosystem, Arm.
The key trends across hardware, cloud and open-source; exploring how these areas are likely to mature and develop over the short and long-term, and then considering how organisations can position themselves to adapt and thrive.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
2. Before we start:
Ensure that you have:
a laptop (or a computer, or a cloud instance)
MySQL 8.0.29 installed on it
MySQL Shell 8.0.29 installed on it
MySQL Router 8.0.29 installed on it
Visual Studio Code and MySQL Shell extention [optional]
If not, now, it's the right time to do it before we start...
Copyright @ 2022 Oracle and/or its affiliates.
2
4. Who am I ?
about.me/lefred
Copyright @ 2022 Oracle and/or its affiliates.
4
5. @lefred
MySQL Evangelist
using MySQL since version 3.20
devops believer
likes 🏀
living in
h ps://lefred.be
Frédéric Descamps
Copyright @ 2022 Oracle and/or its affiliates.
5
7. Housekeeping and FAQ
Slides will be available later today !
We will have 2 breaks
Don't fall behind, if you have a question or a problem do not hesitate to reach out to me!
When you see this image (look on the top right of this slide), it's your turn.
Yes, you need to do all labs, each lab builds on the previous lab
Prepare a sheet and a pen (or open your text editor) to write some notes, like credentials,
ports, ...
Copyright @ 2022 Oracle and/or its affiliates.
7
8. MySQL Shell is now included in Visual Studio Code:
Copyright @ 2022 Oracle and/or its affiliates.
8
10. Windows Users - Installation
For Microsoft Windows users, please use MySQL Installer to install the required products:
Copyright @ 2022 Oracle and/or its affiliates.
10
12. We will start with the deployment of a
single instance of MySQL.
MySQL architectures: Agenda
Copyright @ 2022 Oracle and/or its affiliates.
12
13. We will create a second instance and setup
Asynchronous replication.
We will also deploy MySQL Router.
MySQL architectures: Agenda
Copyright @ 2022 Oracle and/or its affiliates.
13
14. We will then upgrade to MySQL InnoDB
Cluster and add a third MySQL instance.
MySQL architectures: Agenda
Copyright @ 2022 Oracle and/or its affiliates.
14
15. MySQL architectures: Agenda
To nish with the ultimate High Availability and Disaster Recovery solution:
Copyright @ 2022 Oracle and/or its affiliates.
15
17. You should have already downloaded and
installed MySQL and MySQL Shell on your
system.
During this tutorial, we will use MySQL Shell
sandbox capabilities to simulate multiple
servers.
Let's start the rst hands-on LAB !
MySQL Single Instance
Copyright @ 2022 Oracle and/or its affiliates.
17
19. LAB 1: deployment and connection to MySQL
You can use MySQL Shell or MySQL Shell for Visual Studio Code.
We need to rst launch MySQL Shell and deploy our rst sandbox.
This is the information we will use:
port: 3310
root password: MySQL123
We will use the dba.deploySandboxInstance() method:
JS> dba.deploySandboxInstance(3310, {password: 'MySQL123'})
Copyright @ 2022 Oracle and/or its affiliates.
19
20. LAB 1: deployment and connection to MySQL
Copyright @ 2022 Oracle and/or its affiliates.
20
21. LAB 1: deployment and connection to MySQL
Now we can connect to our sandbox MySQL instance:
JS> c root@localhost:3310
Copyright @ 2022 Oracle and/or its affiliates.
root / MySQL123
port: 3310
21
22. LAB 1: deployment and connection to MySQL
Now we can connect to our sandbox MySQL instance:
JS> c root@localhost:3310
Copyright @ 2022 Oracle and/or its affiliates.
root / MySQL123
port: 3310
21
23. LAB 1: deployment and connection to MySQL
Copyright @ 2022 Oracle and/or its affiliates.
root / MySQL123
port: 3310
22
24. LAB 1: inserting data
We will now create a new table and add data to it:
SQL> CREATE DATABASE perconalive;
SQL> u perconalive
SQL> CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
port INT);
SQL> INSERT into t1 (port) VALUES (@@port);
Copyright @ 2022 Oracle and/or its affiliates.
23
25. LAB 1: inserting data
We will now create a new table and add data to it:
SQL> CREATE DATABASE perconalive;
SQL> u perconalive
SQL> CREATE TABLE t1 (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
port INT);
SQL> INSERT into t1 (port) VALUES (@@port);
SQL> SELECT * FROM t1;
+----+---------------------+------+
| id | timestamp | port |
+----+---------------------+------+
| 1 | 2022-05-04 16:30:06 | 3310 |
+----+---------------------+------+
1 row in set (0.0010 sec)
Copyright @ 2022 Oracle and/or its affiliates.
23
26. LAB 1: inserting data
Copyright @ 2022 Oracle and/or its affiliates.
24
28. MySQL InnoDB ReplicaSet - our needs
Now, we need to have a solution in case our MySQL instance crashes and cannot be
restarted.
We also need, when possible, to o load some read queries to another instance.
Our RPO can be greater than 0.
Our RTO can be de ned in several minutes.
Copyright @ 2022 Oracle and/or its affiliates.
26
29. MySQL InnoDB ReplicaSet - our needs
Now, we need to have a solution in case our MySQL instance crashes and cannot be
restarted.
We also need, when possible, to o load some read queries to another instance.
Our RPO can be greater than 0.
Our RTO can be de ned in several minutes.
RPO: Recovery Point Objective (how much data can be lost)
RTO: Recovery Time Objective (how long to recover)
Copyright @ 2022 Oracle and/or its affiliates.
26
30. Based on the popular MySQL
Asynchronous Replication
Failover is Manual
Fully integrated with MySQL Shell and
MySQL Router
Data provisioning included (CLONE)
Recommended for unstable networks
RPO != 0 & RTO = minutes
MySQL InnoDB ReplicaSet
Copyright @ 2022 Oracle and/or its affiliates.
27
32. We use again MySQL Shell to deploy
another instance:
JS> dba.deploySandboxInstance(3320,
{password: 'MySQL123'})
LAB 2: deployment of a second MySQL sandbox
Copyright @ 2022 Oracle and/or its affiliates.
29
33. LAB 2: MySQL instances con guration
We need to con gure the instances so that they are ready to be part of a MySQL InnoDB
ReplicaSet:
JS> dba.configureReplicaSetInstance("root@localhost:3310")
JS> dba.configureReplicaSetInstance("root@localhost:3320")
Copyright @ 2022 Oracle and/or its affiliates.
30
34. LAB 2: MySQL instances con guration
We need to con gure the instances so that they are ready to be part of a MySQL InnoDB
ReplicaSet:
JS> dba.configureReplicaSetInstance("root@localhost:3310")
JS> dba.configureReplicaSetInstance("root@localhost:3320")
Copyright @ 2022 Oracle and/or its affiliates.
sandboxes are already con gured
30
35. LAB 2: MySQL instances con guration
< >
Copyright @ 2022 Oracle and/or its affiliates.
When I am not using a sandbox instance, MySQL Shell warns me about the root
user having access only from localhost.
It proposes 4 choices, what should I do?
31
36. LAB 2: MySQL instances con guration
< >
Copyright @ 2022 Oracle and/or its affiliates.
When I am not using a sandbox instance, MySQL Shell warns me about the root
user having access only from localhost.
It proposes 4 choices, what should I do?
The recommendation is to create a dedicated user to manage the solution on all
instances with the same credentials (option 2).
Check the example on the next slide !
31
37. LAB 2: MySQL instances con guration - example
Copyright @ 2022 Oracle and/or its affiliates.
32
38. We now create the MySQL InnoDB
ReplicaSet when connected to our rst
instance:
JS> rs=dba.createReplicaSet(
'myreplicaset')
LAB 2: MySQL InnoDB ReplicaSet creation
Copyright @ 2022 Oracle and/or its affiliates.
33
39. LAB 2: MySQL InnoDB ReplicaSet creation
Copyright @ 2022 Oracle and/or its affiliates.
34
40. LAB 2: MySQL InnoDB ReplicaSet creation
Explore the rs object created and get its status:
Copyright @ 2022 Oracle and/or its affiliates.
35
41. LAB 2: MySQL InnoDB ReplicaSet creation
Explore the rs object created and get its status:
JS> rs.status()
Copyright @ 2022 Oracle and/or its affiliates.
35
42. LAB 2: MySQL InnoDB ReplicaSet status
Copyright @ 2022 Oracle and/or its affiliates.
36
43. LAB 2: MySQL InnoDB ReplicaSet status
< >
Copyright @ 2022 Oracle and/or its affiliates.
When I created my ReplicaSet, I forgot to assign it to a variable...
What can I do ?
37
44. LAB 2: MySQL InnoDB ReplicaSet status
< >
Copyright @ 2022 Oracle and/or its affiliates.
When I created my ReplicaSet, I forgot to assign it to a variable...
What can I do ?
Just assing it again using the dba.ReplicaSet() method:
rs=dba.getReplicaSet()
37
45. It's time to add our second MySQL instance
to our MySQL InnoDB ReplicaSet:
JS> rs.addInstance('localhost:3320')
LAB 2: MySQL InnoDB ReplicaSet adding a member
Copyright @ 2022 Oracle and/or its affiliates.
38
46. LAB 2: MySQL InnoDB ReplicaSet adding a member
Copyright @ 2022 Oracle and/or its affiliates.
39
47. LAB 2: MySQL InnoDB ReplicaSet adding a member
Copyright @ 2022 Oracle and/or its affiliates.
40
48. Check again the status of the
MySQL InnoDB ReplicaSet
LAB 2: MySQL InnoDB ReplicaSet status
Copyright @ 2022 Oracle and/or its affiliates.
41
50. LAB 3: MySQL InnoDB ReplicaSet - test
In this lab, we will try to read and write data on both MySQL instances. Then we will
bootstrap MySQL Router and test it.
Copyright @ 2022 Oracle and/or its affiliates.
43
51. LAB 3: MySQL InnoDB ReplicaSet - test
In this lab, we will try to read and write data on both MySQL instances. Then we will
bootstrap MySQL Router and test it.
Connect to both instances on two di erent terminals (or tabs if you are using VS Code) and
list the records in the table perconalive.t1:
Copyright @ 2022 Oracle and/or its affiliates.
43
52. LAB 3: MySQL InnoDB ReplicaSet - test
In this lab, we will try to read and write data on both MySQL instances. Then we will
bootstrap MySQL Router and test it.
Connect to both instances on two di erent terminals (or tabs if you are using VS Code) and
list the records in the table perconalive.t1:
Copyright @ 2022 Oracle and/or its affiliates.
43
53. LAB 3: MySQL InnoDB ReplicaSet - test write
Now let's try to write on both instances:
SQL> insert into perconalive.t1 (port) values (@@port);
Copyright @ 2022 Oracle and/or its affiliates.
44
54. Primary Secondary
LAB 3: MySQL InnoDB ReplicaSet - test write
Now let's try to write on both instances:
SQL> insert into perconalive.t1 (port) values (@@port);
Copyright @ 2022 Oracle and/or its affiliates.
44
55. MySQL Router is very easy to con gure, you
only need to use the bootstrap
command:
$ sudo mysqlrouter --bootstrap
root@localhost:3310 --user mysqlrouter
$ sudo systemctl start mysqlrouter
It's also possible to create a MySQL user
account for Router (optional):
JS> rs.setupRouterAccount("router")
LAB 3: MySQL Router
Copyright @ 2022 Oracle and/or its affiliates.
45
56. MySQL Router is very easy to con gure, you
only need to use the bootstrap
command:
$ sudo mysqlrouter --bootstrap
root@localhost:3310 --user mysqlrouter
$ sudo systemctl start mysqlrouter
It's also possible to create a MySQL user
account for Router (optional):
JS> rs.setupRouterAccount("router")
LAB 3: MySQL Router
Copyright @ 2022 Oracle and/or its affiliates.
Windows users, info coming
45
57. LAB 3: MySQL Router
Copyright @ 2022 Oracle and/or its affiliates.
46
58. LAB 3: MySQL Router - Windows
Open a command terminal and bootstrap MySQL Router:
C:Usersfred>"C:Program FilesMySQLMySQL Router 8.0binmysqlrouter.exe"
--bootstrap root@localhost:3310 --directory=./router
Copyright @ 2022 Oracle and/or its affiliates.
47
59. And in the new terminal we run:
C:WINDOWSsystem32>"C:Program FilesMySQLMySQL Router 8.0bin
mysqlrouter.exe" --install-service-manual
-c "C:Usersfredroutermysqlrouter.conf"
LAB 3: MySQL Router - Windows
We need to install the Windows Service to start/stop MySQL Router.
We need to open a new command terminal but as an administrator:
Copyright @ 2022 Oracle and/or its affiliates.
48
60. And in the new terminal we run:
C:WINDOWSsystem32>"C:Program FilesMySQLMySQL Router 8.0bin
mysqlrouter.exe" --install-service-manual
-c "C:Usersfredroutermysqlrouter.conf"
LAB 3: MySQL Router - Windows
We need to install the Windows Service to start/stop MySQL Router.
We need to open a new command terminal but as an administrator:
Copyright @ 2022 Oracle and/or its affiliates.
one single line command !
48
61. LAB 3: MySQL Router - Windows
And you can now start the MySQL Router service manually:
Copyright @ 2022 Oracle and/or its affiliates.
49
62. LAB 3: MySQL Router
We have the possibility to list all MySQL Router registered with our ReplicaSet:
Copyright @ 2022 Oracle and/or its affiliates.
50
63. LAB 3: MySQL Router
We will now connect MySQL Shell via MySQL Router.
We use the following ports:
Read/Write: 6446
Read/Only: 6447
We will now use 3 terminals, all with MySQL Shell.
Copyright @ 2022 Oracle and/or its affiliates.
51
64. LAB 3: MySQL Router
JS> c root@localhost:3310
[3310] JS> rs=dba.getReplicaSet()
SQL> c root@localhost:6446
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
SQL> c root@localhost:6447
[6447] SQL> select * from perconalive.t1;
+----+---------------------+------+
| id | timestamp | port |
+----+---------------------+------+
| 1 | 2022-05-04 16:30:06 | 3310 |
| 2 | 2022-05-04 20:41:15 | 3310 |
| 3 | 2022-05-04 21:27:45 | 3310 |
+----+---------------------+------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
52
65. LAB 3: MySQL Router - Change Primary (planned)
[3310] JS> rs.setPrimaryInstance('localhost:3320')
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
--> we need to reconnect
[6447] SQL> select * from perconalive.t1;
+----+---------------------+------+
| id | timestamp | port |
+----+---------------------+------+
| 1 | 2022-05-04 16:30:06 | 3310 |
| 2 | 2022-05-04 20:41:15 | 3310 |
| 3 | 2022-05-04 21:27:45 | 3310 |
| 4 | 2022-05-04 21:54:18 | 3320 |
+----+---------------------+------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
53
66. LAB 3: MySQL Router - Change Primary (failure)
JS> dba.killSandboxInstance(3320)
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
ERROR: 2013 (HY000): Lost connection to MySQL server during query
The global session got disconnected..
Attempting to reconnect to 'mysql://root@localhost:6446'..............
The global session could not be reconnected automatically.
Please use 'reconnect' instead to manually reconnect.
[6447] SQL> select * from perconalive.t1;
ERROR: 2013 (HY000): Lost connection to MySQL server during query
The global session got disconnected..
Attempting to reconnect to 'mysql://root@localhost:6447'..
The global session was successfully reconnected.
+----+---------------------+------+
| id | timestamp | port |
+----+---------------------+------+
| 1 | 2022-05-04 16:30:06 | 3310 |
...
| 4 | 2022-05-04 21:54:18 | 3320 |
+----+---------------------+------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
54
68. MySQL InnoDB Cluster
High Availability and 0 data loss
Copyright @ 2022 Oracle and/or its affiliates.
56
69. MySQL InnoDB Cluster - our needs
Our business requires to have RPO=0 and to have automatic failover in case of problem.
We still need, when possible, to o load some read queries to another instance and
eventually write on multiple MySQL instances simultaneously.
Of course, our network is reliable and the latency is small.
Copyright @ 2022 Oracle and/or its affiliates.
57
70. Based on Group Replication
Failover is Automatic
Fully integrated with MySQL Shell and
MySQL Router
Data provisioning included (CLONE)
Writing to multiple nodes is possible (not
the default)
RPO = 0 & RTO = seconds
MySQL InnoDB Cluster
Copyright @ 2022 Oracle and/or its affiliates.
58
71. MySQL Group Replication
GR is a plugin for MySQL, made by MySQL and packaged with MySQL
GR is an implementation of the Replicated Database State Machine theory
GR's protocol is based on Paxos
GR allows to write on all Group Members (cluster nodes) simultaneously while retaining
consistency
GR implements con ict detection and resolution
GR allows automatic distributed recovery
Supported on all MySQL platforms !!
Linux, Windows, Solaris, OSX, FreeBSD
Copyright @ 2022 Oracle and/or its affiliates.
59
72. MySQL Group Replication
This means that with Group Replication and MySQL InnoDB Cluster:
it's not longer necessary to handle server fail-over manually
GR provides fault tolerance
GR enables update-everywhere setups
GR handles crashes, failures, re-connects automatically
allows an easy setup of a highly available MySQL service
Copyright @ 2022 Oracle and/or its affiliates.
60
73. MySQL Group Replication
This means that with Group Replication and MySQL InnoDB Cluster:
it's not longer necessary to handle server fail-over manually
GR provides fault tolerance
GR enables update-everywhere setups
GR handles crashes, failures, re-connects automatically
allows an easy setup of a highly available MySQL service
This is a solution for High Availability !
Copyright @ 2022 Oracle and/or its affiliates.
60
75. LAB 4: MySQL InnoDB Cluster
In lab4, we will rst deploy a new MySQL instance (sandbox).
Then we will "upgrade" (replace) our MySQL InnoDB ReplicaSet to InnoDB Cluster.
After, we will join the new instance.
Finally, we will recon gure MySQL Router for the cluster.
Copyright @ 2022 Oracle and/or its affiliates.
62
76. LAB 4: MySQL InnoDB Cluster
In lab4, we will rst deploy a new MySQL instance (sandbox).
Then we will "upgrade" (replace) our MySQL InnoDB ReplicaSet to InnoDB Cluster.
After, we will join the new instance.
Finally, we will recon gure MySQL Router for the cluster.
Let's restart the sandbox (3320) we killed at the end of lab 3:
JS> dba.startSandboxInstance(3320)
Copyright @ 2022 Oracle and/or its affiliates.
62
77. LAB 4: MySQL InnoDB Cluster
< >
Copyright @ 2022 Oracle and/or its affiliates.
If there is an error, where can I find more info ?
63
78. LAB 4: MySQL InnoDB Cluster
< >
Copyright @ 2022 Oracle and/or its affiliates.
If there is an error, where can I find more info ?
With MySQL 8.0, you can parse the error log directly from SQL. Try this:
select * from performance_schema.error_log order by logged desc limit 10;
63
79. Deploy a new MySQL instance next to our
current MySQL InnoDB ReplicaSet
JS> dba.deploySandboxInstance(3330,
{password: 'MySQL123'})
LAB 4: MySQL InnoDB Cluster
Copyright @ 2022 Oracle and/or its affiliates.
64
80. We dissolve the MySQL InnoDB ReplicaSet:
On the Primary:
[3310] JS> dba.dropMetadataSchema()
On the Secondary:
[3320] SQL> stop replica;
[3320] SQL> reset replica all;
LAB 4: MySQL InnoDB Cluster - dissolve
Copyright @ 2022 Oracle and/or its affiliates.
65
81. We now create the new
MySQL InnoDB Cluster:
On the Primary:
[3310] JS> cluster=dba.createCluster(
'mycluster')
[3310] JS> cluster.addInstance(
'localhost:3320')
[3310] JS> cluster.status()
LAB 4: MySQL InnoDB Cluster - creation
Copyright @ 2022 Oracle and/or its affiliates.
66
82. We add the third instance to our new
MySQL InnoDB Cluster.
For automatic HA, we need to have at least 3 nodes and an odd
amount of nodes is recommended.
On the new instance
JS> c root@localhost:3330
[3330] JS> dba.configureInstance()
[3330] JS> c root@localhost:3310
[3310] JS> cluster=dba.getCluster()
[3310] JS> cluster.addInstance(
'localhost:3330')
[3310] JS> cluster.status()
LAB 4: MySQL InnoDB Cluster - creation
Copyright @ 2022 Oracle and/or its affiliates.
67
83. LAB 4: MySQL InnoDB Cluster - status
Copyright @ 2022 Oracle and/or its affiliates.
68
84. It's time to recon gure and restart MySQL
Router
$ sudo mysqlrouter --bootstrap
root@localhost:3310
--user mysqlrouter
--conf-use-gr-notifications
--force
$ sudo systemctl restart mysqlrouter
LAB 4: MySQL InnoDB Cluster - Router
Copyright @ 2022 Oracle and/or its affiliates.
69
86. LAB 5: MySQL InnoDB Cluster
We will now connect again MySQL Shell via MySQL Router.
We use the following ports (same as for ClusterSet):
Read/Write: 6446
Read/Only: 6447
And we will still use 3 terminals with MySQL Shell.
Copyright @ 2022 Oracle and/or its affiliates.
71
87. LAB 5: MySQL InnoDB Cluster
JS> c root@localhost:3310
[3310] JS> cluster=dba.getCluster()
SQL > c root@localhost:6446
[6446] SQL > insert into perconalive.t1 (port) values (@@port);
SQL > c root@localhost:6447
[6447] SQL> select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 7 | 2022-05-05 14:24:54 | 3310 | 3330 |
+----+---------------------+------+-----------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
72
88. LAB 5: MySQL InnoDB Cluster - change Primary
[3310] JS> cluster.setPrimaryInstance('localhost:3320')
--> reconnect
[6446] SQL > insert into perconalive.t1 (port) values (@@port);
[6447] SQL > select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 8 | 2022-05-05 14:35:03 | 3320 | 3330 |
+----+---------------------+------+-----------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
73
89. LAB 5: MySQL InnoDB Cluster - failure
[3310] JS> dba.killSandboxInstance(3320)
--> reconnect
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
[6447] SQL> select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 9 | 2022-05-05 14:38:16 | 3310 | 3330 |
+----+---------------------+------+-----------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
74
90. LAB 5: MySQL InnoDB Cluster - failure
[3310] JS> dba.killSandboxInstance(3320)
--> reconnect
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
[6447] SQL> select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 9 | 2022-05-05 14:38:16 | 3310 | 3330 |
+----+---------------------+------+-----------+
Don't forget to check the output of cluster.status() !
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
74
91. LAB 5: MySQL InnoDB Cluster - mode
[3310] JS> dba.startSandboxInstance(3320)
[3310] JS> cluster.switchToMultiPrimaryMode()
--> reconnect
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
[6447] SQL> select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 10 | 2022-05-05 14:44:04 | 3310 | 3330 |
+----+---------------------+------+-----------+
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
75
92. LAB 5: MySQL InnoDB Cluster - mode
[3310] JS> dba.startSandboxInstance(3320)
[3310] JS> cluster.switchToMultiPrimaryMode()
--> reconnect
[6446] SQL> insert into perconalive.t1 (port) values (@@port);
[6447] SQL> select *, @@port `read_from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read_from |
+----+---------------------+------+-----------+
| 10 | 2022-05-05 14:44:04 | 3310 | 3330 |
+----+---------------------+------+-----------+
Don't forget to check the output of cluster.status() !
Copyright @ 2022 Oracle and/or its affiliates.
RW: 6446
RO: 6447
75
93. LAB 5: MySQL InnoDB Cluster - mode
< >
Copyright @ 2022 Oracle and/or its affiliates.
I'm trying to write multiple times... even making new connections but it seems
all writes are made on same instance, I expected to write on all nodes !
76
94. LAB 5: MySQL InnoDB Cluster - mode
< >
Copyright @ 2022 Oracle and/or its affiliates.
I'm trying to write multiple times... even making new connections but it seems
all writes are made on same instance, I expected to write on all nodes !
All nodes have the possibility to receive writes, the default policy it to always
use the first one. Try to change the strategy for [routing:bootstrap_rw] to
routing_strategy=round-robin in router's config file and restart it.
76
95. MySQL InnoDB ClusterSet
High Availability and Disaster Recovery
Copyright @ 2022 Oracle and/or its affiliates.
77
96. MySQL InnoDB ClusterSet
High Availability is perfect ! But this is within a region... what can we do in case of
datacenter issue ?
And how do we deal with all the topoly changes ?
And data provisioning ?
Copyright @ 2022 Oracle and/or its affiliates.
78
100. We need to deploy 3 new
instances (secondary region).
JS> dba.deploySandboxInstance(4410,
{password: 'MySQL123'})
JS> dba.deploySandboxInstance(4420,
{password: 'MySQL123'})
JS> dba.deploySandboxInstance(4430,
{password: 'MySQL123'})
LAB6: MySQL InnoDB ClusterSet - deploy
Copyright @ 2022 Oracle and/or its affiliates.
82
101. LAB6: MySQL InnoDB ClusterSet - creation
Before the creation of the MySQL InnoDB ClusterSet we need to switch back our Cluster to
Single-Primary mode:
JS> c root@localhost:3301
[3310] JS> cluster.getCluster()
[3310] JS> cluster.switchToSinglePrimaryMode()
Now we can create our new ClusterSet. This is a method of a cluster object:
[3310] JS> cs=cluster.createClusterSet('mydomain')
Copyright @ 2022 Oracle and/or its affiliates.
83
102. This illustrates what we just
created.
Let's have a look at the status
of our new ClusterSet:
LAB6: MySQL InnoDB ClusterSet - creation
Copyright @ 2022 Oracle and/or its affiliates.
84
103. LAB6: MySQL InnoDB ClusterSet
Like for the other status() methods, ClusterSet supports the extended option.
Please try the following commands:
[3310] JS> cs.status{extended: 1})
[3310] JS> cs.status{extended: 2})
[3310] JS> cs.status{extended: 3})
Copyright @ 2022 Oracle and/or its affiliates.
85
104. LAB6: MySQL InnoDB ClusterSet
Like for the other status() methods, ClusterSet supports the extended option.
Please try the following commands:
[3310] JS> cs.status{extended: 1})
[3310] JS> cs.status{extended: 2})
[3310] JS> cs.status{extended: 3})
Get more info with cs.help('status')
or ? clusterset.status
Copyright @ 2022 Oracle and/or its affiliates.
85
105. It's time to create the Replica
Cluster. We start by adding one
instance from the other region:
JS> cluster2=
cs.createReplicaCluster(
'localhost:4420',
'mycluster2')
LAB6: MySQL InnoDB ClusterSet - Replica Cluster
Copyright @ 2022 Oracle and/or its affiliates.
86
106. LAB6: MySQL InnoDB ClusterSet - Replica Cluster
Copyright @ 2022 Oracle and/or its affiliates.
87
107. We need to add the other 2
instances to our Secondary
Cluster:
JS> cluster2.addInstance(
'localhost:4410')
JS> cluster2.addInstance(
'localhost:4430')
LAB6: MySQL InnoDB ClusterSet - Replica Cluster
Copyright @ 2022 Oracle and/or its affiliates.
88
109. LAB7: MySQL InnoDB ClusterSet - Router
What about the MySQL Router ? We already have one bootstrapped and running ?
Copyright @ 2022 Oracle and/or its affiliates.
90
110. LAB7: MySQL InnoDB ClusterSet - Router
Let's replace the con guration again:
$ sudo mysqlrouter --bootstrap root@localhost:3310
--user mysqlrouter --conf-use-gr-notifications --force
And restart MySQL Router:
$ sudo systemctl restart mysqlrouter
Copyright @ 2022 Oracle and/or its affiliates.
91
111. LAB7: MySQL InnoDB ClusterSet - Routing
MySQL InnoDB ClusterSet provides the possibility to de ne routing policies per Router
being registered in the ClusterSet.
Those Routing Policies can be changed ONLINE within MySQL Shell.
In a ClusterSet you can deploy 2 types of Routers:
targeting the PRIMARY to send writes to the PRIMARY cluster (and the PRIMARY node in
it)
targeting a speci c cluster to keep tra c local for example (writes not allowed)
It's also possible to de ne a policiy for INVALIDATED clusters.
Copyright @ 2022 Oracle and/or its affiliates.
92
112. LAB7: MySQL InnoDB ClusterSet - Routing Options
We can use the routingOptions() method of the ClusterSet object to list the current
routing policies:
Copyright @ 2022 Oracle and/or its affiliates.
93
113. LAB7: MySQL InnoDB ClusterSet - Routing Options
We can use the routingOptions() method of the ClusterSet object to list the current
routing policies:
Let's change the Policy of our MySQL Router to only send tra c to our local datacenter in
region 2:
JS> cs.setRoutingOption('imac::system', 'target_cluster', 'mycluster2')
Routing option 'target_cluster' successfully updated in router 'imac::system'.
Copyright @ 2022 Oracle and/or its affiliates.
Region 1
3310, 3320, 3330
Region 2
4410, 4420, 4430
93
114. SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 50 | 2022-05-05 14:46:52 | 3330 | 4410 |
+----+---------------------+------+-----------+
1 row in set (0.0006 sec)
SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 50 | 2022-05-05 14:46:52 | 3330 | 4420 |
+----+---------------------+------+-----------+
1 row in set (0.0006 sec)
LAB7: MySQL InnoDB ClusterSet - Routing Options
Now try to connect with MySQL Shell on port 6446 and 6447:
SQL> c root@localhost:6446
As the routing target is not PRIMARY (or not the Primary cluster) writes
are not allowed !
Copyright @ 2022 Oracle and/or its affiliates.
cs.setRoutingOption('imac::system',
'target_cluster', 'mycluster2')
94
115. SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 50 | 2022-05-05 14:46:52 | 3330 | 4410 |
+----+---------------------+------+-----------+
1 row in set (0.0006 sec)
SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 50 | 2022-05-05 14:46:52 | 3330 | 4420 |
+----+---------------------+------+-----------+
1 row in set (0.0006 sec)
LAB7: MySQL InnoDB ClusterSet - Routing Options
Now try to connect with MySQL Shell on port 6446 and 6447:
SQL> c root@localhost:6446
As the routing target is not PRIMARY (or not the Primary cluster) writes
are not allowed !
Copyright @ 2022 Oracle and/or its affiliates.
cs.setRoutingOption('imac::system',
'target_cluster', 'mycluster2')
Don´t forget to set back the Routing Policy to PRIMARY:
JS> cs.setRoutingOption('imac::system', 'target_cluster', 'primary')
Routing option 'target_cluster' successfully updated in router 'imac::system'.
94
117. SQL> c root@localhost:6446
SQL> insert into perconalive.t1 (port)
values (@@port);
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 52 | 2022-05-06 09:50:36 | 4410 | 4410 |
+----+---------------------+------+-----------+
SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 52 | 2022-05-06 09:50:36 | 4410 | 4430 |
+----+---------------------+------+-----------+
LAB8: MySQL InnoDB ClusterSet - Region Switch
Now we will see how we can switch the PRIMARY role to another region. First as a planned
operation and then after a huge failure.
Planned Region Switch
JS> cs.setPrimaryCluster('mycluster2')
Copyright @ 2022 Oracle and/or its affiliates.
96
118. LAB8: MySQL InnoDB ClusterSet - Region Switch
Output Example
Copyright @ 2022 Oracle and/or its affiliates.
97
119. Now we can check the status:
LAB8: MySQL InnoDB ClusterSet - Region Switch
Unplanned Region Switch
Simulate the issue:
JS> dba.killSandboxInstance(4410);dba.killSandboxInstance(4420);dba.killSandboxInstance(4430)
Copyright @ 2022 Oracle and/or its affiliates.
98
120. LAB8: MySQL InnoDB ClusterSet - Region Switch
Unplanned Region Switch
We need to force the available secondary region to take over:
JS> cs.forcePrimaryCluster('mycluster')
Copyright @ 2022 Oracle and/or its affiliates.
99
121. SQL> c root@localhost:6446
SQL> insert into perconalive.t1 (port)
values (@@port);
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 53 | 2022-05-06 10:28:37 | 3310 | 3310 |
+----+---------------------+------+-----------+
SQL> c root@localhost:6447
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 53 | 2022-05-06 10:28:37 | 3310 | 3320 |
+----+---------------------+------+-----------+
SQL> reconnect
SQL> select *, @@port `read from`
from perconalive.t1 order by id desc limit 1;
+----+---------------------+------+-----------+
| id | timestamp | port | read from |
+----+---------------------+------+-----------+
| 53 | 2022-05-06 10:28:37 | 3310 | 3330 |
+----+---------------------+------+-----------+
LAB8: MySQL InnoDB ClusterSet - Region Switch
We can perform again read and writes via MySQL Router:
Copyright @ 2022 Oracle and/or its affiliates.
100
122. Now we can check the status:
LAB8: MySQL InnoDB ClusterSet - Region Switch
Unplanned Region Switch
When the o ine region is back:
JS> dba.startSandboxInstance(4410);dba.startSandboxInstance(4420);dba.startSandboxInstance(4430)
Copyright @ 2022 Oracle and/or its affiliates.
101
123. JS> c root@localhost:4410
JS > mycluster2=dba.rebootClusterFromCompleteOutage()
The cluster will rejoin automatically the
ClusterSet.
JS> dba.getClusterSet().status()
LAB8: MySQL InnoDB ClusterSet - Region Switch
Unplanned Region Switch
Now we need to connect to one instance of the cluster that failed and restart the cluster:
Copyright @ 2022 Oracle and/or its affiliates.
102
125. LAB9: MySQL InnoDB ClusterSet - Complete Outage
If everything was abruptly stopped, how can we put back the system ?
Copyright @ 2022 Oracle and/or its affiliates.
104
126. LAB9: MySQL InnoDB ClusterSet - Complete Outage
Copyright @ 2022 Oracle and/or its affiliates.
105
127. LAB9: MySQL InnoDB ClusterSet - Complete Outage
Copyright @ 2022 Oracle and/or its affiliates.
106
128. LAB9: MySQL InnoDB ClusterSet - Complete Outage
Copyright @ 2022 Oracle and/or its affiliates.
107
129. LAB9: MySQL InnoDB ClusterSet - Complete Outage
Copyright @ 2022 Oracle and/or its affiliates.
108