SlideShare a Scribd company logo
1 of 31
Download to read offline
Copyright 2016 Severalnines AB
How to upgrade to MySQL 5.7 - best practices
March 15, 2016
Krzysztof Książek
Severalnines
krzysztof@severalnines.com
1
2
Your host & some logistics
I'm Jean-Jérôme from the Severalnines Team
and I'm your host for today's webinar!
Feel free to ask any questions in the
Questions section of this application or via
the Chat box.
You can also contact me directly via the chat
box or via email: jj@severalnines.com
during or after the webinar.
Copyright 2016 Severalnines AB
! Preparing an upgrade - changes between MySQL 5.6 and 5.7
! Information_schema
! SQL modes
! Authentication model
! Testing for upgrade
! Designing test environment
! Building test environment
! Executing tests
! Upgrade process
! Tools which may help you with upgrade process

3
Agenda
Copyright 2016 Severalnines AB
Why upgrading to MySQL 5.7?
4
Copyright 2016 Severalnines AB
! Better performance
! New features
! Multi source replication
! Intra-schema parallel replication
! Online buffer pool resize!!!
! Improved optimizer cost model
! Access to security and bugfix releases
! 5.5 ended its ‘Premier’ support, ‘Extended’ will end in 2018

5
Why upgrading to MySQL 5.7?
Copyright 2016 Severalnines AB
Preparing an upgrade - reviewing
changes
6
Copyright 2016 Severalnines AB
! Information schema changes
! global_status, session_status, global_variables and
session_variables moved to the performance_schema
! You can restore the original behavior by setting:

SET GLOBAL show_compatibility_56=1
! This may affect different monitoring solutions
7
Preparing an upgrade - reviewing changes
Copyright 2016 Severalnines AB
! SQL mode changes
! STRICT_TRANS_TABLES mode is used by default
! No more inserting of invalid data like zeroed date or
skipping column in INSERT when column doesn’t have
explicit DEFAULT value
! This may cause issues if application relies on previous
(definitely not so good) defaults
8
Preparing an upgrade - reviewing changes
Copyright 2016 Severalnines AB
! Authentication model changes
! Pre-4.1 passwords have been removed
! Password expiration has been added
! By default it’s not affecting 5.6 users ( >=5.7.11) but this
default may change in the future (http://
mysqlserverteam.com/an-update-on-
default_password_lifetime)
! You should manually set the desired expiration policy
for every user, after you upgraded to MySQL 5.7
9
Preparing an upgrade - reviewing changes
Copyright 2016 Severalnines AB
! Redo and undo log format changed - use
innodb_fast_shutdown=0 when you stop 5.6 for upgrade
! YEAR(2) format has been removed
! User-defined locks system has changed - multiple locks are now
possible
! ‘derived_merge’ optimizer switch may trigger SQL
incompatibility
! For full list of changes look at: http://dev.mysql.com/doc/
refman/5.7/en/upgrading-from-previous-series.html

10
Preparing an upgrade - reviewing changes
Copyright 2016 Severalnines AB
Testing for upgrade
11
Copyright 2016 Severalnines AB
Testing for upgrade
12
Copyright 2016 Severalnines AB
! First step - design your test environment
! It should be as close to the production as possible
! Weaker hardware will lead to incorrect results
! Queries may be slower on weaker CPU and I/O
subsystem
! or you will not catch a real regression - thinking it’s the
hardware’s fault
13
Testing for upgrade
Copyright 2016 Severalnines AB
! Dataset should be as close to the real data as possible
! Scrubbing dataset or cleaning confidential data may
impact query execution plans - if you don’t have to,
don’t clean your data
! You should be using real-world queries to test the
performance
! Ideally, use your application for testing the logic and
making sure all processes work as expected.
14
Testing for upgrade
Copyright 2016 Severalnines AB
! Simplest way of building a test environment:
! create a slave from production master
! and then cut off replication
! Once we have 5.6 node with current dataset, we need to
create another 5.6 node with a copy of this data
! Finally, we want to upgrade one of them to MySQL 5.7
! It’s nice as we can test the upgrade process while
building test hosts
15
Testing for upgrade
Copyright 2016 Severalnines AB
! We have hosts but we need to collect data for tests
! tcpdump or just slow query log would do
! both have some impact on the overall performance
! tcpdump can be executed outside of the database,
to minimize the impact
! You want to collect all the queries - if you have some
processes scheduled to run at a particular time, collect
those queries too when they happen
16
Testing for upgrade
Copyright 2016 Severalnines AB
! Once you have data, you can run some preliminary regression
testing using pt-upgrade
! Run twice, first time using the ‘—save-results’ flag - it’ll save your time
! Generate report, investigate any reported issues
! pt-upgrade compares performance and result set
! Make sure you execute tests locally on the hosts, network latency
may cause some impact
! Make sure both nodes are in the same state - cold or warmed up in
exactly the same way
17
Testing for upgrade
Copyright 2016 Severalnines AB
! pt-upgrade is not enough to cover all issues - yes, it’ll
check performance and some obvious issues but you
need to run more detailed tests
! If you have a set of acceptance tests you use to test new
releases (you should have them), you can use those tests
to check if upgrade affected core functions of your app
! Test application logic, make sure all operations work
correctly, check all of the processes and APIs you may
have in your app
18
Testing for upgrade
Copyright 2016 Severalnines AB
! Once you have completed your tests, there's one more
thing to check
! Rebuild your 5.7 node
! provision it again
! run mysql_upgrade, as you did earlier
! set it up as a slave
! Allow it to work as a slave for couple of days - it’ll confirm
replication works fine between old and new versions
19
Testing for upgrade
Copyright 2016 Severalnines AB
Upgrade process
20
Copyright 2016 Severalnines AB
! Start with a single slave and upgrade it:
! Disable innodb_fast_shutdown
! Shut down MySQL
! Upgrade binaries to MySQL 5.7
! Start MySQL
! Run mysql_upgrade
! Restart MySQL
! Make sure replication is working and if
needed, fix it

21
Upgrade process
Copyright 2016 Severalnines AB
! Before upgrade - make sure you took the node out of
rotation in a proxy layer or in your application
! After upgrade - if possible, put some limited traffic on the
new host
! Observe how it behaves under real-world traffic
! CPU
! I/O
! Memory utilization
22
Upgrade process
Copyright 2016 Severalnines AB
! Step by step increase the load to a normal level
! If everything is ok, proceed with upgrade on remaining
slaves
! Once all of the slaves are upgraded, pick one of them as
a new master
! Set it in a master-master replication with current, 5.6
master
23
Upgrade process
Copyright 2016 Severalnines AB
! Perform a switchover to the new master
! If the old master keeps replicating, that’s great - upgrade it in a
regular way
! If the old master replication breaks (i.e. incompatibilities in
binlog format between old and new MySQL versions), rebuild it:
! Wipe the data
! Perform binary upgrade to MySQL 5.7
! Provision the data from slave and set up the replication

24
Upgrade process
Copyright 2016 Severalnines AB
Tools which may help you with upgrade
process
25
Copyright 2016 Severalnines AB
! tcpdump
! tcpdump -s 65535 -x -nn -q -tttt -i any port 3306 >
mysql.tcp.txt
! Helps you to collect queries exchanged between
application hosts and database server
! Minimizes the impact caused by data collection (when
executed outside of database node)
26
Tools which may help you with upgrade process
Copyright 2016 Severalnines AB
! pt-upgrade, Percona Playback
! pt-upgrade is designed to check for
performance and basic result set
regressions
! Points you to queries which are not
performing on the new version or they
return different data
! Percona Playback is designed for load
testing - replays slow log, trying to
simulate real-world workload
27
Tools which may help you with upgrade process
Copyright 2016 Severalnines AB
! MaxScale and ProxySQL
! Database-aware proxies help you through the
upgrade process
! They route the traffic off the node when it goes
down
! Help you with a warm-up period - use lower weight
for new hosts to allow them to warm up properly
! ProxySQL can handle graceful switchover when
used with external tool (for example,
mysqlrpladmin, MHA or ClusterControl)

28
Tools which may help you with upgrade process
Copyright 2016 Severalnines AB
! mysqlrpladmin, MHA
! Those tools can perform a switchover for you
! No need to make the changes in manual and error prone
way - just run a script
! Those tools can be integrated with ProxySQL for graceful
switchovers
29
Tools which may help you with upgrade process
Copyright 2016 Severalnines AB
! ClusterControl
! Helps with provisioning of new
nodes
! Perform a switchover for you
! Gives you clear insight into
replication status
! Gives you clear insight into all
database operations
30
Tools which may help you with upgrade process
Copyright 2015 Severalnines AB
! More blogs covering different aspects of MySQL operations:
! http://severalnines.com/blog-categories/db-ops
! An ebook focused on upgrade process to MySQL 5.7 will become
available soon
! Step-by-step guide through each part of the process
! Detailed explanations of different issues you may run into
! We’ll be at Percona Live in April, see you there!
! Contact: jj@severalnines.com

31
Thank You!

More Related Content

More from Severalnines

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSSeveralnines
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudSeveralnines
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsSeveralnines
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSeveralnines
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...Severalnines
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBSeveralnines
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlSeveralnines
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Severalnines
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Severalnines
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBSeveralnines
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseSeveralnines
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBSeveralnines
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerSeveralnines
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifeSeveralnines
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Severalnines
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLSeveralnines
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningSeveralnines
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBSeveralnines
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Severalnines
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilitySeveralnines
 

More from Severalnines (20)

Cloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaSCloud's future runs through Sovereign DBaaS
Cloud's future runs through Sovereign DBaaS
 
Tips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloudTips to drive maria db cluster performance for nextcloud
Tips to drive maria db cluster performance for nextcloud
 
Working with the Moodle Database: The Basics
Working with the Moodle Database: The BasicsWorking with the Moodle Database: The Basics
Working with the Moodle Database: The Basics
 
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDBSysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
SysAdmin Working from Home? Tips to Automate MySQL, MariaDB, Postgres & MongoDB
 
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
(slides) Polyglot persistence: utilizing open source databases as a Swiss poc...
 
Webinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDBWebinar slides: How to Migrate from Oracle DB to MariaDB
Webinar slides: How to Migrate from Oracle DB to MariaDB
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
Webinar slides: How to Manage Replication Failover Processes for MySQL, Maria...
 
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
Webinar slides: Backup Management for MySQL, MariaDB, PostgreSQL & MongoDB wi...
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
MariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash CourseMariaDB Performance Tuning Crash Course
MariaDB Performance Tuning Crash Course
 
Performance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDBPerformance Tuning Cheat Sheet for MongoDB
Performance Tuning Cheat Sheet for MongoDB
 
Advanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona ServerAdvanced MySql Data-at-Rest Encryption in Percona Server
Advanced MySql Data-at-Rest Encryption in Percona Server
 
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket KnifePolyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
Polyglot Persistence Utilizing Open Source Databases as a Swiss Pocket Knife
 
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
Webinar slides: Free Monitoring (on Steroids) for MySQL, MariaDB, PostgreSQL ...
 
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQLWebinar slides: An Introduction to Performance Monitoring for PostgreSQL
Webinar slides: An Introduction to Performance Monitoring for PostgreSQL
 
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance TuningWebinar slides: Our Guide to MySQL & MariaDB Performance Tuning
Webinar slides: Our Guide to MySQL & MariaDB Performance Tuning
 
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDBWebinar slides: Migrating to Galera Cluster for MySQL and MariaDB
Webinar slides: Migrating to Galera Cluster for MySQL and MariaDB
 
Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?Webinar slides: How to Measure Database Availability?
Webinar slides: How to Measure Database Availability?
 
Webinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High AvailabilityWebinar slides: Designing Open Source Databases for High Availability
Webinar slides: Designing Open Source Databases for High Availability
 

Recently uploaded

Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfappinfoedgeca
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideVarun Mithran
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyDamar Juniarto
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfOndejSur
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirtrahman018755
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsrahman018755
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxChloeMeadows1
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsrahman018755
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresencePC Doctors NET
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebJie Liau
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.Tortogel
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appscristianmanaila2
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkklolsDocherty
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsrahman018755
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?Linksys Velop Login
 

Recently uploaded (17)

GOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdfGOOGLE Io 2024 At takes center stage.pdf
GOOGLE Io 2024 At takes center stage.pdf
 
Premier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdfPremier Mobile App Development Agency in USA.pdf
Premier Mobile App Development Agency in USA.pdf
 
Bug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's GuideBug Bounty Blueprint : A Beginner's Guide
Bug Bounty Blueprint : A Beginner's Guide
 
Pvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdfPvtaan Social media marketing proposal.pdf
Pvtaan Social media marketing proposal.pdf
 
The Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case StudyThe Use of AI in Indonesia Election 2024: A Case Study
The Use of AI in Indonesia Election 2024: A Case Study
 
Statistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdfStatistical Analysis of DNS Latencies.pdf
Statistical Analysis of DNS Latencies.pdf
 
I’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 ShirtI’ll See Y’All Motherfuckers In Game 7 Shirt
I’ll See Y’All Motherfuckers In Game 7 Shirt
 
Free scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirtsFree scottie t shirts Free scottie t shirts
Free scottie t shirts Free scottie t shirts
 
Production 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptxProduction 2024 sunderland culture final - Copy.pptx
Production 2024 sunderland culture final - Copy.pptx
 
Reggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirtsReggie miller choke t shirts
Reggie miller choke t shirtsReggie miller choke t shirts
 
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital PresenceCyber Security Services Unveiled: Strategies to Secure Your Digital Presence
Cyber Security Services Unveiled: Strategies to Secure Your Digital Presence
 
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWebiThome_CYBERSEC2024_Drive_Into_the_DarkWeb
iThome_CYBERSEC2024_Drive_Into_the_DarkWeb
 
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
TORTOGEL TELAH MENJADI SALAH SATU PLATFORM PERMAINAN PALING FAVORIT.
 
Development Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of appsDevelopment Lifecycle.pptx for the secure development of apps
Development Lifecycle.pptx for the secure development of apps
 
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkkaudience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
audience research (emma) 1.pptxkkkkkkkkkkkkkkkkk
 
Thank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirtsThank You Luv I’ll Never Walk Alone Again T shirts
Thank You Luv I’ll Never Walk Alone Again T shirts
 
How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?How Do I Begin the Linksys Velop Setup Process?
How Do I Begin the Linksys Velop Setup Process?
 

Webinar slides: How To Upgrade to MySQL 5.7 - The Best Practices

  • 1. Copyright 2016 Severalnines AB How to upgrade to MySQL 5.7 - best practices March 15, 2016 Krzysztof Książek Severalnines krzysztof@severalnines.com 1
  • 2. 2 Your host & some logistics I'm Jean-Jérôme from the Severalnines Team and I'm your host for today's webinar! Feel free to ask any questions in the Questions section of this application or via the Chat box. You can also contact me directly via the chat box or via email: jj@severalnines.com during or after the webinar.
  • 3. Copyright 2016 Severalnines AB ! Preparing an upgrade - changes between MySQL 5.6 and 5.7 ! Information_schema ! SQL modes ! Authentication model ! Testing for upgrade ! Designing test environment ! Building test environment ! Executing tests ! Upgrade process ! Tools which may help you with upgrade process
 3 Agenda
  • 4. Copyright 2016 Severalnines AB Why upgrading to MySQL 5.7? 4
  • 5. Copyright 2016 Severalnines AB ! Better performance ! New features ! Multi source replication ! Intra-schema parallel replication ! Online buffer pool resize!!! ! Improved optimizer cost model ! Access to security and bugfix releases ! 5.5 ended its ‘Premier’ support, ‘Extended’ will end in 2018
 5 Why upgrading to MySQL 5.7?
  • 6. Copyright 2016 Severalnines AB Preparing an upgrade - reviewing changes 6
  • 7. Copyright 2016 Severalnines AB ! Information schema changes ! global_status, session_status, global_variables and session_variables moved to the performance_schema ! You can restore the original behavior by setting:
 SET GLOBAL show_compatibility_56=1 ! This may affect different monitoring solutions 7 Preparing an upgrade - reviewing changes
  • 8. Copyright 2016 Severalnines AB ! SQL mode changes ! STRICT_TRANS_TABLES mode is used by default ! No more inserting of invalid data like zeroed date or skipping column in INSERT when column doesn’t have explicit DEFAULT value ! This may cause issues if application relies on previous (definitely not so good) defaults 8 Preparing an upgrade - reviewing changes
  • 9. Copyright 2016 Severalnines AB ! Authentication model changes ! Pre-4.1 passwords have been removed ! Password expiration has been added ! By default it’s not affecting 5.6 users ( >=5.7.11) but this default may change in the future (http:// mysqlserverteam.com/an-update-on- default_password_lifetime) ! You should manually set the desired expiration policy for every user, after you upgraded to MySQL 5.7 9 Preparing an upgrade - reviewing changes
  • 10. Copyright 2016 Severalnines AB ! Redo and undo log format changed - use innodb_fast_shutdown=0 when you stop 5.6 for upgrade ! YEAR(2) format has been removed ! User-defined locks system has changed - multiple locks are now possible ! ‘derived_merge’ optimizer switch may trigger SQL incompatibility ! For full list of changes look at: http://dev.mysql.com/doc/ refman/5.7/en/upgrading-from-previous-series.html
 10 Preparing an upgrade - reviewing changes
  • 11. Copyright 2016 Severalnines AB Testing for upgrade 11
  • 12. Copyright 2016 Severalnines AB Testing for upgrade 12
  • 13. Copyright 2016 Severalnines AB ! First step - design your test environment ! It should be as close to the production as possible ! Weaker hardware will lead to incorrect results ! Queries may be slower on weaker CPU and I/O subsystem ! or you will not catch a real regression - thinking it’s the hardware’s fault 13 Testing for upgrade
  • 14. Copyright 2016 Severalnines AB ! Dataset should be as close to the real data as possible ! Scrubbing dataset or cleaning confidential data may impact query execution plans - if you don’t have to, don’t clean your data ! You should be using real-world queries to test the performance ! Ideally, use your application for testing the logic and making sure all processes work as expected. 14 Testing for upgrade
  • 15. Copyright 2016 Severalnines AB ! Simplest way of building a test environment: ! create a slave from production master ! and then cut off replication ! Once we have 5.6 node with current dataset, we need to create another 5.6 node with a copy of this data ! Finally, we want to upgrade one of them to MySQL 5.7 ! It’s nice as we can test the upgrade process while building test hosts 15 Testing for upgrade
  • 16. Copyright 2016 Severalnines AB ! We have hosts but we need to collect data for tests ! tcpdump or just slow query log would do ! both have some impact on the overall performance ! tcpdump can be executed outside of the database, to minimize the impact ! You want to collect all the queries - if you have some processes scheduled to run at a particular time, collect those queries too when they happen 16 Testing for upgrade
  • 17. Copyright 2016 Severalnines AB ! Once you have data, you can run some preliminary regression testing using pt-upgrade ! Run twice, first time using the ‘—save-results’ flag - it’ll save your time ! Generate report, investigate any reported issues ! pt-upgrade compares performance and result set ! Make sure you execute tests locally on the hosts, network latency may cause some impact ! Make sure both nodes are in the same state - cold or warmed up in exactly the same way 17 Testing for upgrade
  • 18. Copyright 2016 Severalnines AB ! pt-upgrade is not enough to cover all issues - yes, it’ll check performance and some obvious issues but you need to run more detailed tests ! If you have a set of acceptance tests you use to test new releases (you should have them), you can use those tests to check if upgrade affected core functions of your app ! Test application logic, make sure all operations work correctly, check all of the processes and APIs you may have in your app 18 Testing for upgrade
  • 19. Copyright 2016 Severalnines AB ! Once you have completed your tests, there's one more thing to check ! Rebuild your 5.7 node ! provision it again ! run mysql_upgrade, as you did earlier ! set it up as a slave ! Allow it to work as a slave for couple of days - it’ll confirm replication works fine between old and new versions 19 Testing for upgrade
  • 20. Copyright 2016 Severalnines AB Upgrade process 20
  • 21. Copyright 2016 Severalnines AB ! Start with a single slave and upgrade it: ! Disable innodb_fast_shutdown ! Shut down MySQL ! Upgrade binaries to MySQL 5.7 ! Start MySQL ! Run mysql_upgrade ! Restart MySQL ! Make sure replication is working and if needed, fix it
 21 Upgrade process
  • 22. Copyright 2016 Severalnines AB ! Before upgrade - make sure you took the node out of rotation in a proxy layer or in your application ! After upgrade - if possible, put some limited traffic on the new host ! Observe how it behaves under real-world traffic ! CPU ! I/O ! Memory utilization 22 Upgrade process
  • 23. Copyright 2016 Severalnines AB ! Step by step increase the load to a normal level ! If everything is ok, proceed with upgrade on remaining slaves ! Once all of the slaves are upgraded, pick one of them as a new master ! Set it in a master-master replication with current, 5.6 master 23 Upgrade process
  • 24. Copyright 2016 Severalnines AB ! Perform a switchover to the new master ! If the old master keeps replicating, that’s great - upgrade it in a regular way ! If the old master replication breaks (i.e. incompatibilities in binlog format between old and new MySQL versions), rebuild it: ! Wipe the data ! Perform binary upgrade to MySQL 5.7 ! Provision the data from slave and set up the replication
 24 Upgrade process
  • 25. Copyright 2016 Severalnines AB Tools which may help you with upgrade process 25
  • 26. Copyright 2016 Severalnines AB ! tcpdump ! tcpdump -s 65535 -x -nn -q -tttt -i any port 3306 > mysql.tcp.txt ! Helps you to collect queries exchanged between application hosts and database server ! Minimizes the impact caused by data collection (when executed outside of database node) 26 Tools which may help you with upgrade process
  • 27. Copyright 2016 Severalnines AB ! pt-upgrade, Percona Playback ! pt-upgrade is designed to check for performance and basic result set regressions ! Points you to queries which are not performing on the new version or they return different data ! Percona Playback is designed for load testing - replays slow log, trying to simulate real-world workload 27 Tools which may help you with upgrade process
  • 28. Copyright 2016 Severalnines AB ! MaxScale and ProxySQL ! Database-aware proxies help you through the upgrade process ! They route the traffic off the node when it goes down ! Help you with a warm-up period - use lower weight for new hosts to allow them to warm up properly ! ProxySQL can handle graceful switchover when used with external tool (for example, mysqlrpladmin, MHA or ClusterControl)
 28 Tools which may help you with upgrade process
  • 29. Copyright 2016 Severalnines AB ! mysqlrpladmin, MHA ! Those tools can perform a switchover for you ! No need to make the changes in manual and error prone way - just run a script ! Those tools can be integrated with ProxySQL for graceful switchovers 29 Tools which may help you with upgrade process
  • 30. Copyright 2016 Severalnines AB ! ClusterControl ! Helps with provisioning of new nodes ! Perform a switchover for you ! Gives you clear insight into replication status ! Gives you clear insight into all database operations 30 Tools which may help you with upgrade process
  • 31. Copyright 2015 Severalnines AB ! More blogs covering different aspects of MySQL operations: ! http://severalnines.com/blog-categories/db-ops ! An ebook focused on upgrade process to MySQL 5.7 will become available soon ! Step-by-step guide through each part of the process ! Detailed explanations of different issues you may run into ! We’ll be at Percona Live in April, see you there! ! Contact: jj@severalnines.com
 31 Thank You!