MySQL Multi-Site/Multi-Master Done Right
MySQL Clustering for HA and DR
The Dream: Multiple, active DBMS servers with identical data over distance – Too good to be true? High Availability Updates propagated immediately to all servers Transparent read/write to any server High Performance 6
Synchronous multi-master clusters claim to deliver on the dream Table foo id=1, data=6 Ordering Table foo id=1, data=5 Table foo id=7, data=25 [1] id=1, data=6 [2] id=1, data=5 [3] id=7, data=25 7
Synchronous multi-master introduces new problems Table foo id=1, data=6 Ordering Table foo id=1, data=5 REJECTED! Table foo id=7, data=25 [1] id=1, data=6 [2] id=1, data=5 [3] id=7, data=25 •  Slow writes due to synchronous messaging •  Cross-site replication is unstable •  Operations like SELECT FOR UPDATE not supported •  Large transactions lock system or cause failures 8
Synchronous multi-master over WAN makes things worse 8
Can master/slave clusters offer the same benefits? High Availability? Updates propagated immediately? Transparent read/write to any server? High Performance? 9
Good MSMM Starts with Proper HA and High Performance Clusters
Tungsten Clustering: HA, DR and Performance Scaling 24x7 data access SQL load balancing Simple management Off-the-shelf MySQL Benefits 11
Tungsten clusters add HA and scaling without taking features away 110
Failover and Maintenance
Tungsten clusters automatically monitor all cluster nodes for failure MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic Replication Traffic •  Tungsten Manger monitors database health •  Query flow and replication traffic are managed Tungsten ConnectorApplication 20
1. Detect and shun a non- responsive node Cluster rules fail over master if DBMS no longer accepts network connections 2. Halt in-coming connections MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic Replication Traffic •  Tungsten Manger detects a database outage •  Query flow stops, and a new master is chosen 3. Find and promote the most up-to-date slave Tungsten Connector XApplication 21
Failed nodes can be re-provisioned from a backup with a single management command 4. Bring replicator online as Master 5. Resume query flow using new Master MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic •  The replicator on the promoted node is then brought online as a Master •  Query flow is re-enabled so as to get the application online as quickly as possible •  Lastly, any remaining slave replicators will be re-pointed to the newly promoted master 6. Reconfigure Slave replicators to use the new Master 7. Administrator recovers the shunned node as a Slave Tungsten Connector X Application 214
For Multi-Site, Multi-Master We spread that functionality across multiple datacenters
Tungsten Multi-Site/Multi-Master topologies operate independent, active clusters on 2 or more remote sites 33
Tungsten Disaster Recovery creates composite clusters that span sites and are ready for immediate failover 32
Tungsten clusters support Zero-downtime Maintenance operations from parameter changes to app upgrade •  Task: Upgrade MySQL to the latest version •  Problem: Requires a mysqld restart, hence can cause application downtime •  Constraint: Avoid application-visible restart •  Solution: Upgrade nodes in succession 183
Rolling maintenance proceeds node-by-node starting with slaves and proceeding to master Slave upgrade Slave upgrade Switch Master upgrade •  Shun slave •  Upgrade MySQL •  Return node to cluster •  Discard and re-provision on failure •  Repeat for remaining slave(s) •  Switch master to promote an upgraded slave •  Upgrade old master •  Maintenance is now done! 194
MSMM Benefit Summary •  24x7 data access •  SQL load balancing •  Off-the-shelf MySQL support (MySQL Community/Enterprise, Percona Server and MariaDB) •  Simple management •  Multiple datacenters •  Full HA support, including across datacenters •  Intelligent proxying and query redirection •  Full-speed performance with very low latency •  Zero-downtime maintenance 205
Upcoming Training and Webinars •  Tungsten Training Program –  Training -- Tuesday, 13th June 2017, 09:00 PST, 17:00 BST, 30 minutes-- Basics: Introduction to Tungsten Replication –  Training -- Tuesday, 27th June 2017, 09:00 PST, 17:00 BST, 30 minutes -- Basics: Introduction to Tungsten Clustering •  Continuent Webinar Program –  Webinar -- Wednesday, 21st June 2017, 09:00 PST, 17:00 BST, 30 minutes -- Amazon RDS vs. AWS with Continuent Tungsten Clustering
•  Tungsten Replicator builds are available on GitHub: http://github.com/continuent/tungsten-replicator •  Replicator documentation is available on the Continuent website: http://docs.continuent.com/tungsten-replicator-5.1 •  Tungsten Hadoop tools are available on GitHub: https://github.com/continuent/continuent-tools-hadoop 22 Contact Continuent for Annual Support Subscriptions! Getting Started! 66
For more information, contact us: Eric Stone COO eric.stone@continuent.com MC Brown VP Products mc.brown@continuent.com Eero Teerikorpi Founder, CEO eero.teerikorpi@continuent.com +1 (408) 431-3305

Webinar Slides: MySQL Multi-Site Multi-Master Done Right

  • 1.
  • 2.
  • 3.
    The Dream: Multiple,active DBMS servers with identical data over distance – Too good to be true? High Availability Updates propagated immediately to all servers Transparent read/write to any server High Performance 6
  • 4.
    Synchronous multi-master clustersclaim to deliver on the dream Table foo id=1, data=6 Ordering Table foo id=1, data=5 Table foo id=7, data=25 [1] id=1, data=6 [2] id=1, data=5 [3] id=7, data=25 7
  • 5.
    Synchronous multi-master introducesnew problems Table foo id=1, data=6 Ordering Table foo id=1, data=5 REJECTED! Table foo id=7, data=25 [1] id=1, data=6 [2] id=1, data=5 [3] id=7, data=25 •  Slow writes due to synchronous messaging •  Cross-site replication is unstable •  Operations like SELECT FOR UPDATE not supported •  Large transactions lock system or cause failures 8
  • 6.
    Synchronous multi-master overWAN makes things worse 8
  • 7.
    Can master/slave clustersoffer the same benefits? High Availability? Updates propagated immediately? Transparent read/write to any server? High Performance? 9
  • 8.
    Good MSMM Startswith Proper HA and High Performance Clusters
  • 9.
    Tungsten Clustering: HA,DR and Performance Scaling 24x7 data access SQL load balancing Simple management Off-the-shelf MySQL Benefits 11
  • 10.
    Tungsten clusters addHA and scaling without taking features away 110
  • 11.
  • 12.
    Tungsten clusters automaticallymonitor all cluster nodes for failure MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic Replication Traffic •  Tungsten Manger monitors database health •  Query flow and replication traffic are managed Tungsten ConnectorApplication 20
  • 13.
    1. Detect and shuna non- responsive node Cluster rules fail over master if DBMS no longer accepts network connections 2. Halt in-coming connections MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic Replication Traffic •  Tungsten Manger detects a database outage •  Query flow stops, and a new master is chosen 3. Find and promote the most up-to-date slave Tungsten Connector XApplication 21
  • 14.
    Failed nodes canbe re-provisioned from a backup with a single management command 4. Bring replicator online as Master 5. Resume query flow using new Master MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes Replication Traffic •  The replicator on the promoted node is then brought online as a Master •  Query flow is re-enabled so as to get the application online as quickly as possible •  Lastly, any remaining slave replicators will be re-pointed to the newly promoted master 6. Reconfigure Slave replicators to use the new Master 7. Administrator recovers the shunned node as a Slave Tungsten Connector X Application 214
  • 15.
    For Multi-Site, Multi-Master Wespread that functionality across multiple datacenters
  • 16.
    Tungsten Multi-Site/Multi-Master topologiesoperate independent, active clusters on 2 or more remote sites 33
  • 17.
    Tungsten Disaster Recoverycreates composite clusters that span sites and are ready for immediate failover 32
  • 18.
    Tungsten clusters supportZero-downtime Maintenance operations from parameter changes to app upgrade •  Task: Upgrade MySQL to the latest version •  Problem: Requires a mysqld restart, hence can cause application downtime •  Constraint: Avoid application-visible restart •  Solution: Upgrade nodes in succession 183
  • 19.
    Rolling maintenance proceedsnode-by-node starting with slaves and proceeding to master Slave upgrade Slave upgrade Switch Master upgrade •  Shun slave •  Upgrade MySQL •  Return node to cluster •  Discard and re-provision on failure •  Repeat for remaining slave(s) •  Switch master to promote an upgraded slave •  Upgrade old master •  Maintenance is now done! 194
  • 20.
    MSMM Benefit Summary • 24x7 data access •  SQL load balancing •  Off-the-shelf MySQL support (MySQL Community/Enterprise, Percona Server and MariaDB) •  Simple management •  Multiple datacenters •  Full HA support, including across datacenters •  Intelligent proxying and query redirection •  Full-speed performance with very low latency •  Zero-downtime maintenance 205
  • 21.
    Upcoming Training andWebinars •  Tungsten Training Program –  Training -- Tuesday, 13th June 2017, 09:00 PST, 17:00 BST, 30 minutes-- Basics: Introduction to Tungsten Replication –  Training -- Tuesday, 27th June 2017, 09:00 PST, 17:00 BST, 30 minutes -- Basics: Introduction to Tungsten Clustering •  Continuent Webinar Program –  Webinar -- Wednesday, 21st June 2017, 09:00 PST, 17:00 BST, 30 minutes -- Amazon RDS vs. AWS with Continuent Tungsten Clustering
  • 22.
    •  Tungsten Replicatorbuilds are available on GitHub: http://github.com/continuent/tungsten-replicator •  Replicator documentation is available on the Continuent website: http://docs.continuent.com/tungsten-replicator-5.1 •  Tungsten Hadoop tools are available on GitHub: https://github.com/continuent/continuent-tools-hadoop 22 Contact Continuent for Annual Support Subscriptions! Getting Started! 66
  • 23.
    For more information,contact us: Eric Stone COO eric.stone@continuent.com MC Brown VP Products mc.brown@continuent.com Eero Teerikorpi Founder, CEO eero.teerikorpi@continuent.com +1 (408) 431-3305