Top Banner
MySQL Multi-Site/Multi-Master Done Right
23

MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Oct 11, 2019

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

MySQL Multi-Site/Multi-Master Done Right

Page 2: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

MySQL Clustering for HA and DR

Page 3: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

Page 4: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Synchronous multi-master clusters claim to deliver on the dream

Table fooid=1, data=6

Ordering

Table fooid=1, data=5

Table fooid=7, data=25

[1] id=1, data=6 [2] id=1, data=5 [3] id=7, data=25

7

Page 5: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Synchronous multi-master introduces new problems

Table fooid=1, data=6

Ordering

Table fooid=1, data=5

REJECTED!

Table fooid=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

Page 6: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Synchronous multi-master over WAN makes things worse

8

Page 7: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Can master/slave clusters offer the same benefits?

High Availability?

Updates propagated

immediately?

Transparent read/write to any server?

High Performance?

9

Page 8: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Good MSMM Starts with Proper HA and High Performance Clusters

Page 9: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Tungsten Clustering: HA, DR and Performance Scaling

24x7 data access

SQL load balancing Simple management

Off-the-shelf MySQL Benefits

11

Page 10: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Tungsten clusters add HA and scaling without taking features away

110

Page 11: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Failover and Maintenance

Page 12: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Tungsten clusters automatically monitor all cluster nodes for failure

MySQLMaster

MySQLSlave

MySQLSlave

Reads & Writes

Reads & Writes

Replication Traffic

Replication Traffic

•  Tungsten Manger monitors database health

•  Query flow and replication traffic are managed

TungstenConnectorApplication

20

Page 13: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

MySQLSlave

MySQLSlave

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

TungstenConnector

XApplication

21

Page 14: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

MySQLMaster

MySQLSlave

MySQLSlave

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

TungstenConnector

XApplication

214

Page 15: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

For Multi-Site, Multi-Master We spread that functionality across multiple datacenters

Page 16: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Tungsten Multi-Site/Multi-Master topologies operate independent, active clusters on 2 or more remote sites

33

Page 17: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

Tungsten Disaster Recovery creates composite clusters that span sites and are ready for immediate failover

32

Page 18: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

Page 19: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

Page 20: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

Page 21: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

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

Page 22: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

•  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

Page 23: MySQL Multi-Site/Multi-Master Done Rightcontinuent-videos.s3.amazonaws.com/Continuent-Webinar-MSMM-20170608.pdf · MySQL Master MySQL Slave MySQL Slave Reads & Writes Reads & Writes

For more information, contact us: Eric Stone COO [email protected] MC Brown VP Products [email protected]

Eero Teerikorpi Founder, CEO [email protected] +1 (408) 431-3305