Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

XtraDB Cluster

1,275 views

Published on

Slides for my XtraDB Talk at #ipc12

Published in: Technology
  • Be the first to comment

XtraDB Cluster

  1. 1. XtraDB ClusterDie neue MySQL HA Lösung
  2. 2. Florian Pfeiffer @derfloh 2
  3. 3. Platform Engineer 3
  4. 4. 4
  5. 5. 5
  6. 6. Global Trade Publishing Global Education & Science Holtzbrinck Media Holtzbrinck Digital Newspapers & Investments Holtzbrinck Ventures 6
  7. 7. 11.000 Fragen / Tag 130Gb Datenbank 134 Mio. PIs / Monat~60 Server Gutefrage.net 4 Datenbankserver loggen 100 Mio Datenpunkte/Tag 35.000 Antworten / Tag 7
  8. 8. Hochverfügbarkei 8
  9. 9. Hochverfügbarkei 9
  10. 10. Redundanz 10
  11. 11. Failover 11
  12. 12. Wahrscheinlichkeiten...1 Server = P2 Server = P/2..... 12
  13. 13. Datenbanken Service Daten 13
  14. 14. Service <-> Daten Verfügbarkeit 14
  15. 15. Service vs. Daten 15
  16. 16. Replikation 16
  17. 17. Asynchron 17
  18. 18. Asynchron 18
  19. 19. Asynchron Cosmiq - DB Replication delay check Gutefrage - Alle LoggedIn auf Master 19
  20. 20. Synchron 20
  21. 21. Synchron 21
  22. 22. „Dafür setze ich DRBD ein...“ 22
  23. 23. „Dafür setze ich DRBD ein...“ 23
  24. 24. Percona XtraDB WSREP Galera 24
  25. 25. XtraDB Cluster 25
  26. 26. Virtually Synchronous 26
  27. 27. Multi Master: MySQL 27
  28. 28. Multi Master: XtraDB 28
  29. 29. Parallel Apply: MySQL 29
  30. 30. Parallel Apply: XtraDB 30
  31. 31. Datenkonsistenz 31
  32. 32. Zusätzliche Nodes Join Data 32
  33. 33. State Transfer 33
  34. 34. Gesamte DatenSnapshot State Transfer per MySQLDump, Rsync oder XtraBackup 34
  35. 35. DeltaIncremental State Transfer 35
  36. 36. Das klingt ja alles schön&gut, aber... 36
  37. 37. CAP Theorem Konsistenz C A P Verfügbarkeit Partitionstoleranzhttp://de.wikipedia.org/wiki/CAP-Theorem 37
  38. 38. Network Failure MySQL Verfügbarkeit aller Systeme aber Dateninkonsistenz 38
  39. 39. Network Failure XtraDB Nicht alle Systeme verfügbar aber Datenkonsistenz 39
  40. 40. Split Brain ? ? ? ?? ? ? 40
  41. 41. Split Brain Cluster erst sinnvoll ab 3 Nodes (o. 2 Nodes + 1 Arbitrator) 41
  42. 42. EinschränkungenMyISAM Support experimentellOptimistic locking 42
  43. 43. Locking Transaktion 1 Transaktion 2Begin BeginUpdate t where id=10 ... Update t where id=10 ......Commit Wartet auf Tx1 43
  44. 44. Optimistic Locking Transaktion 1 Transaktion 2 BeginBegin Update t where id=10 ...Update t where id=10 ... ...... CommitCommit Fehler wegen Row Conflict 44
  45. 45. Das schwächste Glied in der Kette bestimmt die Schreibperformance Bild: Duff Axsom / Flickr 45
  46. 46. Das schwächste Glied in der Kette Write in Write in Confirm out Confirm out write Write out Confirms in all confirmed 46
  47. 47. Skalierbarkeit 47
  48. 48. Schreiben Kein Gewinn 48
  49. 49. Lesen Linear 49
  50. 50. XtraDB & HAProxy 50
  51. 51. XtraDB & HAProxy 51
  52. 52. 52
  53. 53. show status like ´wsrep%´ ..... wsrep_local_state |4 wsrep_local_state_comment | Synced (6) wsrep_cluster_status | Primary ...... 53
  54. 54. Achtung 54
  55. 55. Nachtschicht 55
  56. 56. Split Brain 56
  57. 57. Umzug Rechenzentrum 57
  58. 58. Bild: spine / Flickr 58
  59. 59. RZ alt RZ neu 59
  60. 60. RZ alt RZ neu? ? ? ? ? ? ? 60
  61. 61. RZ alt RZ neu 61
  62. 62. Schrank 1 Schrank 2 62
  63. 63. Anderer ProviderSchrank 1 Schrank 2 63
  64. 64. pc.ignore_sb = 1 64
  65. 65. Constraints 65
  66. 66. CREATE TABLE customer (id INT NOT NULL, PRIMARY KEY (id));CREATE TABLE phone (id INT NOT NULL, customer_id INT NOT NULL, PRIMARY KEY (id), FOREIGN KEY (customer_id) REFERENCES customer(id)); 66
  67. 67. delete from customer where id=5; 67
  68. 68. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails 68
  69. 69. WTF?[ERROR] Slave SQL: Could not execute Delete_rows event ontable somedb.some_table; Cant find record in some_table,Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND;[ERROR] WSREP: Failed to apply trx: source:1337a766-b992-11e1-0800-185c16a204a2 version: 2 local: 0 state:CERTIFYING flags: 1 conn_id: 52899913 trx_id: 3397040790[ERROR] WSREP: Failed to apply app buffer: ...[ERROR] WSREP: Node consistency compromized, aborting... 69
  70. 70. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails Aborting 70
  71. 71. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails Aborting Aborting 71
  72. 72. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails Aborting Aborting Aborting 72
  73. 73. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails ? ? Aborting ? ? Aborting Aborting 73
  74. 74. delete from customer where id=5; Cannot delete or update a parent row: a foreign key constraint fails Aborting Disconnected Aborting Aborting 74
  75. 75. Ich will‘s selber testen http://www.mysqlperformanceblog.comz.B. http://www.mysqlperformanceblog.com/2012/06/20/percona-xtradb-cluster-reference-architecture-with-haproxy/ 75
  76. 76. Kann ich es produktiv einsetzen? 76
  77. 77. JA! 77
  78. 78. Noch gute Fragen? http://joind.in/7339 Florian Pfeiffer Engineer gutefrage.net GmbH Ein Unternehmen der Tel +49 89 5151 46-122 Verlagsgruppe Georg von Holtzbrinck Fax +49 89 5151 46-214 Sonnenstrasse 14 Mail florian.pfeiffer@gutefrage.net 80331 München

×