SlideShare una empresa de Scribd logo
1 de 101
Descargar para leer sin conexión
1 / 49
2 / 492 / 49
 
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for information purpose 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 up
in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle´s
product remains at the sole discretion of Oracle.
3 / 49
Past, Present & Future
4 / 49
Past, Present & Future
In The Past - MANUAL
Setting up Replication topology was done manually, taking many steps
including user management, restoring backups, configuring replication...
MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture
This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating
4 / 49
Past, Present & Future
In The Past - MANUAL
Setting up Replication topology was done manually, taking many steps
including user management, restoring backups, configuring replication...
MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture
This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating
2016 - MySQL InnoDB Cluster
Group Replication: Automatic membership changes, network partition handling, consistency...
Shell to provide a powerful interface that helps in automating an integrating all components
InnoDB CLONE to automatically provision members, fully integrated in InnoDB
4 / 49
Past, Present & Future
In The Past - MANUAL
Setting up Replication topology was done manually, taking many steps
including user management, restoring backups, configuring replication...
MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture
This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating
2016 - MySQL InnoDB Cluster
Group Replication: Automatic membership changes, network partition handling, consistency...
Shell to provide a powerful interface that helps in automating an integrating all components
InnoDB CLONE to automatically provision members, fully integrated in InnoDB
2020 - MySQL InnoDB ReplicaSet
'classic', 'asynchronous' Replication based Solution, fully integrated
4 / 49
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
5 / 49
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
5 / 49
Components:
MySQL Server
MySQL Group Replication
MySQL Shell
MySQL Router
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
5 / 49
One Product: MySQL
All components developed together
Integration of all components
Full stack testing
MySQL InnoDB Cluster - Goals
6 / 49
One Product: MySQL
All components developed together
Integration of all components
Full stack testing
Easy to Use
One client: MySQL Shell
Integrated orchestration
Homogenous servers
MySQL InnoDB Cluster - Goals
6 / 49
Introducing MySQL InnoDB ReplicaSet!
8.0.19 Feature!
Fully integrated MySQL Router
Automatic Routing
Ease of use with MySQL Shell
Configuring, Adding, Removing members
Automatic Member Provisioning (CLONE)
Replication Architecture:
(manual) Switchover & Failover
(asynchronous) Read Scaleout
'Simple' Replication architecture:
no network/hardware requirements
Providing Availability on PRIMARY when
issues with secondaries or network
MySQL InnoDB ReplicaSet
7 / 49
Past MySQL InnoDB ReplicaSet
Restore a backup to provision a member Automatically provisioning new members:
InnoDB CLONE
MySQL InnoDB ReplicaSet - Features
8 / 49
Past MySQL InnoDB ReplicaSet
Restore a backup to provision a member Automatically provisioning new members:
InnoDB CLONE
Configure Replication Users
Configure Replication
MySQL Shell Automatically configures users &
replication
MySQL InnoDB ReplicaSet - Features
8 / 49
Past MySQL InnoDB ReplicaSet
Restore a backup to provision a member Automatically provisioning new members:
InnoDB CLONE
Configure Replication Users
Configure Replication
MySQL Shell Automatically configures users &
replication
Manually configuring, adding removing servers in
Application, MySQL Router (or other proxy)
Integrated MySQL Router load balancing
Only need to bootstrap Router
Router is stateless, adapts to topology changes
MySQL InnoDB ReplicaSet - Features
8 / 49
Past MySQL InnoDB ReplicaSet
Restore a backup to provision a member Automatically provisioning new members:
InnoDB CLONE
Configure Replication Users
Configure Replication
MySQL Shell Automatically configures users &
replication
Manually configuring, adding removing servers in
Application, MySQL Router (or other proxy)
Integrated MySQL Router load balancing
Only need to bootstrap Router
Router is stateless, adapts to topology changes
Manually or relying on external tools to make topology
changes
Easy to use manual switchover/failover
MySQL InnoDB ReplicaSet - Features
8 / 49
Past MySQL InnoDB ReplicaSet
Restore a backup to provision a member Automatically provisioning new members:
InnoDB CLONE
Configure Replication Users
Configure Replication
MySQL Shell Automatically configures users &
replication
Manually configuring, adding removing servers in
Application, MySQL Router (or other proxy)
Integrated MySQL Router load balancing
Only need to bootstrap Router
Router is stateless, adapts to topology changes
Manually or relying on external tools to make topology
changes
Easy to use manual switchover/failover
Use additional monitoring tool log in on all machines to
check topology status
See status of the topology through MySQL Shell
status()
MySQL InnoDB ReplicaSet - Features
8 / 49
Past MySQL InnoDB ReplicaSet
MySQL InnoDB ReplicaSet - Features
9 / 49
Past MySQL InnoDB ReplicaSet
complexity: user is responsible for the full configuration
of every component and it's settings
Shell configures Server, Router, Replication in a
standardized best practice setup, prevents mistakes
MySQL InnoDB ReplicaSet - Features
9 / 49
Past MySQL InnoDB ReplicaSet
complexity: user is responsible for the full configuration
of every component and it's settings
Shell configures Server, Router, Replication in a
standardized best practice setup, prevents mistakes
every setup is a customized setup Standard Solution -- Supported & QA'ed by Oracle
MySQL InnoDB ReplicaSet - Features
9 / 49
Past MySQL InnoDB ReplicaSet
complexity: user is responsible for the full configuration
of every component and it's settings
Shell configures Server, Router, Replication in a
standardized best practice setup, prevents mistakes
every setup is a customized setup Standard Solution -- Supported & QA'ed by Oracle
A lot of manual steps and additional software required,
always customized and often overengineered by MySQL
DBA's
Easy to use, even for MySQL beginner
MySQL InnoDB ReplicaSet - Features
9 / 49
MySQL InnoDB ReplicaSet - Requirements & Limitations
Requirements:
MySQL 8 (SET PERSIST!)
GTID
Limitations:
Manual failover -- which is a good thing
No coordination between servers mandates external arbitration
No multi-primary as such topology cannot guarantee data consistency
No data reconciliation
No conflict handling
All secondary members replicate from primary
Single tiered replication support.
10 / 49
Transparent Access to Database Arch.
"provide transparent routing between your application and
back-end MySQL Servers"
Transparent client connection routing
Load balancing
Application connection failover
Little to no configuration needed
Stateless design offers easy HA client routing
Router as part of the application stack
Integration into InnoDB Cluster & InnoDB ReplicaSet
Understands Group Replication & Replication
topology
Currently TCP Port each for PRIMARY and NON-PRIMARY
traffic
MySQL Router
11 / 49
Database Administration Interface
"MySQL Shell provides the developer and DBA with a single
intuitive, flexible, and powerful interface for all MySQL
related tasks!"
Multi-Language: JavaScript, Python, and SQL
Naturally scriptable
Supports Document and Relational models
Exposes full Development and Administration APIs
Classic MySQL protocol and X protocol
MySQL Shell
12 / 49
Preparing Your Environment
13 / 49
1. Install VirtualBox, Start Image
ssh mysqltutorial@localhost -p 2222
Password
password: mysql
3. Start MySQL Shell
$ docker-compose run mysqlsh
2. Check consul http://localhost:8500
Preparing Your Environment
14 / 49
MySQL Shell
15 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
2. Check the dba object help
mysql-js> help dba
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
2. Check the dba object help
mysql-js> help dba
3. Switch operating modes
mysql-js> py
mysql-py> sql
mysql-sql> js
mysql-js> sql SELECT 1;
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
2. Check the dba object help
mysql-js> help dba
3. Switch operating modes
mysql-js> py
mysql-py> sql
mysql-sql> js
mysql-js> sql SELECT 1;
4. Try auto-completion
mysql-js> dba.<tab>
mysql-js> shell.<tab>
mysql-js> util.<tab>
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
2. Check the dba object help
mysql-js> help dba
3. Switch operating modes
mysql-js> py
mysql-py> sql
mysql-sql> js
mysql-js> sql SELECT 1;
4. Try auto-completion
mysql-js> dba.<tab>
mysql-js> shell.<tab>
mysql-js> util.<tab>
5. Check Shell options
mysql-js> shell.options
MySQL Shell
16 / 49
0. Connect to an instance
mysql-js> c root@server_1:3306
1. Check the helper
mysql-js> help
2. Check the dba object help
mysql-js> help dba
3. Switch operating modes
mysql-js> py
mysql-py> sql
mysql-sql> js
mysql-js> sql SELECT 1;
4. Try auto-completion
mysql-js> dba.<tab>
mysql-js> shell.<tab>
mysql-js> util.<tab>
5. Check Shell options
mysql-js> shell.options
6. Check history
mysql-js> history
MySQL Shell
16 / 49
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
17 / 49
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
1. Configure MySQL instances for ReplicaSet usage
mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306")
18 / 49
2. Create the ReplicaSet
mysql-js> c root@server_1:3306
mysql-js> rs = dba.createReplicaSet("replicaset")
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
1. Configure MySQL instances for ReplicaSet usage
mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306")
18 / 49
2. Create the ReplicaSet
mysql-js> c root@server_1:3306
mysql-js> rs = dba.createReplicaSet("replicaset")
3. Check ReplicaSet status
mysql-js> rs.status()
...
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
1. Configure MySQL instances for ReplicaSet usage
mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306")
18 / 49
2. Create the ReplicaSet
mysql-js> c root@server_1:3306
mysql-js> rs = dba.createReplicaSet("replicaset")
3. Check ReplicaSet status
mysql-js> rs.status()
...
4. Add instances to the ReplicaSet
mysql-js> rs.addInstance("root@server_2:3306")
mysql-js> rs.addInstance("root@server_3:3306")
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
1. Configure MySQL instances for ReplicaSet usage
mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306")
18 / 49
2. Create the ReplicaSet
mysql-js> c root@server_1:3306
mysql-js> rs = dba.createReplicaSet("replicaset")
3. Check ReplicaSet status
mysql-js> rs.status()
...
4. Add instances to the ReplicaSet
mysql-js> rs.addInstance("root@server_2:3306")
mysql-js> rs.addInstance("root@server_3:3306")
5. Check ReplicaSet status again
mysql-js> rs.status()
...
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
1. Configure MySQL instances for ReplicaSet usage
mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306")
mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306")
18 / 49
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
19 / 49
6. Bootstrap Routers
$ docker-compose up -d --scale router-rs=2 router-rs
Note: SSH to the VM in a new tab
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
20 / 49
6. Bootstrap Routers
$ docker-compose up -d --scale router-rs=2 router-rs
Note: SSH to the VM in a new tab
7. Check registered Routers
mysql-js> rs.listRouters()
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
20 / 49
6. Bootstrap Routers
$ docker-compose up -d --scale router-rs=2 router-rs
Note: SSH to the VM in a new tab
7. Check registered Routers
mysql-js> rs.listRouters()
8. Run Application - Primary Traffic
$ docker-compose run app
Note: run this app in separate terminal so you can watch this
at all times
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
20 / 49
9. Ensure Routers are OK
http://localhost:8500
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
21 / 49
10. Change ReplicaSet primary instance
mysql-js> rs.setPrimaryInstance("server_3:3306")
Note: App will automatically get redirected to the new
primary. As it's a manual switchover, no split brain
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
22 / 49
10. Change ReplicaSet primary instance
mysql-js> rs.setPrimaryInstance("server_3:3306")
Note: App will automatically get redirected to the new
primary. As it's a manual switchover, no split brain
11. Check ReplicaSet status
mysql-js> rs.status()
...
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
22 / 49
MySQL InnoDB ReplicaSet - MySQL Router Integration
--bootstrap to automatically configure
Metadata schema contains Replication Topology
Health checks are performed to all members
Switchover to new primary (setPrimaryInstance()):
Shell performs topology change, configures super_read_only and updates view_id in metadata
Router automatically sees higher view_id
and will redirect primary traffic to new primary
When the Primary is lost: forcePrimaryInstance()
Shell performs topology change, updates view_id in metadata and invalidates lost primary
Router will notice topology change by higher view_id in metadata (if network allows)
and automatically connect to new Primary
23 / 49
12. Take down primary instance
$ docker-tc post mysqltutorial_server_3_1 loss=100%
Note: App will have errors
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
24 / 49
12. Take down primary instance
$ docker-tc post mysqltutorial_server_3_1 loss=100%
Note: App will have errors
13. Get ReplicaSet object, check status
mysql-js> reconnect
mysql-js> rs = dba.getReplicaSet()
mysql-js> rs.status()
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
24 / 49
14. Force Failover
mysql-js> rs.forcePrimaryInstance("server_1:3306")
Note: App will reconnect to new Primary
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
25 / 49
14. Force Failover
mysql-js> rs.forcePrimaryInstance("server_1:3306")
Note: App will reconnect to new Primary
15. Check Status
mysql-js> rs.status()
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
25 / 49
14. Force Failover
mysql-js> rs.forcePrimaryInstance("server_1:3306")
Note: App will reconnect to new Primary
15. Check Status
mysql-js> rs.status()
16. Bring back Server 3
$ docker-tc delete mysqltutorial_server_3_1
mysql-js> rs.status()
Note: App will not connect to invalidated old Primary
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
25 / 49
By design chosen to be Manual failover
Having external monitoring processes decide failover can
cause a lot of false positives.
External tool decides, if the tool has issues: even
bigger issues.
Split brain issues
Majority of production deployments are configured
with Manual Failover, which increases Uptime!
When automatic failover is needed:
use MySQL InnoDB Cluster instead of Semi-Sync
MySQL InnoDB ReplicaSet - Manual Failover
26 / 49
Example:
1 Primary, 2 Secondaries, 2 Proxy hosts (App servers)
1 Management server: monitoring and making Topology
changes automatically
Problem: Management server & replica server is partitioned
from all other servers
What will happen?
MySQL InnoDB ReplicaSet - Manual Failover
27 / 49
Example:
1 Primary, 2 Secondaries, 2 Proxy hosts (App servers)
1 Management server: monitoring and making Topology
changes automatically
Problem: Management server & replica server is partitioned
from all other servers
What will happen?
The management host might promote the secondary
causing split brain
use MySQL InnoDB Cluster over Semi-Sync
With semi-sync, all members have to ack (prevent split
brain), causing downtime with every small glitch
MySQL InnoDB ReplicaSet - Manual Failover
28 / 49
17. Rejoin instance back to the ReplicaSet
mysql-js> rs.rejoinInstance("server_3:3306")
Note: there is no guarantee there is no split brain, but is
minimized due to Router logic
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
29 / 49
17. Rejoin instance back to the ReplicaSet
mysql-js> rs.rejoinInstance("server_3:3306")
Note: there is no guarantee there is no split brain, but is
minimized due to Router logic
18. Verify the ReplicaSet status
mysql-js> rs.status()
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
29 / 49
17. Rejoin instance back to the ReplicaSet
mysql-js> rs.rejoinInstance("server_3:3306")
Note: there is no guarantee there is no split brain, but is
minimized due to Router logic
18. Verify the ReplicaSet status
mysql-js> rs.status()
19. Stop Routers
$ docker-compose stop router-rs
20. Dissolve ReplicaSet
mysql-js> rs.dissolve()
MySQL InnoDB ReplicaSet - Hands-on Tutorial!
29 / 49
MySQL InnoDB Cluster
30 / 49
Components:
MySQL Server
MySQL Group Replication
MySQL Shell
MySQL Router
MySQL InnoDB Cluster
"A single product — MySQL — with high availability and scaling features baked in;
providing an integrated end-to-end solution that is easy to use."
31 / 49
Many of our customers have adopted InnoDB Cluster!
Fully integrated MySQL Router
Automatic Routing
Ease of use with MySQL Shell
Configuring, Adding, Removing members
Group Replication Architecture
Providing Consistency
Automatic Failover
Network Partition Handling
No data loss in case of failure
Automatic Member Provisioning (CLONE)
MySQL InnoDB Cluster
32 / 49
MySQL Group Replication
33 / 49
High Available Distributed MySQL DB
Fault tolerance
Automatic failover
Active/Active update anywhere (limits apply)
Automatic membership management
Adding/removing members
Network partitions, failures
Conflict detection and resolution
Prevents data loss
MySQL Group Replication
33 / 49
MySQL Group Replication
Implementation of Replicated Database State Machine
Total Order - Writes
XCOM - Paxos implementation
Configurable Consistency Guarantees
eventual consistency
8.0+: per session & global read/write consistency
Using MySQL replication framework by design
binary logs
relay logs
GTIDs: Global Transaction IDs
Generally Available since MySQL 5.7
Supported on all platforms: linux, windows, solaris, macosx, freebsd
34 / 49
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
MySQL Group Replication - Use Cases
35 / 49
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
MySQL Group Replication - Use Cases
35 / 49
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
Read Scaleout
Add/Remove members as needed
Replication Lag handling with Flow Control
Configurable Consistency Levels
Eventual
Full Consistency -- no stale reads
MySQL Group Replication - Use Cases
35 / 49
Consistency: No Data Loss (RPO=0)
in event of failure of (primary) member
Split brain prevention (Quorum)
Highly Available: Automatic Failover
Primary members are automatically elected
Automatic Network Partition handling
Read Scaleout
Add/Remove members as needed
Replication Lag handling with Flow Control
Configurable Consistency Levels
Eventual
Full Consistency -- no stale reads
Active/Active environments
Write to many members at the same time
ordered writes within the group (XCOM)
guaranteed consistency
Good write performance
due to Optimistic Locking
(workload dependent)
MySQL Group Replication - Use Cases
35 / 49
MySQL InnoDB Cluster - Evolving
36 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
37 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
1. Configure MySQL instances for Cluster usage
mysql-js> dba.con gureInstance("root@server_1:3306")
mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true})
mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true})
Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O
38 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
1. Configure MySQL instances for Cluster usage
mysql-js> dba.con gureInstance("root@server_1:3306")
mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true})
mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true})
Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O
2. Create the Cluster:
mysql-js> c root@server_1
mysql-js> c = dba.createCluster("cluster")
38 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
1. Configure MySQL instances for Cluster usage
mysql-js> dba.con gureInstance("root@server_1:3306")
mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true})
mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true})
Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O
2. Create the Cluster:
mysql-js> c root@server_1
mysql-js> c = dba.createCluster("cluster")
3. Add server_2 to the Cluster
mysql-js> c.addInstance('server_2')
38 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
4. Let's purge the binary logs, to force CLONE
mysql-js> sql
mysql-sql> CREATE DATABASE app;
mysql-sql> FLUSH BINARY LOGS;
mysql-sql> PURGE BINARY LOGS BEFORE NOW();
mysql-sql> c root@server_2
mysql-sql> FLUSH BINARY LOGS;
mysql-sql> PURGE BINARY LOGS BEFORE NOW();
mysql-sql> c root@server_1
mysql-js> js
39 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
4. Let's purge the binary logs, to force CLONE
mysql-js> sql
mysql-sql> CREATE DATABASE app;
mysql-sql> FLUSH BINARY LOGS;
mysql-sql> PURGE BINARY LOGS BEFORE NOW();
mysql-sql> c root@server_2
mysql-sql> FLUSH BINARY LOGS;
mysql-sql> PURGE BINARY LOGS BEFORE NOW();
mysql-sql> c root@server_1
mysql-js> js
5. Add server_3
mysql-js> c.addInstance('server_3')
Note: binary logs will be missing and CLONE will have to be used to provision server_2
39 / 49
6. Check Cluster status
mysql-js> c.status()
MySQL InnoDB Cluster - Hands-on Tutorial!
40 / 49
6. Check Cluster status
mysql-js> c.status()
7. Deploy MySQL Router
$ docker-compose up -d --scale router=2 router
MySQL InnoDB Cluster - Hands-on Tutorial!
40 / 49
6. Check Cluster status
mysql-js> c.status()
7. Deploy MySQL Router
$ docker-compose up -d --scale router=2 router
8. List Routers
mysql-js> c.listRouters()
MySQL InnoDB Cluster - Hands-on Tutorial!
40 / 49
6. Check Cluster status
mysql-js> c.status()
7. Deploy MySQL Router
$ docker-compose up -d --scale router=2 router
8. List Routers
mysql-js> c.listRouters()
9. Start the App (if needed)
$ docker-compose run app
MySQL InnoDB Cluster - Hands-on Tutorial!
40 / 49
10. Scale-out Router!
$ docker-compose up -d --scale router=4 router
MySQL InnoDB Cluster - Hands-on Tutorial!
41 / 49
10. Scale-out Router!
$ docker-compose up -d --scale router=4 router
11. Check database-router-rw service status
http://localhost:8500
MySQL InnoDB Cluster - Hands-on Tutorial!
41 / 49
10. Scale-out Router!
$ docker-compose up -d --scale router=4 router
11. Check database-router-rw service status
http://localhost:8500
12. Scale-down Router again
$ docker-compose up -d --scale router=2 router
MySQL InnoDB Cluster - Hands-on Tutorial!
41 / 49
DNS-SRV Support in Connectors
New in MySQL 8.0.19 Connectors!
42 / 49
MySQL InnoDB Cluster - Hands-on Tutorial!
13. Look at Cluster Options
mysql-js> c.options()
Note: there are global & server specific options
14. Set Best practices
mysql-js> c.setOption("expelTimeout", 5)
mysql-js> c.setOption("autoRejoinTries", 3)
Best Practices are covered on https://www.slideshare.net/Grypyrg/mysql-innodb-cluster-new-features-in-80-releases-best-practices
43 / 49
15. Switch primary manually
mysql-js> c.setPrimaryInstance("server_3:3306")
MySQL InnoDB Cluster - Hands-on Tutorial!
44 / 49
16. Take down primary instance
$ docker-tc post mysqltutorial_server_3_1 loss=100%
MySQL InnoDB Cluster - Hands-on Tutorial!
45 / 49
16. Take down primary instance
$ docker-tc post mysqltutorial_server_3_1 loss=100%
17. Check partitioned server logs
$ docker logs -f mysqltutorial_server_3_1
MySQL InnoDB Cluster - Hands-on Tutorial!
45 / 49
16. Take down primary instance
$ docker-tc post mysqltutorial_server_3_1 loss=100%
17. Check partitioned server logs
$ docker logs -f mysqltutorial_server_3_1
18. Bring primary back
$ docker-tc delete mysqltutorial_server_3_1
Note: Instance will automatically rejoin
MySQL InnoDB Cluster - Hands-on Tutorial!
45 / 49
19. Switch to multi-primary mode
mysql-js> c.switchToMultiPrimaryMode()
Note: App writes will be sent to every cluster member
20. Switch back to single-primary mode
mysql-js> c.switchToSinglePrimaryMode()
MySQL InnoDB Cluster - Hands-on Tutorial!
46 / 49
What to choose?
MySQL InnoDB Cluster
or
MySQL InnoDB ReplicaSet
47 / 49
Recovery Time Objective (RTO)
How fast should the service recover from a failure
Recovery Point Objective (RPO)
How much data loss can the service lose from a failure
Business Requirements
48 / 49
Recovery Time Objective (RTO)
How fast should the service recover from a failure
Recovery Point Objective (RPO)
How much data loss can the service lose from a failure
Types of Failures
High Availability: Single Server Failure, Network Partition
Disaster Recovery: Full Region/Network Failure
Human Error: Little Bobby Tables
How Much
None
few seconds
minutes
hours
day
...
Business Requirements
48 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Read Scaleout with configurable consistent reads Read Scaleout with stale reads
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Read Scaleout with configurable consistent reads Read Scaleout with stale reads
All members partake in consensus
(write performance is as fast as it's slowest node)
Secondary members only get stream of changes (binlog),
does not impact Primary
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Read Scaleout with configurable consistent reads Read Scaleout with stale reads
All members partake in consensus
(write performance is as fast as it's slowest node)
Secondary members only get stream of changes (binlog),
does not impact Primary
Stable network is required:
Network glitches cause stalls/membership changes
Uneven amount of members (3-5)
No network requirements:
glitches in network do not impact availability
2 or more members
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Read Scaleout with configurable consistent reads Read Scaleout with stale reads
All members partake in consensus
(write performance is as fast as it's slowest node)
Secondary members only get stream of changes (binlog),
does not impact Primary
Stable network is required:
Network glitches cause stalls/membership changes
Uneven amount of members (3-5)
No network requirements:
glitches in network do not impact availability
2 or more members
No data loss in case of member failure
(Recovery Point Objective = 0 (RPO))
Consistency
During planned switchover: No data loss, split brain is
handled
During manual Unplanned failover: up to user
Which Solution fits me?
49 / 49
MySQL InnoDB Cluster MySQL InnoDB ReplicaSet
Single Primary, multiple Secondaries
Multi Primary mode (write on all)
Single Primary, multiple Secondaries
Read Scaleout with configurable consistent reads Read Scaleout with stale reads
All members partake in consensus
(write performance is as fast as it's slowest node)
Secondary members only get stream of changes (binlog),
does not impact Primary
Stable network is required:
Network glitches cause stalls/membership changes
Uneven amount of members (3-5)
No network requirements:
glitches in network do not impact availability
2 or more members
No data loss in case of member failure
(Recovery Point Objective = 0 (RPO))
Consistency
During planned switchover: No data loss, split brain is
handled
During manual Unplanned failover: up to user
Automatic Failover in case of failure
(Easier to achieve a lower Recovery Time Objective
(RTO) with stable network/servers)
Manual switchover/failover only
Which Solution fits me?
49 / 49

Más contenido relacionado

La actualidad más candente

MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationFrederic Descamps
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...Frederic Descamps
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewRené Cannaò
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바NeoClova
 
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Frederic Descamps
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Mydbops
 
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfJesmar Cannao'
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼NeoClova
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLOlivier DASINI
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesFrederic Descamps
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼NeoClova
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7Zhaoyang Wang
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1NeoClova
 
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介Attunityのソリューションと異種データベース・クラウド移行事例のご紹介
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介Insight Technology, Inc.
 
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 InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorialFrederic Descamps
 

La actualidad más candente (20)

MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바MySQL Advanced Administrator 2021 - 네오클로바
MySQL Advanced Administrator 2021 - 네오클로바
 
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
Another MySQL HA Solution for ProxySQL Users, Easy and All Integrated: MySQL ...
 
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera ) Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
Wars of MySQL Cluster ( InnoDB Cluster VS Galera )
 
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdfProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
ProxySQL and the Tricks Up Its Sleeve - Percona Live 2022.pdf
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
MySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best PracticesMySQL Group Replication: Handling Network Glitches - Best Practices
MySQL Group Replication: Handling Network Glitches - Best Practices
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼MariaDB MaxScale monitor 매뉴얼
MariaDB MaxScale monitor 매뉴얼
 
New awesome features in MySQL 5.7
New awesome features in MySQL 5.7New awesome features in MySQL 5.7
New awesome features in MySQL 5.7
 
Maxscale 소개 1.1.1
Maxscale 소개 1.1.1Maxscale 소개 1.1.1
Maxscale 소개 1.1.1
 
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介Attunityのソリューションと異種データベース・クラウド移行事例のご紹介
Attunityのソリューションと異種データベース・クラウド移行事例のご紹介
 
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 InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
 

Similar a MySQL InnoDB Cluster / ReplicaSet - Tutorial

20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deploymentIvan Ma
 
MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08Kenny Gryp
 
MySQL Operator for Kubernetes
MySQL Operator for KubernetesMySQL Operator for Kubernetes
MySQL Operator for KubernetesKenny Gryp
 
MySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMiguel Araújo
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesTarique Saleem
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL SupportMysql User Camp
 
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdfDeep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdfMiguel Araújo
 
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialMySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialFrederic Descamps
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterOlivier DASINI
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansibleKhairul Zebua
 
2012 replication
2012 replication2012 replication
2012 replicationsqlhjalp
 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15Dave Stokes
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMatt Lord
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlsqlhjalp
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmapslidethanks
 
MySQL Strategy&Roadmap
MySQL Strategy&RoadmapMySQL Strategy&Roadmap
MySQL Strategy&Roadmapslidethanks
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMario Beck
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012sqlhjalp
 

Similar a MySQL InnoDB Cluster / ReplicaSet - Tutorial (20)

20200613 my sql-ha-deployment
20200613 my sql-ha-deployment20200613 my sql-ha-deployment
20200613 my sql-ha-deployment
 
MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08
 
MySQL Operator for Kubernetes
MySQL Operator for KubernetesMySQL Operator for Kubernetes
MySQL Operator for Kubernetes
 
MySQL on Docker and Kubernetes
MySQL on Docker and KubernetesMySQL on Docker and Kubernetes
MySQL on Docker and Kubernetes
 
MySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery SolutionMySQL Database Architectures - High Availability and Disaster Recovery Solution
MySQL Database Architectures - High Availability and Disaster Recovery Solution
 
Mysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New FeaturesMysql User Camp : 20th June - Mysql New Features
Mysql User Camp : 20th June - Mysql New Features
 
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
Mysql User Camp : 20-June-14 : Mysql New features and NoSQL Support
 
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdfDeep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf
Deep Dive into MySQL InnoDB Cluster Read Scale-out Capabilities.pdf
 
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialMySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
 
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB ClusterMySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
MySQL Day Paris 2016 - MySQL HA: InnoDB Cluster and NDB Cluster
 
06 network automationwithansible
06 network automationwithansible06 network automationwithansible
06 network automationwithansible
 
2012 replication
2012 replication2012 replication
2012 replication
 
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
MySQL for Oracle DBA -- Rocky Mountain Oracle User Group Training Days '15
 
MySQL Replication
MySQL ReplicationMySQL Replication
MySQL Replication
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB Clusters
 
My sql crashcourse_intro_kdl
My sql crashcourse_intro_kdlMy sql crashcourse_intro_kdl
My sql crashcourse_intro_kdl
 
My sqlstrategyroadmap
My sqlstrategyroadmapMy sqlstrategyroadmap
My sqlstrategyroadmap
 
MySQL Strategy&Roadmap
MySQL Strategy&RoadmapMySQL Strategy&Roadmap
MySQL Strategy&Roadmap
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012My sql susecon_crashcourse_2012
My sql susecon_crashcourse_2012
 

Más de Kenny Gryp

MySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVMySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVKenny Gryp
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLKenny Gryp
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationKenny Gryp
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureKenny Gryp
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialKenny Gryp
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupKenny Gryp
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteKenny Gryp
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationKenny Gryp
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB ClusterKenny Gryp
 

Más de Kenny Gryp (10)

MySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVMySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRV
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn TutorialMySQL Group Replication - HandsOn Tutorial
MySQL Group Replication - HandsOn Tutorial
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 
Advanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suiteAdvanced Percona XtraDB Cluster in a nutshell... la suite
Advanced Percona XtraDB Cluster in a nutshell... la suite
 
Java MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & OptimizationJava MySQL Connector & Connection Pool Features & Optimization
Java MySQL Connector & Connection Pool Features & Optimization
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB Cluster
 

Último

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfkalichargn70th171
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 

Último (20)

Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdfThe Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
The Essentials of Digital Experience Monitoring_ A Comprehensive Guide.pdf
 
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
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 

MySQL InnoDB Cluster / ReplicaSet - Tutorial

  • 2. 2 / 492 / 49
  • 3.   Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purpose 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 up in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle´s product remains at the sole discretion of Oracle. 3 / 49
  • 4. Past, Present & Future 4 / 49
  • 5. Past, Present & Future In The Past - MANUAL Setting up Replication topology was done manually, taking many steps including user management, restoring backups, configuring replication... MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating 4 / 49
  • 6. Past, Present & Future In The Past - MANUAL Setting up Replication topology was done manually, taking many steps including user management, restoring backups, configuring replication... MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating 2016 - MySQL InnoDB Cluster Group Replication: Automatic membership changes, network partition handling, consistency... Shell to provide a powerful interface that helps in automating an integrating all components InnoDB CLONE to automatically provision members, fully integrated in InnoDB 4 / 49
  • 7. Past, Present & Future In The Past - MANUAL Setting up Replication topology was done manually, taking many steps including user management, restoring backups, configuring replication... MySQL offered the technical pieces, leaving it up to the user to setup an (always customized) architecture This requires technical components ... bringing lot's of work for DBA's and experts, who spent their time automating 2016 - MySQL InnoDB Cluster Group Replication: Automatic membership changes, network partition handling, consistency... Shell to provide a powerful interface that helps in automating an integrating all components InnoDB CLONE to automatically provision members, fully integrated in InnoDB 2020 - MySQL InnoDB ReplicaSet 'classic', 'asynchronous' Replication based Solution, fully integrated 4 / 49
  • 8. MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." 5 / 49
  • 9. MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." 5 / 49
  • 10. Components: MySQL Server MySQL Group Replication MySQL Shell MySQL Router MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." 5 / 49
  • 11. One Product: MySQL All components developed together Integration of all components Full stack testing MySQL InnoDB Cluster - Goals 6 / 49
  • 12. One Product: MySQL All components developed together Integration of all components Full stack testing Easy to Use One client: MySQL Shell Integrated orchestration Homogenous servers MySQL InnoDB Cluster - Goals 6 / 49
  • 13. Introducing MySQL InnoDB ReplicaSet! 8.0.19 Feature! Fully integrated MySQL Router Automatic Routing Ease of use with MySQL Shell Configuring, Adding, Removing members Automatic Member Provisioning (CLONE) Replication Architecture: (manual) Switchover & Failover (asynchronous) Read Scaleout 'Simple' Replication architecture: no network/hardware requirements Providing Availability on PRIMARY when issues with secondaries or network MySQL InnoDB ReplicaSet 7 / 49
  • 14. Past MySQL InnoDB ReplicaSet Restore a backup to provision a member Automatically provisioning new members: InnoDB CLONE MySQL InnoDB ReplicaSet - Features 8 / 49
  • 15. Past MySQL InnoDB ReplicaSet Restore a backup to provision a member Automatically provisioning new members: InnoDB CLONE Configure Replication Users Configure Replication MySQL Shell Automatically configures users & replication MySQL InnoDB ReplicaSet - Features 8 / 49
  • 16. Past MySQL InnoDB ReplicaSet Restore a backup to provision a member Automatically provisioning new members: InnoDB CLONE Configure Replication Users Configure Replication MySQL Shell Automatically configures users & replication Manually configuring, adding removing servers in Application, MySQL Router (or other proxy) Integrated MySQL Router load balancing Only need to bootstrap Router Router is stateless, adapts to topology changes MySQL InnoDB ReplicaSet - Features 8 / 49
  • 17. Past MySQL InnoDB ReplicaSet Restore a backup to provision a member Automatically provisioning new members: InnoDB CLONE Configure Replication Users Configure Replication MySQL Shell Automatically configures users & replication Manually configuring, adding removing servers in Application, MySQL Router (or other proxy) Integrated MySQL Router load balancing Only need to bootstrap Router Router is stateless, adapts to topology changes Manually or relying on external tools to make topology changes Easy to use manual switchover/failover MySQL InnoDB ReplicaSet - Features 8 / 49
  • 18. Past MySQL InnoDB ReplicaSet Restore a backup to provision a member Automatically provisioning new members: InnoDB CLONE Configure Replication Users Configure Replication MySQL Shell Automatically configures users & replication Manually configuring, adding removing servers in Application, MySQL Router (or other proxy) Integrated MySQL Router load balancing Only need to bootstrap Router Router is stateless, adapts to topology changes Manually or relying on external tools to make topology changes Easy to use manual switchover/failover Use additional monitoring tool log in on all machines to check topology status See status of the topology through MySQL Shell status() MySQL InnoDB ReplicaSet - Features 8 / 49
  • 19. Past MySQL InnoDB ReplicaSet MySQL InnoDB ReplicaSet - Features 9 / 49
  • 20. Past MySQL InnoDB ReplicaSet complexity: user is responsible for the full configuration of every component and it's settings Shell configures Server, Router, Replication in a standardized best practice setup, prevents mistakes MySQL InnoDB ReplicaSet - Features 9 / 49
  • 21. Past MySQL InnoDB ReplicaSet complexity: user is responsible for the full configuration of every component and it's settings Shell configures Server, Router, Replication in a standardized best practice setup, prevents mistakes every setup is a customized setup Standard Solution -- Supported & QA'ed by Oracle MySQL InnoDB ReplicaSet - Features 9 / 49
  • 22. Past MySQL InnoDB ReplicaSet complexity: user is responsible for the full configuration of every component and it's settings Shell configures Server, Router, Replication in a standardized best practice setup, prevents mistakes every setup is a customized setup Standard Solution -- Supported & QA'ed by Oracle A lot of manual steps and additional software required, always customized and often overengineered by MySQL DBA's Easy to use, even for MySQL beginner MySQL InnoDB ReplicaSet - Features 9 / 49
  • 23. MySQL InnoDB ReplicaSet - Requirements & Limitations Requirements: MySQL 8 (SET PERSIST!) GTID Limitations: Manual failover -- which is a good thing No coordination between servers mandates external arbitration No multi-primary as such topology cannot guarantee data consistency No data reconciliation No conflict handling All secondary members replicate from primary Single tiered replication support. 10 / 49
  • 24. Transparent Access to Database Arch. "provide transparent routing between your application and back-end MySQL Servers" Transparent client connection routing Load balancing Application connection failover Little to no configuration needed Stateless design offers easy HA client routing Router as part of the application stack Integration into InnoDB Cluster & InnoDB ReplicaSet Understands Group Replication & Replication topology Currently TCP Port each for PRIMARY and NON-PRIMARY traffic MySQL Router 11 / 49
  • 25. Database Administration Interface "MySQL Shell provides the developer and DBA with a single intuitive, flexible, and powerful interface for all MySQL related tasks!" Multi-Language: JavaScript, Python, and SQL Naturally scriptable Supports Document and Relational models Exposes full Development and Administration APIs Classic MySQL protocol and X protocol MySQL Shell 12 / 49
  • 27. 1. Install VirtualBox, Start Image ssh mysqltutorial@localhost -p 2222 Password password: mysql 3. Start MySQL Shell $ docker-compose run mysqlsh 2. Check consul http://localhost:8500 Preparing Your Environment 14 / 49
  • 29. 0. Connect to an instance mysql-js> c root@server_1:3306 MySQL Shell 16 / 49
  • 30. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help MySQL Shell 16 / 49
  • 31. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help 2. Check the dba object help mysql-js> help dba MySQL Shell 16 / 49
  • 32. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help 2. Check the dba object help mysql-js> help dba 3. Switch operating modes mysql-js> py mysql-py> sql mysql-sql> js mysql-js> sql SELECT 1; MySQL Shell 16 / 49
  • 33. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help 2. Check the dba object help mysql-js> help dba 3. Switch operating modes mysql-js> py mysql-py> sql mysql-sql> js mysql-js> sql SELECT 1; 4. Try auto-completion mysql-js> dba.<tab> mysql-js> shell.<tab> mysql-js> util.<tab> MySQL Shell 16 / 49
  • 34. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help 2. Check the dba object help mysql-js> help dba 3. Switch operating modes mysql-js> py mysql-py> sql mysql-sql> js mysql-js> sql SELECT 1; 4. Try auto-completion mysql-js> dba.<tab> mysql-js> shell.<tab> mysql-js> util.<tab> 5. Check Shell options mysql-js> shell.options MySQL Shell 16 / 49
  • 35. 0. Connect to an instance mysql-js> c root@server_1:3306 1. Check the helper mysql-js> help 2. Check the dba object help mysql-js> help dba 3. Switch operating modes mysql-js> py mysql-py> sql mysql-sql> js mysql-js> sql SELECT 1; 4. Try auto-completion mysql-js> dba.<tab> mysql-js> shell.<tab> mysql-js> util.<tab> 5. Check Shell options mysql-js> shell.options 6. Check history mysql-js> history MySQL Shell 16 / 49
  • 36. MySQL InnoDB ReplicaSet - Hands-on Tutorial! 17 / 49
  • 37. MySQL InnoDB ReplicaSet - Hands-on Tutorial! 1. Configure MySQL instances for ReplicaSet usage mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306") 18 / 49
  • 38. 2. Create the ReplicaSet mysql-js> c root@server_1:3306 mysql-js> rs = dba.createReplicaSet("replicaset") MySQL InnoDB ReplicaSet - Hands-on Tutorial! 1. Configure MySQL instances for ReplicaSet usage mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306") 18 / 49
  • 39. 2. Create the ReplicaSet mysql-js> c root@server_1:3306 mysql-js> rs = dba.createReplicaSet("replicaset") 3. Check ReplicaSet status mysql-js> rs.status() ... MySQL InnoDB ReplicaSet - Hands-on Tutorial! 1. Configure MySQL instances for ReplicaSet usage mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306") 18 / 49
  • 40. 2. Create the ReplicaSet mysql-js> c root@server_1:3306 mysql-js> rs = dba.createReplicaSet("replicaset") 3. Check ReplicaSet status mysql-js> rs.status() ... 4. Add instances to the ReplicaSet mysql-js> rs.addInstance("root@server_2:3306") mysql-js> rs.addInstance("root@server_3:3306") MySQL InnoDB ReplicaSet - Hands-on Tutorial! 1. Configure MySQL instances for ReplicaSet usage mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306") 18 / 49
  • 41. 2. Create the ReplicaSet mysql-js> c root@server_1:3306 mysql-js> rs = dba.createReplicaSet("replicaset") 3. Check ReplicaSet status mysql-js> rs.status() ... 4. Add instances to the ReplicaSet mysql-js> rs.addInstance("root@server_2:3306") mysql-js> rs.addInstance("root@server_3:3306") 5. Check ReplicaSet status again mysql-js> rs.status() ... MySQL InnoDB ReplicaSet - Hands-on Tutorial! 1. Configure MySQL instances for ReplicaSet usage mysql-js> dba.con gureReplicaSetInstance("root@server_1:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_2:3306") mysql-js> dba.con gureReplicaSetInstance("root@server_3:3306") 18 / 49
  • 42. MySQL InnoDB ReplicaSet - Hands-on Tutorial! 19 / 49
  • 43. 6. Bootstrap Routers $ docker-compose up -d --scale router-rs=2 router-rs Note: SSH to the VM in a new tab MySQL InnoDB ReplicaSet - Hands-on Tutorial! 20 / 49
  • 44. 6. Bootstrap Routers $ docker-compose up -d --scale router-rs=2 router-rs Note: SSH to the VM in a new tab 7. Check registered Routers mysql-js> rs.listRouters() MySQL InnoDB ReplicaSet - Hands-on Tutorial! 20 / 49
  • 45. 6. Bootstrap Routers $ docker-compose up -d --scale router-rs=2 router-rs Note: SSH to the VM in a new tab 7. Check registered Routers mysql-js> rs.listRouters() 8. Run Application - Primary Traffic $ docker-compose run app Note: run this app in separate terminal so you can watch this at all times MySQL InnoDB ReplicaSet - Hands-on Tutorial! 20 / 49
  • 46. 9. Ensure Routers are OK http://localhost:8500 MySQL InnoDB ReplicaSet - Hands-on Tutorial! 21 / 49
  • 47. 10. Change ReplicaSet primary instance mysql-js> rs.setPrimaryInstance("server_3:3306") Note: App will automatically get redirected to the new primary. As it's a manual switchover, no split brain MySQL InnoDB ReplicaSet - Hands-on Tutorial! 22 / 49
  • 48. 10. Change ReplicaSet primary instance mysql-js> rs.setPrimaryInstance("server_3:3306") Note: App will automatically get redirected to the new primary. As it's a manual switchover, no split brain 11. Check ReplicaSet status mysql-js> rs.status() ... MySQL InnoDB ReplicaSet - Hands-on Tutorial! 22 / 49
  • 49. MySQL InnoDB ReplicaSet - MySQL Router Integration --bootstrap to automatically configure Metadata schema contains Replication Topology Health checks are performed to all members Switchover to new primary (setPrimaryInstance()): Shell performs topology change, configures super_read_only and updates view_id in metadata Router automatically sees higher view_id and will redirect primary traffic to new primary When the Primary is lost: forcePrimaryInstance() Shell performs topology change, updates view_id in metadata and invalidates lost primary Router will notice topology change by higher view_id in metadata (if network allows) and automatically connect to new Primary 23 / 49
  • 50. 12. Take down primary instance $ docker-tc post mysqltutorial_server_3_1 loss=100% Note: App will have errors MySQL InnoDB ReplicaSet - Hands-on Tutorial! 24 / 49
  • 51. 12. Take down primary instance $ docker-tc post mysqltutorial_server_3_1 loss=100% Note: App will have errors 13. Get ReplicaSet object, check status mysql-js> reconnect mysql-js> rs = dba.getReplicaSet() mysql-js> rs.status() MySQL InnoDB ReplicaSet - Hands-on Tutorial! 24 / 49
  • 52. 14. Force Failover mysql-js> rs.forcePrimaryInstance("server_1:3306") Note: App will reconnect to new Primary MySQL InnoDB ReplicaSet - Hands-on Tutorial! 25 / 49
  • 53. 14. Force Failover mysql-js> rs.forcePrimaryInstance("server_1:3306") Note: App will reconnect to new Primary 15. Check Status mysql-js> rs.status() MySQL InnoDB ReplicaSet - Hands-on Tutorial! 25 / 49
  • 54. 14. Force Failover mysql-js> rs.forcePrimaryInstance("server_1:3306") Note: App will reconnect to new Primary 15. Check Status mysql-js> rs.status() 16. Bring back Server 3 $ docker-tc delete mysqltutorial_server_3_1 mysql-js> rs.status() Note: App will not connect to invalidated old Primary MySQL InnoDB ReplicaSet - Hands-on Tutorial! 25 / 49
  • 55. By design chosen to be Manual failover Having external monitoring processes decide failover can cause a lot of false positives. External tool decides, if the tool has issues: even bigger issues. Split brain issues Majority of production deployments are configured with Manual Failover, which increases Uptime! When automatic failover is needed: use MySQL InnoDB Cluster instead of Semi-Sync MySQL InnoDB ReplicaSet - Manual Failover 26 / 49
  • 56. Example: 1 Primary, 2 Secondaries, 2 Proxy hosts (App servers) 1 Management server: monitoring and making Topology changes automatically Problem: Management server & replica server is partitioned from all other servers What will happen? MySQL InnoDB ReplicaSet - Manual Failover 27 / 49
  • 57. Example: 1 Primary, 2 Secondaries, 2 Proxy hosts (App servers) 1 Management server: monitoring and making Topology changes automatically Problem: Management server & replica server is partitioned from all other servers What will happen? The management host might promote the secondary causing split brain use MySQL InnoDB Cluster over Semi-Sync With semi-sync, all members have to ack (prevent split brain), causing downtime with every small glitch MySQL InnoDB ReplicaSet - Manual Failover 28 / 49
  • 58. 17. Rejoin instance back to the ReplicaSet mysql-js> rs.rejoinInstance("server_3:3306") Note: there is no guarantee there is no split brain, but is minimized due to Router logic MySQL InnoDB ReplicaSet - Hands-on Tutorial! 29 / 49
  • 59. 17. Rejoin instance back to the ReplicaSet mysql-js> rs.rejoinInstance("server_3:3306") Note: there is no guarantee there is no split brain, but is minimized due to Router logic 18. Verify the ReplicaSet status mysql-js> rs.status() MySQL InnoDB ReplicaSet - Hands-on Tutorial! 29 / 49
  • 60. 17. Rejoin instance back to the ReplicaSet mysql-js> rs.rejoinInstance("server_3:3306") Note: there is no guarantee there is no split brain, but is minimized due to Router logic 18. Verify the ReplicaSet status mysql-js> rs.status() 19. Stop Routers $ docker-compose stop router-rs 20. Dissolve ReplicaSet mysql-js> rs.dissolve() MySQL InnoDB ReplicaSet - Hands-on Tutorial! 29 / 49
  • 62. Components: MySQL Server MySQL Group Replication MySQL Shell MySQL Router MySQL InnoDB Cluster "A single product — MySQL — with high availability and scaling features baked in; providing an integrated end-to-end solution that is easy to use." 31 / 49
  • 63. Many of our customers have adopted InnoDB Cluster! Fully integrated MySQL Router Automatic Routing Ease of use with MySQL Shell Configuring, Adding, Removing members Group Replication Architecture Providing Consistency Automatic Failover Network Partition Handling No data loss in case of failure Automatic Member Provisioning (CLONE) MySQL InnoDB Cluster 32 / 49
  • 65. High Available Distributed MySQL DB Fault tolerance Automatic failover Active/Active update anywhere (limits apply) Automatic membership management Adding/removing members Network partitions, failures Conflict detection and resolution Prevents data loss MySQL Group Replication 33 / 49
  • 66. MySQL Group Replication Implementation of Replicated Database State Machine Total Order - Writes XCOM - Paxos implementation Configurable Consistency Guarantees eventual consistency 8.0+: per session & global read/write consistency Using MySQL replication framework by design binary logs relay logs GTIDs: Global Transaction IDs Generally Available since MySQL 5.7 Supported on all platforms: linux, windows, solaris, macosx, freebsd 34 / 49
  • 67. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) MySQL Group Replication - Use Cases 35 / 49
  • 68. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling MySQL Group Replication - Use Cases 35 / 49
  • 69. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling Read Scaleout Add/Remove members as needed Replication Lag handling with Flow Control Configurable Consistency Levels Eventual Full Consistency -- no stale reads MySQL Group Replication - Use Cases 35 / 49
  • 70. Consistency: No Data Loss (RPO=0) in event of failure of (primary) member Split brain prevention (Quorum) Highly Available: Automatic Failover Primary members are automatically elected Automatic Network Partition handling Read Scaleout Add/Remove members as needed Replication Lag handling with Flow Control Configurable Consistency Levels Eventual Full Consistency -- no stale reads Active/Active environments Write to many members at the same time ordered writes within the group (XCOM) guaranteed consistency Good write performance due to Optimistic Locking (workload dependent) MySQL Group Replication - Use Cases 35 / 49
  • 71. MySQL InnoDB Cluster - Evolving 36 / 49
  • 72. MySQL InnoDB Cluster - Hands-on Tutorial! 37 / 49
  • 73. MySQL InnoDB Cluster - Hands-on Tutorial! 1. Configure MySQL instances for Cluster usage mysql-js> dba.con gureInstance("root@server_1:3306") mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true}) mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true}) Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O 38 / 49
  • 74. MySQL InnoDB Cluster - Hands-on Tutorial! 1. Configure MySQL instances for Cluster usage mysql-js> dba.con gureInstance("root@server_1:3306") mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true}) mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true}) Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O 2. Create the Cluster: mysql-js> c root@server_1 mysql-js> c = dba.createCluster("cluster") 38 / 49
  • 75. MySQL InnoDB Cluster - Hands-on Tutorial! 1. Configure MySQL instances for Cluster usage mysql-js> dba.con gureInstance("root@server_1:3306") mysql-js> dba.con gureInstance("root@server_2:3306", {clearReadOnly: true}) mysql-js> dba.con gureInstance("root@server_3:3306", {clearReadOnly: true}) Note: server_1 is the last ReplicaSet Primary, server_2 and server_3 were Secondary and hence R/O 2. Create the Cluster: mysql-js> c root@server_1 mysql-js> c = dba.createCluster("cluster") 3. Add server_2 to the Cluster mysql-js> c.addInstance('server_2') 38 / 49
  • 76. MySQL InnoDB Cluster - Hands-on Tutorial! 4. Let's purge the binary logs, to force CLONE mysql-js> sql mysql-sql> CREATE DATABASE app; mysql-sql> FLUSH BINARY LOGS; mysql-sql> PURGE BINARY LOGS BEFORE NOW(); mysql-sql> c root@server_2 mysql-sql> FLUSH BINARY LOGS; mysql-sql> PURGE BINARY LOGS BEFORE NOW(); mysql-sql> c root@server_1 mysql-js> js 39 / 49
  • 77. MySQL InnoDB Cluster - Hands-on Tutorial! 4. Let's purge the binary logs, to force CLONE mysql-js> sql mysql-sql> CREATE DATABASE app; mysql-sql> FLUSH BINARY LOGS; mysql-sql> PURGE BINARY LOGS BEFORE NOW(); mysql-sql> c root@server_2 mysql-sql> FLUSH BINARY LOGS; mysql-sql> PURGE BINARY LOGS BEFORE NOW(); mysql-sql> c root@server_1 mysql-js> js 5. Add server_3 mysql-js> c.addInstance('server_3') Note: binary logs will be missing and CLONE will have to be used to provision server_2 39 / 49
  • 78. 6. Check Cluster status mysql-js> c.status() MySQL InnoDB Cluster - Hands-on Tutorial! 40 / 49
  • 79. 6. Check Cluster status mysql-js> c.status() 7. Deploy MySQL Router $ docker-compose up -d --scale router=2 router MySQL InnoDB Cluster - Hands-on Tutorial! 40 / 49
  • 80. 6. Check Cluster status mysql-js> c.status() 7. Deploy MySQL Router $ docker-compose up -d --scale router=2 router 8. List Routers mysql-js> c.listRouters() MySQL InnoDB Cluster - Hands-on Tutorial! 40 / 49
  • 81. 6. Check Cluster status mysql-js> c.status() 7. Deploy MySQL Router $ docker-compose up -d --scale router=2 router 8. List Routers mysql-js> c.listRouters() 9. Start the App (if needed) $ docker-compose run app MySQL InnoDB Cluster - Hands-on Tutorial! 40 / 49
  • 82. 10. Scale-out Router! $ docker-compose up -d --scale router=4 router MySQL InnoDB Cluster - Hands-on Tutorial! 41 / 49
  • 83. 10. Scale-out Router! $ docker-compose up -d --scale router=4 router 11. Check database-router-rw service status http://localhost:8500 MySQL InnoDB Cluster - Hands-on Tutorial! 41 / 49
  • 84. 10. Scale-out Router! $ docker-compose up -d --scale router=4 router 11. Check database-router-rw service status http://localhost:8500 12. Scale-down Router again $ docker-compose up -d --scale router=2 router MySQL InnoDB Cluster - Hands-on Tutorial! 41 / 49
  • 85. DNS-SRV Support in Connectors New in MySQL 8.0.19 Connectors! 42 / 49
  • 86. MySQL InnoDB Cluster - Hands-on Tutorial! 13. Look at Cluster Options mysql-js> c.options() Note: there are global & server specific options 14. Set Best practices mysql-js> c.setOption("expelTimeout", 5) mysql-js> c.setOption("autoRejoinTries", 3) Best Practices are covered on https://www.slideshare.net/Grypyrg/mysql-innodb-cluster-new-features-in-80-releases-best-practices 43 / 49
  • 87. 15. Switch primary manually mysql-js> c.setPrimaryInstance("server_3:3306") MySQL InnoDB Cluster - Hands-on Tutorial! 44 / 49
  • 88. 16. Take down primary instance $ docker-tc post mysqltutorial_server_3_1 loss=100% MySQL InnoDB Cluster - Hands-on Tutorial! 45 / 49
  • 89. 16. Take down primary instance $ docker-tc post mysqltutorial_server_3_1 loss=100% 17. Check partitioned server logs $ docker logs -f mysqltutorial_server_3_1 MySQL InnoDB Cluster - Hands-on Tutorial! 45 / 49
  • 90. 16. Take down primary instance $ docker-tc post mysqltutorial_server_3_1 loss=100% 17. Check partitioned server logs $ docker logs -f mysqltutorial_server_3_1 18. Bring primary back $ docker-tc delete mysqltutorial_server_3_1 Note: Instance will automatically rejoin MySQL InnoDB Cluster - Hands-on Tutorial! 45 / 49
  • 91. 19. Switch to multi-primary mode mysql-js> c.switchToMultiPrimaryMode() Note: App writes will be sent to every cluster member 20. Switch back to single-primary mode mysql-js> c.switchToSinglePrimaryMode() MySQL InnoDB Cluster - Hands-on Tutorial! 46 / 49
  • 92. What to choose? MySQL InnoDB Cluster or MySQL InnoDB ReplicaSet 47 / 49
  • 93. Recovery Time Objective (RTO) How fast should the service recover from a failure Recovery Point Objective (RPO) How much data loss can the service lose from a failure Business Requirements 48 / 49
  • 94. Recovery Time Objective (RTO) How fast should the service recover from a failure Recovery Point Objective (RPO) How much data loss can the service lose from a failure Types of Failures High Availability: Single Server Failure, Network Partition Disaster Recovery: Full Region/Network Failure Human Error: Little Bobby Tables How Much None few seconds minutes hours day ... Business Requirements 48 / 49
  • 95. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Which Solution fits me? 49 / 49
  • 96. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Which Solution fits me? 49 / 49
  • 97. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Read Scaleout with configurable consistent reads Read Scaleout with stale reads Which Solution fits me? 49 / 49
  • 98. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Read Scaleout with configurable consistent reads Read Scaleout with stale reads All members partake in consensus (write performance is as fast as it's slowest node) Secondary members only get stream of changes (binlog), does not impact Primary Which Solution fits me? 49 / 49
  • 99. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Read Scaleout with configurable consistent reads Read Scaleout with stale reads All members partake in consensus (write performance is as fast as it's slowest node) Secondary members only get stream of changes (binlog), does not impact Primary Stable network is required: Network glitches cause stalls/membership changes Uneven amount of members (3-5) No network requirements: glitches in network do not impact availability 2 or more members Which Solution fits me? 49 / 49
  • 100. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Read Scaleout with configurable consistent reads Read Scaleout with stale reads All members partake in consensus (write performance is as fast as it's slowest node) Secondary members only get stream of changes (binlog), does not impact Primary Stable network is required: Network glitches cause stalls/membership changes Uneven amount of members (3-5) No network requirements: glitches in network do not impact availability 2 or more members No data loss in case of member failure (Recovery Point Objective = 0 (RPO)) Consistency During planned switchover: No data loss, split brain is handled During manual Unplanned failover: up to user Which Solution fits me? 49 / 49
  • 101. MySQL InnoDB Cluster MySQL InnoDB ReplicaSet Single Primary, multiple Secondaries Multi Primary mode (write on all) Single Primary, multiple Secondaries Read Scaleout with configurable consistent reads Read Scaleout with stale reads All members partake in consensus (write performance is as fast as it's slowest node) Secondary members only get stream of changes (binlog), does not impact Primary Stable network is required: Network glitches cause stalls/membership changes Uneven amount of members (3-5) No network requirements: glitches in network do not impact availability 2 or more members No data loss in case of member failure (Recovery Point Objective = 0 (RPO)) Consistency During planned switchover: No data loss, split brain is handled During manual Unplanned failover: up to user Automatic Failover in case of failure (Easier to achieve a lower Recovery Time Objective (RTO) with stable network/servers) Manual switchover/failover only Which Solution fits me? 49 / 49