This talk focuses on the challenges and strategies to be followed when you're planning for a MySQL upgrade from the End of life versions of MySQL 5.5, 5.6, Even 5.7.
Migrate your EOL MySQL servers to HA Complaint GR Cluster / InnoDB Cluster With Zero Downtime
1. Migrate Your EOL MySQL
Servers
February 13th, 2021
Mydbops MyWebinar - 2
Vinoth Kanna R S
Co-Founder, Mydbops
2. o Interested in Open Source technologies
o MySQL, MongoDB Certified Professional
o Active MySQL Community Contributor
o Tech Speaker/Blogger
o Past, Technical Services Engineer,
Percona
o Co-Founded, Mydbops IT Solutions, 2016
Vinoth Kanna RS
About Me
7. EOL Announcements | AWS RDS
MySQL 5.5 (RDS)
Beyond, December 3, 2020, No new instance can be created
Starting, February 9, 2021, RDS will automatically upgrade MySQL 5.5 instances to
version 5.7 within the earliest scheduled maintenance window that follows.
Starting, March 9, 2021, RDS will automatically upgrade any remaining MySQL 5.5
instances to version 5.7 whether or not they are in a maintenance window.
8. EOL Announcements | AWS RDS
MySQL 5.6 (RDS)
Beyond, April 1, 2021, No new instance can be created
Starting, August 3, 2021, RDS will automatically upgrade MySQL 5.6 instances to
version 5.7 within the earliest scheduled maintenance window that follows.
Starting, September 1, 2021, RDS will automatically upgrade any remaining MySQL
5.6 instances to version 5.7 whether or not they are in a maintenance window.
9. Version To Upgrade | Why 8.0 ?
Most feature packed release of MySQL
Continuous improvements and feature additions on every minor release
CTE, Window Functions, Improved JSON, Geospatial Functions
Database Cloning, Last logical import and backup using shell
InnoDB Replica Sets, GR Improvements
Binlog Encryption, Better configuration management
Invisible Columns, Histograms
10. Version To Upgrade | Why Group Replication / InnoDB
Cluster ?
o MySQL's Native HA Solution
o Synchronous Replication
o Group replication has turned more stable, improved well with 8.0 release
o Tuneable Consistency
o Scale out reads effectively
o Multi Writer Mode
o Built on robust replication framework uses binlogs with GTID for replication
11. Version To Upgrade | Key Considerations
Only Supports InnoDB
Primary Key Is Must
No Query Cache
GTID Replication
12. Version To Upgrade | Key Considerations
ANSI SQL Standards
Optimiser Changes
Reserved Words
mysql_upgrade_cheker
13. Upgrade Path To 8.0
Services (LB)
Stateful Sets
Operator Maturity
PVC / Storage Class
InPlace Upgrade
5.5 -> 5.6
5.6 -> 5.7
5.7 -> 8.0
mysql_upgrade to be run after each
of the major version upgrade
Logical Upgrade
Most Recommended Way
Build parallel Environment and
Failover
Time consuming depending on size
Replicate Ignoring MySQL DB
15. Seamless Data Replication
Node 1
Node 2 Node 3
GR Cluster Requires GTID to be ON
To replicate to GR Cluster on 8.0 (GTID ON)
Source Server (5.6) should run with GTID ON.
To Enable GTID on MySQL 5.6, Downtime is required
Master and all It's Save's have to be applied at same time.
It's a tedious process where there is too many replicas and
Schedule downtime for entire application.
MySQL 8 GR Cluster
16. Seamless Data Replication | Case 1: MySQL 5.6 with GTID ON
Node 1
Node 2 Node 3
MySQL 8 GR Cluster
MySQL 5.6
(GTID ON)
17. Seamless Data Replication | Case 2: MySQL 5.6 with GTID OFF
o If enabling GTID is not a option (due to complexity / no downtime)
o We have to take a different approaches like mirroring traffic, Using
third party replicators to stream the changes to upgraded GR cluster.
o This limitation is broken with the MySQL Version 8.0.23
18. Seamless Data Replication | Case 2: MySQL 5.6 with GTID OFF
What's New: MySQL 8.0.23
Release Date: 18-01-2021
// Replication channels can now be set to assign a GTID to replicated transactions that do
not already have one, using the ASSIGN_GTIDS_TO_ANONYMOUS_TRANSACTIONS
option of the CHANGE REPLICATION SOURCE TO statement.
This feature enables replication from a source that does not use GTID-based replication,
to a replica that does. //
19. Seamless Data Replication | Case 2: MySQL 5.6 with GTID OFF
Master MySQL 8.0.23
GTID: OFF GTID: ON
Log Slave updates: ON
change replication source to .
. . . . . . . . . . . . . . . . . . . .
assign_gtids_to_anonymous_t
ransactions=LOCAL;
#210212 23:00:42 server id 320
end_log_pos 399 . . . . . Xid =
1245
use `test`/*!*/;
truncate table event_logs
/*!*/;
# at 399
SET @@SESSION.GTID_NEXT= 'bb71f03a-
1ab9-42ba-b3a2-1803de73944f:1224'/*!*/;
#210212 23:00:42 server id 320 Xid = 1245
use `test`/*!*/;
truncate table event_logs
/*!*/;
# at 399
Replicate To
GR Cluster
20. Seamless Data Replication | Case 2: MySQL 5.6 with GTID OFF
Source
MySQL 8.0.23
MySQL 5.6
GTID: OFF
MySQL 5.7
GTID: OFF GTID: ON
assign_gtids_to_anonymous_
transactions=LOCAL;
</p>
Node 1
Node 2 Node 3
MySQL
8.0.22
GR Cluster
Actual Implementation
22. Application Migration | Proxy End Points
1
2
3
MySQL Router, ProxySQL, MaxScale, HaProxy etc
Proxy's / Load Balancers
Centralised DNS, Route53 endpoints
DNS Based Routing
Virutal IP Managed With Keepalived, EIP
Virtual IP / EIP Based Routing
Traffic
Routing
23. Application Migration | Proxy Setup
MySQL 5.6
Applicatio
n
Servers
Node 1
Node 2 Node 3
MySQL 8
GR Cluster
Reads / Writes
Any
Proxy
Service
GTID: ON
24. Application Migration | Lazy Switch
MySQL 5.6
Applicatio
n
Servers
Node 1
Node 2 Node 3
MySQL 8
GR Cluster
Reads / Writes Any
Proxy
Service
GTID: ON
25. Application Migration | Failover
MySQL 5.6
Applicatio
n
Servers
Node 1
Node 2 Node 3
MySQL 8
GR Cluster
Reads / Writes Any
Proxy
Service
GTID: ON
26. References
EOL Announcements:
MySQL Life Cycle
AWS RDS MySQL 5.5 Announcement
AWS RDS MySQL 5.6 Announcement
MySQL 8.0:
MySQL 8.0 For Database Engineers
MySQL Shell For Database Engineers
Wars Of MySQL Cluster
High Available With InnoDB Cluster