MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+...
Transcript of MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+...
![Page 1: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/1.jpg)
MySQL High Availability solutions Bjorn Naessens
![Page 2: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/2.jpg)
Certificates MySQL 5.6 OCP Oracle Linux 5/6 Oracle VM 2.x/3.X Oracle Database 12c
Blog : http://bjornnaessens.wordpress.com Twitter : @Bjornnaessens Email : [email protected]
About Me
04/06/15 2
![Page 3: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/3.jpg)
Non-shared storage Solutions Mysql Replication
DRBD Mysql Cluster
Shared storage solutions OS Clustering ( Clusterware )
Virtualisation ( OVM )
Types of HA Solutions
04/06/15 3
![Page 4: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/4.jpg)
MySQL Replication
04/06/15 4
![Page 5: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/5.jpg)
04/06/15 5
![Page 6: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/6.jpg)
• GTID • GTID_mode • Enforce_gtid_consistency
• Sync_binlog • Flushes binlog to disk after every transaction • 5% overhead • Loss-less automatic recovery
MySQL Replication – important parameters
04/06/15 6
![Page 7: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/7.jpg)
• Async & semi-sync , Sync not possible • Phantom Reads with semi-sync
• Session only continues when slave sends ACK, but commit already happened
• No write scale-out • GTID has some restrictions • No automatic failover out of the box • No automatic client redirection • Performance overhead
MySQL Replication – keep in mind
04/06/15 7
![Page 8: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/8.jpg)
• Semi-sync • Loss-less • Possible to wait for more than 1 slave
• Higher throughput • Apply in parallel • Less overhead on semi-sync
• Performance schema tables for slave monitoring
MySQL Replication – new in 5.7
04/06/15 8
![Page 9: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/9.jpg)
• Multi-source replication
MySQL Replication – Labs
04/06/15 9
![Page 10: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/10.jpg)
• Group Replication • Multi-master • No failover needed • No single point of failure • Scale-out write and/or reads
MySQL Replication – Labs
04/06/15 10
![Page 11: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/11.jpg)
• Mysql utilities • Mysqlrplcheck • Mysqlrpladmin • Mysqlrplsync • Mysqlfailover
• Mysql Enterprise Monitor
• Performance • Status check of all masters and slaves • Alerting
• Demo
MySQL Replication – Monitoring
04/06/15 11
![Page 12: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/12.jpg)
DRBD
04/06/15 12
![Page 13: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/13.jpg)
• only linux 6.2+ and innodb • more complex to setup and manage
• Corosync + pacemaker setup • Split-brain resolving
• Higher performance overhead • No delay • No filtered replication • No read scale-out • sync!
DRBD – vs replication
04/06/15 13
![Page 14: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/14.jpg)
MySQL Cluster
04/06/15 14
![Page 15: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/15.jpg)
MySQL Cluster -‐ sharding
04/06/15 15
![Page 16: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/16.jpg)
• Highest level of Availability ( 99,999% uptime ) • All operations are online ( upgrades, schema changes, … )
• Write-scaleable • NDB storage engine ( In-memory ) • Auto Sharding • Multi-master • Sync • No single point of failure
MySQL Cluster
04/06/15 16
![Page 17: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/17.jpg)
• Replication between multiple clusters • Active-Active
• Update anywhere • Conflict detection ( auto-resolution in 7.4 )
MySQL Cluster -‐ Geo-‐replication
04/06/15 17
![Page 18: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/18.jpg)
• Many restrictions on application design • Some joins need to be adjusted to be able to work cross data-nodes • Full table scans are inherently slow
• Does the database fit in memory • Do you need fulltext search
• Eval Guide • http://www.mysql.com/why-mysql/white-papers/mysql-cluster-
evaluation-guide/
MySQL Cluster – is it for me?
04/06/15 18
![Page 19: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/19.jpg)
Mysql Fabric
04/06/15 19
![Page 20: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/20.jpg)
• Framework for python scripts to manage your MySQL 5.6+ environment
• Automates failover in a HA group • Single point of connection for the application • Mysql Fabric itself a single point of failure • Connectors need to be aware of the mysql fabric
• Python, Java, PHP, .net, C(labs)
• No GUI, only CLI at this time. • Can scale out writes by sharding between HA groups
• Application determines shard key
Mysql Fabric
04/06/15 20
![Page 21: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/21.jpg)
Bringing it all together
04/06/15 21
![Page 22: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/22.jpg)
How to decide
04/06/15 22
• Shared / non-shared Storage
• OS • Storage engines • Data-loss • Application level Fail-over • Uptime requirements • Scaleout possibilities
![Page 23: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/23.jpg)
Don’t Forget
04/06/15 23
• HA is not Database only!
![Page 24: MySQL&High&Availability&solutions&•Framework for python scripts to manage your MySQL 5.6+ environment • Automates failover in a HA group • Single point of connection for the](https://reader030.fdocuments.net/reader030/viewer/2022040513/5e691791c785414b5116067b/html5/thumbnails/24.jpg)
MySQL Replication Whitepaper: http://www.mysql.com/why-mysql/white-papers/mysql-replication-introduction
Oracle Linux and DRBD for MySQL Enterprise Edition Whitepaper: http://www.mysql.com/why-mysql/white-papers/mysql_wp_drbd.php
MySQL Cluster Whitepaper: http://mysql.com/why-mysql/white-papers/mysql_wp_scaling_web_databases.php
MySQL Fabric - A Guide to Managing MySQL High Availability and Scaling Out white paper
http://www.mysql.com/why-mysql/white-papers/mysql-fabric-product-guide/
MySQL High Availability Documentation: http://dev.mysql.com/doc/refman/5.6/en/ha-overview
Sources
04/06/15 24