1
MySQL HA Solution - Percona Cluster
Agenda
• Need for HA
• Principle of Distributed computing.
• MySQL HA Solutions Available.
• Introduction to Galera.
• Per...
3
• Senior MySQL DBA Yahoo!
• Focus MySQL HA and Sharding
• MySQL Experience 4 Years
• Student MS ( FOSS ) MIT
• Blogger r...
Need For HA
• Site Reliability
• Failover
• Disaster Recovery
• Scheduled / Unscheduled downtime.
• Avoid Single Point Fai...
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
•...
Introduction To Galera
• Founded By Codership
• Synchronous Replication
• Parallel Replication
• Multi-Threaded
• Automate...
Introduction To Galera
What is Galera ?
Galera is a replication plugin for the synchronous and
multi-master replication to...
Introduction To Galera
• Shared nothing Architecture.
• Network is the heart.
What is wsrep ? (Write Set REPlication )
It ...
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 )
...
Transaction in Galera.
• Transaction is handled by Galera Plugin.
• Uses traditional dual phase commit.
• It also handles ...
Transaction in Galera.
15
Transaction in Galera.
• Synchronous ( Virtual ) Replication.
• Wsrep_causal_reads=ON ( true synchronous)
• Auto_increment...
Node Recovery
17
• Node recovery is automated.
• Validates the gcache for state files.
• Chooses the State Transfer method...
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 ...
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.
...
IMAGE Courtesy
•Galera and Percona cluster documentation
•http://opentodo.net/2012/12/mysql-multi-master-
replication-with...
Queries ?
remotemysqldba.blogspot.in
23
Upcoming SlideShare
Loading in...5
×

MySQL HA Percona cluster @ MySQL meetup Mumbai

1,087

Published on

Percona Cluster ( Galera ) is one of the best database solution that provides synchronous replication. The feature like automatic recovery, GTID and multi threaded replication makes it powerful along with ( XtraDB and Xtrabackup ).

The good solution for MySQL HA.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,087
On Slideshare
0
From Embeds
0
Number of Embeds
48
Actions
Shares
0
Downloads
0
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

MySQL HA Percona cluster @ MySQL meetup Mumbai

  1. 1. 1 MySQL HA Solution - Percona Cluster
  2. 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. 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. 4. Need For HA • Site Reliability • Failover • Disaster Recovery • Scheduled / Unscheduled downtime. • Avoid Single Point Failure 4
  5. 5. Principle of Distributed Computing CAP Theorem 5
  6. 6. Principle of Distributed Computing CAP Theorem •Only Two out of three AP – MySQL Replication CA – Galera Cluster 6
  7. 7. MySQL HA Solutions Available • Master – Slave • Master – Master • Single Writer • NDB Cluster ( MySQL ) • Galera Cluster • Tungsten Replicator • Storage Level Replication ( DRDB) 7
  8. 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. 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. 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. 11. Introduction To Galera Simple Architecture 11
  12. 12. Percona Cluster • Use Galera Library • XtraDB • Xtrabackup + + 12
  13. 13. Percona Cluster Why Percona Server ? •Enhanced InnoDB (XtraDB ) •Performance Improvement •Xtrabackup ( Makes SST better ) •A better MySQL 13
  14. 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
  15. 15. Transaction in Galera. 15
  16. 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. 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. 18. Node Recovery 18 IST : •Recover from write sets in gcache. •Faster recovery method. •Have good gcache size.
  19. 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. 20. Node Recovery 20 Validate Node after recovery Wsrep_local_state_Comment 1)Joining 2)Donor/desynced 3)Joined 4)Synced
  21. 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. 22. IMAGE Courtesy •Galera and Percona cluster documentation •http://opentodo.net/2012/12/mysql-multi-master- replication-with-galera/ 22
  23. 23. Queries ? remotemysqldba.blogspot.in 23

×