G a l e r a C l u s t e rSeppo JaakolaCodership
2www.codership.comAgenda● The Meaning of Galera● Galera Cluster Short Introduction● Migrating to Galera Cluster● Galera Pr...
3www.codership.comWhat is the Meaning of Galera ?Turns out it has different semantics in:● Italy● Uruguay● Brazil● Spain, ...
4www.codership.comGalera in ItalyChe cosa significa la parola galera?
5www.codership.comGalera in ItalyChe cosa significa la parola galera?Jail / Prison
6www.codership.comGalera in ItalyChe cosa significa la parola galera?PoliziottoJail / Prison
7www.codership.comOtto Poliziotto ?
8www.codership.comGalera in UruguayQue significa galera en Uruguai?
9www.codership.comGalera in UruguayQue significaca galera en Uruguai?Traditional tall hat
10www.codership.comGalera in BrazilComo sobre em Brazil?
11www.codership.comGalera in BrazilA Group of Happy People
12www.codership.comGalera in Spain, Portugal, Russia...Heres the correct meaning for Galera...
13www.codership.comGalera in Spain, Portugal, Russia...Galley
Galera Cluster
15www.codership.comMariaDBMulti-Master ReplicationGalera Replication
16www.codership.comMariaDB MariaDBMulti-Master ReplicationGalera ReplicationThere can be several nodes
17www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationThere can be several nodes
18www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationClient can connect to any nodeThere ca...
19www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationClient can connect to any nodeThere ca...
20www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationReplication is synchronousread & write...
21www.codership.comMariaDBMulti-Master ReplicationaMulti-master cluster lookslike one big database withmultiple entry poin...
22www.codership.comMariaDB MariaDB MariaDBSynchronous ReplicationaGalera ReplicationRead & writeTransaction isprocessed lo...
23www.codership.comMariaDB MariaDB MariaDBSynchronous ReplicationGalera ReplicationcommitTransactions writeset is replicat...
24www.codership.comGalera ReplicationMariaDB MariaDB MariaDBSynchronous ReplicationOKClient gets OKstatusSlave queueSlave ...
25www.codership.comGalera ReplicationMariaDB MariaDB MariaDBSynchronous ReplicationTransaction isapplied in slavesSlave qu...
26www.codership.comMariaDB MariaDB MariaDBHow node failures are handledaGalera ReplicationLoad Balancing
27www.codership.comMariaDB MariaDB MariaDBQuorumaGalera ReplicationLoad Balancing● Galera uses quorum basedfailure handlin...
Optimistic Concurrency Control
29www.codership.comGalera ReplicationAOptimistic Concurrency ControlcommitTrx ABcommitTrx B
30www.codership.comGalera ReplicationAOptimistic Concurrency ControlcommitTrx ABcommitTrx BDEADLOCKerorROLLBACK
31www.codership.comOptimistic Concurrency Control● Transactions process independentlyin each cluster node● Transaction wri...
32www.codership.comMulti-Master or Not● If your application can handle deadlockerrors, multi-master is good to use● Howeve...
Parallel Replication
34www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be star...
35www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be star...
36www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be star...
38www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdSlave controlAny number of slave applierthread...
39www.codership.comParallel Applying● Aka parallel replication● Every application will benefit of it, because itworks:● no...
Galera Cluster Benefits
41www.codership.comGalera Cluster➢ Good Performance➢ Optimistic concurrency control➢ Virtually synchronous replication➢ Pa...
42www.codership.comGalera Cluster➢ Synchronous multi-master cluster➢ no data loss➢ no slave lag➢ no slave failover➢ For My...
52www.codership.comSynchronous ReplicationThats more like it !!
53www.codership.comSynchronous ReplicationThats more like it !!Row based
54www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterRow based
55www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterAll have Oxford master degreeRow based
56www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterAll have Oxford master degreeSynchronousRow based
57www.codership.comSynchronous ReplicationThats more like it !!Top notch performanceMulti-MasterAll have Oxford master deg...
58www.codership.comSynchronous ReplicationThats more like it !!Top notch performanceMulti-MasterAll have Oxford master deg...
Automatic Node Joining
60www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationjoinerCluster handshake
61www.codership.comMySQL DonorAutomatic Node JoiningGalera ReplicationjoinerSend state
62www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationjoinerCatch upSlave queue
63www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationMySQL
Migrating to Galera Cluster
65www.codership.comMigrating to Galera ClusteringaMySQLslaveMySQLmasterMySQL master slave hierarchy
66www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaInstall first Galera node tooperate as ...
67www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera Clusteringapromote Galera node tooperate as one no...
68www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaJoin more nodes in Galeraslave clusterG...
69www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaMove traffic to Galera clusterGaleraNod...
70www.codership.comGaleraNode 1Migrating to Galera ClusteringaDrop obsolete MySQL serversGaleraNode 2GaleraNode 3
Galera Project
72www.codership.comGalera Project● Galera Cluster for MySQL● 5 years development● based on MySQL server community edition●...
73Who is using Galera?
74www.codership.comGalera ProjectMySQLMariaDBmergemergeMySQL Community EditionMariaDBGalera Cluster for MySQLMariaDB Featu...
75www.codership.comGalera ProjectAPIGalera Replication pluginAPIMariaDBMySQL Community EditionMariaDB Galera ClusterMySQLG...
76www.codership.comGalera SupportCodershipLevel 3 support, GaleraMontyProgramLevel 3 Support, MariaDBGaleraClusterMariaDBG...
Questions?Thank you for listening!Happy Clustering :-)
High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin
Upcoming SlideShare
Loading in...5
×

High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin

1,544

Published on

High Availability with Galera Cluster by Seppo Jaakkola, Codership at the SkySQL Road Show 2013 in Berlin 18.6.2013

Published in: Technology, Travel
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,544
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
24
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

High Availability with Galera Cluster - SkySQL Road Show 2013 in Berlin

  1. 1. G a l e r a C l u s t e rSeppo JaakolaCodership
  2. 2. 2www.codership.comAgenda● The Meaning of Galera● Galera Cluster Short Introduction● Migrating to Galera Cluster● Galera Project● MariaDB Galera Cluster 5.5.29 GA
  3. 3. 3www.codership.comWhat is the Meaning of Galera ?Turns out it has different semantics in:● Italy● Uruguay● Brazil● Spain, Portugal, Russia...
  4. 4. 4www.codership.comGalera in ItalyChe cosa significa la parola galera?
  5. 5. 5www.codership.comGalera in ItalyChe cosa significa la parola galera?Jail / Prison
  6. 6. 6www.codership.comGalera in ItalyChe cosa significa la parola galera?PoliziottoJail / Prison
  7. 7. 7www.codership.comOtto Poliziotto ?
  8. 8. 8www.codership.comGalera in UruguayQue significa galera en Uruguai?
  9. 9. 9www.codership.comGalera in UruguayQue significaca galera en Uruguai?Traditional tall hat
  10. 10. 10www.codership.comGalera in BrazilComo sobre em Brazil?
  11. 11. 11www.codership.comGalera in BrazilA Group of Happy People
  12. 12. 12www.codership.comGalera in Spain, Portugal, Russia...Heres the correct meaning for Galera...
  13. 13. 13www.codership.comGalera in Spain, Portugal, Russia...Galley
  14. 14. Galera Cluster
  15. 15. 15www.codership.comMariaDBMulti-Master ReplicationGalera Replication
  16. 16. 16www.codership.comMariaDB MariaDBMulti-Master ReplicationGalera ReplicationThere can be several nodes
  17. 17. 17www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationThere can be several nodes
  18. 18. 18www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationClient can connect to any nodeThere can be several nodes
  19. 19. 19www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationClient can connect to any nodeThere can be several nodesread & write read & write read & write Read & write access to any node
  20. 20. 20www.codership.comMariaDB MariaDB MariaDBMulti-Master ReplicationGalera ReplicationReplication is synchronousread & write read & write read & writeClient can connect to any nodeThere can be several nodesRead & write access to any node
  21. 21. 21www.codership.comMariaDBMulti-Master ReplicationaMulti-master cluster lookslike one big database withmultiple entry pointsread & write read & write read & write
  22. 22. 22www.codership.comMariaDB MariaDB MariaDBSynchronous ReplicationaGalera ReplicationRead & writeTransaction isprocessed locally upto commit time
  23. 23. 23www.codership.comMariaDB MariaDB MariaDBSynchronous ReplicationGalera ReplicationcommitTransactions writeset is replicated towhole clusterSlave queueSlave queue
  24. 24. 24www.codership.comGalera ReplicationMariaDB MariaDB MariaDBSynchronous ReplicationOKClient gets OKstatusSlave queueSlave queue
  25. 25. 25www.codership.comGalera ReplicationMariaDB MariaDB MariaDBSynchronous ReplicationTransaction isapplied in slavesSlave queueSlave queue
  26. 26. 26www.codership.comMariaDB MariaDB MariaDBHow node failures are handledaGalera ReplicationLoad Balancing
  27. 27. 27www.codership.comMariaDB MariaDB MariaDBQuorumaGalera ReplicationLoad Balancing● Galera uses quorum basedfailure handling:– When cluster partitioning isdetected, the majoritypartition "has quorum" andcan continue– A minority partition cannotcommit transactions, but willattempt to re-connect toprimary partition– Note: 50% is not majority!=> Minimum 3 nodesrecommended.● Load balancer will notice errors& remove node from pool
  28. 28. Optimistic Concurrency Control
  29. 29. 29www.codership.comGalera ReplicationAOptimistic Concurrency ControlcommitTrx ABcommitTrx B
  30. 30. 30www.codership.comGalera ReplicationAOptimistic Concurrency ControlcommitTrx ABcommitTrx BDEADLOCKerorROLLBACK
  31. 31. 31www.codership.comOptimistic Concurrency Control● Transactions process independentlyin each cluster node● Transaction write sets will bereplicated at commit time (beforecommit)● Cluster wide conflicts will be resolvedand conflict victim must rollbackOptimistic Concurrency Control
  32. 32. 32www.codership.comMulti-Master or Not● If your application can handle deadlockerrors, multi-master is good to use● However, if database has hot-spots, i.e.multi-master conflicts happen frequently,write performance will suffer● But read scalability is always guaranteed● Use Master-Slave, if deadlock errors are aproblem or conflict rate hurts yourperformance
  33. 33. Parallel Replication
  34. 34. 34www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be startedSlave control
  35. 35. 35www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be startedSlave control assigns writesets for slave appliersSlave control
  36. 36. 36www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdAny number of slave applierthreads can be startedSlave control assigns writesets for slave appliersSlave control is on ROW levelSlave control
  37. 37. 38www.codership.comMariaDBParallel ReplicationSlave queueSlave thd Slave thdSlave controlAny number of slave applierthreads can be startedSlave control assigns writesets for slave appliersSlave control is on ROW levelOnly applying is parallelcommit order is dictated
  38. 38. 39www.codership.comParallel Applying● Aka parallel replication● Every application will benefit of it, because itworks:● not on database● not on table● but on row level● wsrep_slave_threads=n● How many slaves makes sense:● Monitor wsrep_cert_deps_distance● Max ~4 * #CPUcores
  39. 39. Galera Cluster Benefits
  40. 40. 41www.codership.comGalera Cluster➢ Good Performance➢ Optimistic concurrency control➢ Virtually synchronous replication➢ Parallel Replication➢ Optimized Group Communication➢ 99.99% transparent➢ InnoDB look & feel➢ Automatic node joining➢ Works in LAN / WAN / Cloud
  41. 41. 42www.codership.comGalera Cluster➢ Synchronous multi-master cluster➢ no data loss➢ no slave lag➢ no slave failover➢ For MySQL/MariaDB InnoDB➢ 3 or more nodes needed for HA➢ No single point of failure
  42. 42. 52www.codership.comSynchronous ReplicationThats more like it !!
  43. 43. 53www.codership.comSynchronous ReplicationThats more like it !!Row based
  44. 44. 54www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterRow based
  45. 45. 55www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterAll have Oxford master degreeRow based
  46. 46. 56www.codership.comSynchronous ReplicationThats more like it !!Multi-MasterAll have Oxford master degreeSynchronousRow based
  47. 47. 57www.codership.comSynchronous ReplicationThats more like it !!Top notch performanceMulti-MasterAll have Oxford master degreeSynchronousRow based
  48. 48. 58www.codership.comSynchronous ReplicationThats more like it !!Top notch performanceMulti-MasterAll have Oxford master degreeArbitratorSynchronousRow based
  49. 49. Automatic Node Joining
  50. 50. 60www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationjoinerCluster handshake
  51. 51. 61www.codership.comMySQL DonorAutomatic Node JoiningGalera ReplicationjoinerSend state
  52. 52. 62www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationjoinerCatch upSlave queue
  53. 53. 63www.codership.comMySQL MySQLAutomatic Node JoiningGalera ReplicationMySQL
  54. 54. Migrating to Galera Cluster
  55. 55. 65www.codership.comMigrating to Galera ClusteringaMySQLslaveMySQLmasterMySQL master slave hierarchy
  56. 56. 66www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaInstall first Galera node tooperate as MySQL slave
  57. 57. 67www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera Clusteringapromote Galera node tooperate as one node cluster
  58. 58. 68www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaJoin more nodes in Galeraslave clusterGaleraNode 2GaleraNode 3
  59. 59. 69www.codership.comMySQLslaveMySQLmasterGaleraNode 1Migrating to Galera ClusteringaMove traffic to Galera clusterGaleraNode 2GaleraNode 3
  60. 60. 70www.codership.comGaleraNode 1Migrating to Galera ClusteringaDrop obsolete MySQL serversGaleraNode 2GaleraNode 3
  61. 61. Galera Project
  62. 62. 72www.codership.comGalera Project● Galera Cluster for MySQL● 5 years development● based on MySQL server community edition● Fully open source● Active community● ~3 releases per year● Latest release 2.3● Major release 3.0 in the works● MariaDB Galera Cluster 5.5.29 GA !!
  63. 63. 73Who is using Galera?
  64. 64. 74www.codership.comGalera ProjectMySQLMariaDBmergemergeMySQL Community EditionMariaDBGalera Cluster for MySQLMariaDB FeaturesAPIMySQLGalera Replication plugin
  65. 65. 75www.codership.comGalera ProjectAPIGalera Replication pluginAPIMariaDBMySQL Community EditionMariaDB Galera ClusterMySQLGalera Cluster for MySQLmergeGalera Replication pluginMySQL
  66. 66. 76www.codership.comGalera SupportCodershipLevel 3 support, GaleraMontyProgramLevel 3 Support, MariaDBGaleraClusterMariaDBGaleraClusterSkySQLSupport Subscriptions
  67. 67. Questions?Thank you for listening!Happy Clustering :-)
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×