SlideShare a Scribd company logo
1 of 23
1
MySQL HA Solution - Percona Cluster
Agenda
• Need for HA
• Principle of Distributed computing.
• MySQL HA Solutions Available.
• Introduction to Galera.
• Percona Cluster.
• Node Recovery.
• Things to be considered.
2
3
• Senior MySQL DBA Yahoo!
• Focus MySQL HA and Sharding
• MySQL Experience 4 Years
• Student MS ( FOSS ) MIT
• Blogger remotemysqldba.blogspot.in
About Myself : P.R.KarthiK
Need For HA
• Site Reliability
• Failover
• Disaster Recovery
• Scheduled / Unscheduled downtime.
• Avoid Single Point Failure
4
Principle of Distributed
Computing
CAP Theorem
5
Principle of Distributed
Computing
CAP Theorem
•Only Two out of three
AP – MySQL Replication
CA – Galera Cluster
6
MySQL HA Solutions Available
• Master – Slave
• Master – Master
• Single Writer
• NDB Cluster ( MySQL )
• Galera Cluster
• Tungsten Replicator
• Storage Level Replication ( DRDB)
7
Introduction To Galera
• Founded By Codership
• Synchronous Replication
• Parallel Replication
• Multi-Threaded
• Automated node recovery
• Zero slave lag
• Read/ Write Scalable
• WAN Based Optimization.
• A True Open Source.
8
Introduction To Galera
What is Galera ?
Galera is a replication plugin for the synchronous and
multi-master replication to achieve HA.
“Wsrep_provider_options” controls library.
Percona Cluster
MariaDB Cluster
Used over MySQL
9
Introduction To Galera
• Shared nothing Architecture.
• Network is the heart.
What is wsrep ? (Write Set REPlication )
It is an API to connect the Galera library and control
characteristics. It helps to implement synchronous
replication and certification based multi-master-
replication.
10
Introduction To Galera
Simple Architecture
11
Percona Cluster
• Use Galera Library
• XtraDB
• Xtrabackup
+ +
12
Percona Cluster
Why Percona Server ?
•Enhanced InnoDB (XtraDB )
•Performance Improvement
•Xtrabackup ( Makes SST better )
•A better MySQL
13
Transaction in Galera.
• Transaction is handled by Galera Plugin.
• Uses traditional dual phase commit.
• It also handles locking.
• Uses the optimistic locking method.
• The commits are based on certifications (keys).
• Smaller transaction are always better.
• Increase in network latency increases query time.
14
Transaction in Galera.
15
Transaction in Galera.
• Synchronous ( Virtual ) Replication.
• Wsrep_causal_reads=ON ( true synchronous)
• Auto_increment is handled by cluster.
• Uses GTID for Transaction.
16
Node Recovery
17
• Node recovery is automated.
• Validates the gcache for state files.
• Chooses the State Transfer method
1) IST (Incremental State Transfer)
2)SST (State Snapshot Transfer )
Node Recovery
18
IST :
•Recover from write sets in gcache.
•Faster recovery method.
•Have good gcache size.
Node Recovery
19
SST :
State Snapshot Transfer the complete transfer
( Cloning ) of data to recreate a node.
*when not in Gcache
*Adding a new node
Different Methods of SST
Xtrabackup (best ) , rsync , mysqldump .
Node Recovery
20
Validate Node after recovery
Wsrep_local_state_Comment
1)Joining
2)Donor/desynced
3)Joined
4)Synced
Things should be considered.
21
• Support only Transactional engines.
• Row Based replication.
• Read commited Isolation.
• Innodb_autoinc_lock_mode=2.
• Avoid huge transactions.
• Wsrep_max_ws_rows (128K)
• Wsrep_max_ws_size. (1G)
• Network is the heart.
• Keep the DB design simple
IMAGE Courtesy
•Galera and Percona cluster documentation
•http://opentodo.net/2012/12/mysql-multi-master-
replication-with-galera/
22
Queries ?
remotemysqldba.blogspot.in
23

More Related Content

What's hot

Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql FabricMysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControlWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Continuent
 

What's hot (19)

ProxySQL for MySQL
ProxySQL for MySQLProxySQL for MySQL
ProxySQL for MySQL
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
Mysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql FabricMysql User Camp : 20-June-14 : Mysql Fabric
Mysql User Camp : 20-June-14 : Mysql Fabric
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL Shell for Database Engineers
MySQL Shell for Database EngineersMySQL Shell for Database Engineers
MySQL Shell for Database Engineers
 
Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )Percona XtraDB Cluster ( Ensure high Availability )
Percona XtraDB Cluster ( Ensure high Availability )
 
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
MySQL Load Balancers - Maxscale, ProxySQL, HAProxy, MySQL Router & nginx - A ...
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud Era
 
State transfer With Galera
State transfer With GaleraState transfer With Galera
State transfer With Galera
 
Migrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at FacebookMigrating from InnoDB and HBase to MyRocks at Facebook
Migrating from InnoDB and HBase to MyRocks at Facebook
 
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 )
 
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
Ansible is Our Wishbone(Automate DBA Tasks With Ansible)
 
Proxysql use case scenarios plam 2016
Proxysql use case scenarios    plam 2016Proxysql use case scenarios    plam 2016
Proxysql use case scenarios plam 2016
 
How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?How to upgrade like a boss to my sql 8.0?
How to upgrade like a boss to my sql 8.0?
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
Proxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynoteProxysql ha plam_2016_2_keynote
Proxysql ha plam_2016_2_keynote
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControlWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #7: ClusterControl
 
Technical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPASTechnical Introduction to PostgreSQL and PPAS
Technical Introduction to PostgreSQL and PPAS
 

Similar to MySQL HA Percona cluster @ MySQL meetup Mumbai

Scaling MySQL Using Fabric
Scaling MySQL Using FabricScaling MySQL Using Fabric
Scaling MySQL Using Fabric
Remote MySQL DBA
 
In-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great TasteIn-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great Taste
DataWorks Summit
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
hannonhill
 

Similar to MySQL HA Percona cluster @ MySQL meetup Mumbai (20)

How does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsDataHow does Apache Pegasus (incubating) community develop at SensorsData
How does Apache Pegasus (incubating) community develop at SensorsData
 
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
 
Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2Scaling with sync_replication using Galera and EC2
Scaling with sync_replication using Galera and EC2
 
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
Transitioning From SQL Server to MySQL - Presentation from Percona Live 2016
 
Scaling MySQL Using Fabric
Scaling MySQL Using FabricScaling MySQL Using Fabric
Scaling MySQL Using Fabric
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
Getting started with Riak in the Cloud
Getting started with Riak in the CloudGetting started with Riak in the Cloud
Getting started with Riak in the Cloud
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly Available
 
Performance out
Performance outPerformance out
Performance out
 
Percona XtraDB Cluster
Percona XtraDB ClusterPercona XtraDB Cluster
Percona XtraDB Cluster
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
JavaOne2016 - Microservices: Terabytes in Microseconds [CON4516]
 
Introducing Infinispan
Introducing InfinispanIntroducing Infinispan
Introducing Infinispan
 
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
 
In-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great TasteIn-memory Caching in HDFS: Lower Latency, Same Great Taste
In-memory Caching in HDFS: Lower Latency, Same Great Taste
 
Apache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling OutApache Performance Tuning: Scaling Out
Apache Performance Tuning: Scaling Out
 
Optimizing MySQL for Cascade Server
Optimizing MySQL for Cascade ServerOptimizing MySQL for Cascade Server
Optimizing MySQL for Cascade Server
 
Hazelcast 101
Hazelcast 101Hazelcast 101
Hazelcast 101
 
Writing Scalable Software in Java
Writing Scalable Software in JavaWriting Scalable Software in Java
Writing Scalable Software in Java
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 

MySQL HA Percona cluster @ MySQL meetup Mumbai

  • 1. 1 MySQL HA Solution - Percona Cluster
  • 2. Agenda • Need for HA • Principle of Distributed computing. • MySQL HA Solutions Available. • Introduction to Galera. • Percona Cluster. • Node Recovery. • Things to be considered. 2
  • 3. 3 • Senior MySQL DBA Yahoo! • Focus MySQL HA and Sharding • MySQL Experience 4 Years • Student MS ( FOSS ) MIT • Blogger remotemysqldba.blogspot.in About Myself : P.R.KarthiK
  • 4. Need For HA • Site Reliability • Failover • Disaster Recovery • Scheduled / Unscheduled downtime. • Avoid Single Point Failure 4
  • 6. Principle of Distributed Computing CAP Theorem •Only Two out of three AP – MySQL Replication CA – Galera Cluster 6
  • 7. MySQL HA Solutions Available • Master – Slave • Master – Master • Single Writer • NDB Cluster ( MySQL ) • Galera Cluster • Tungsten Replicator • Storage Level Replication ( DRDB) 7
  • 8. Introduction To Galera • Founded By Codership • Synchronous Replication • Parallel Replication • Multi-Threaded • Automated node recovery • Zero slave lag • Read/ Write Scalable • WAN Based Optimization. • A True Open Source. 8
  • 9. Introduction To Galera What is Galera ? Galera is a replication plugin for the synchronous and multi-master replication to achieve HA. “Wsrep_provider_options” controls library. Percona Cluster MariaDB Cluster Used over MySQL 9
  • 10. Introduction To Galera • Shared nothing Architecture. • Network is the heart. What is wsrep ? (Write Set REPlication ) It is an API to connect the Galera library and control characteristics. It helps to implement synchronous replication and certification based multi-master- replication. 10
  • 11. Introduction To Galera Simple Architecture 11
  • 12. Percona Cluster • Use Galera Library • XtraDB • Xtrabackup + + 12
  • 13. Percona Cluster Why Percona Server ? •Enhanced InnoDB (XtraDB ) •Performance Improvement •Xtrabackup ( Makes SST better ) •A better MySQL 13
  • 14. Transaction in Galera. • Transaction is handled by Galera Plugin. • Uses traditional dual phase commit. • It also handles locking. • Uses the optimistic locking method. • The commits are based on certifications (keys). • Smaller transaction are always better. • Increase in network latency increases query time. 14
  • 16. Transaction in Galera. • Synchronous ( Virtual ) Replication. • Wsrep_causal_reads=ON ( true synchronous) • Auto_increment is handled by cluster. • Uses GTID for Transaction. 16
  • 17. Node Recovery 17 • Node recovery is automated. • Validates the gcache for state files. • Chooses the State Transfer method 1) IST (Incremental State Transfer) 2)SST (State Snapshot Transfer )
  • 18. Node Recovery 18 IST : •Recover from write sets in gcache. •Faster recovery method. •Have good gcache size.
  • 19. Node Recovery 19 SST : State Snapshot Transfer the complete transfer ( Cloning ) of data to recreate a node. *when not in Gcache *Adding a new node Different Methods of SST Xtrabackup (best ) , rsync , mysqldump .
  • 20. Node Recovery 20 Validate Node after recovery Wsrep_local_state_Comment 1)Joining 2)Donor/desynced 3)Joined 4)Synced
  • 21. Things should be considered. 21 • Support only Transactional engines. • Row Based replication. • Read commited Isolation. • Innodb_autoinc_lock_mode=2. • Avoid huge transactions. • Wsrep_max_ws_rows (128K) • Wsrep_max_ws_size. (1G) • Network is the heart. • Keep the DB design simple
  • 22. IMAGE Courtesy •Galera and Percona cluster documentation •http://opentodo.net/2012/12/mysql-multi-master- replication-with-galera/ 22