mysql&high&availability&solutions&•framework for python scripts to manage your...
TRANSCRIPT
MySQL High Availability solutions Bjorn Naessens
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
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
MySQL Replication
04/06/15 4
04/06/15 5
• 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
• 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
• 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
• Multi-source replication
MySQL Replication – Labs
04/06/15 9
• 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
• 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
DRBD
04/06/15 12
• 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
MySQL Cluster
04/06/15 14
MySQL Cluster -‐ sharding
04/06/15 15
• 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
• Replication between multiple clusters • Active-Active
• Update anywhere • Conflict detection ( auto-resolution in 7.4 )
MySQL Cluster -‐ Geo-‐replication
04/06/15 17
• 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
Mysql Fabric
04/06/15 19
• 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
Bringing it all together
04/06/15 21
How to decide
04/06/15 22
• Shared / non-shared Storage
• OS • Storage engines • Data-loss • Application level Fail-over • Uptime requirements • Scaleout possibilities
Don’t Forget
04/06/15 23
• HA is not Database only!
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