MySQL HA An overview Kris Buytaert. ● Senior Linux and Open Source ● „Infrastructure Architect“ ● I don't remember when I started.

Slides:



Advertisements
Similar presentations
ITIS 3110 Jason Watson. Replication methods o Primary/Backup o Master/Slave o Multi-master Load-balancing methods o DNS Round-Robin o Reverse Proxy.
Advertisements

High Availability 24 hours a day, 7 days a week, 365 days a year… Vik Nagjee Product Manager, Core Technologies InterSystems Corporation.
High Availability through Virtualization
1 © Copyright 2010 EMC Corporation. All rights reserved. EMC RecoverPoint/Cluster Enabler for Microsoft Failover Cluster.
1© Copyright 2011 EMC Corporation. All rights reserved. EMC RECOVERPOINT/ CLUSTER ENABLER FOR MICROSOFT FAILOVER CLUSTER.
National Manager Database Services
Microsoft Load Balancing and Clustering. Outline Introduction Load balancing Clustering.
22-Aug-15 | 1 |1 | Help! I need more servers! What do I do? Scaling a PHP application.
Distributed Data Stores – Facebook Presented by Ben Gooding University of Arkansas – April 21, 2015.
Windows Azure SQL Database and Storage Name Title Organization.
1 The Google File System Reporter: You-Wei Zhang.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Copyright © 2013 NetEase 马进 app DDB introduce.
Module 13: Network Load Balancing Fundamentals. Server Availability and Scalability Overview Windows Network Load Balancing Configuring Windows Network.
HBase A column-centered database 1. Overview An Apache project Influenced by Google’s BigTable Built on Hadoop ▫A distributed file system ▫Supports Map-Reduce.
Windows Azure Conference 2014 Deploy your Java workloads on Windows Azure.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Copyright 2006 MySQL AB The World’s Most Popular Open Source Database MySQL Cluster: An introduction Geert Vanderkelen MySQL AB.
High-Availability MySQL DB based on DRBD-Heartbeat Ming Yue September 27, 2007 September 27, 2007.
FailSafe SGI’s High Availability Solution Mayank Vasa MTS, Linux FailSafe Gatekeeper
MapReduce and GFS. Introduction r To understand Google’s file system let us look at the sort of processing that needs to be done r We will look at MapReduce.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation Partitioning and Replication.
GFS. Google r Servers are a mix of commodity machines and machines specifically designed for Google m Not necessarily the fastest m Purchases are based.
11 CLUSTERING AND AVAILABILITY Chapter 11. Chapter 11: CLUSTERING AND AVAILABILITY2 OVERVIEW  Describe the clustering capabilities of Microsoft Windows.
Mark E. Fuller Senior Principal Instructor Oracle University Oracle Corporation.
And scales by cloning the app on multiple servers/VMs/Containers Traditional architecture approach Microservices architecture approach A microservice.
Andrew Lahiff HEP SYSMAN June 2016 Hiding infrastructure problems from users: load balancers at the RAL Tier-1 1.
Building (Virtual) Appliances
OpenQRM is not Dead the lightning version Building a cloud in 5 mnutes by Kris Buytaert.
MySQL High Availability. Why High Availability Matters – Downtime is expensive – You miss $$$ – Your boss complains – New Users don't return.
Devops Kris Buytaert. ● I used to be a Dev, ● Then Became an Op ● Senior Linux and Open Source ● „Infrastructure Architect“ ● Building.
High Availability Clusters in Linux Sulamita Garcia EDS Unix Specialist
USEIMPROVEEVANGELIZE Solutions for High Availability and Disaster Recovery with MySQL ● Detlef Ulherr ● Sun Microsystems.
1 Gaurav Kohli Xebia Breaking with DBMS and Dating with Relational Hbase.
rain technology (redundant array of independent nodes)
Business System Development
Scaling Network Load Balancing Clusters
REPLICATION & LOAD BALANCING
Apache Ignite Data Grid Research Corey Pentasuglia.
Failover and High Availability
High Availability 24 hours a day, 7 days a week, 365 days a year…
Slicer: Auto-Sharding for Datacenter Applications
High Availability Linux (HA Linux)
Architecting Availability Groups
Disaster Recovery Where to Begin
ETHANE: TAKING CONTROL OF THE ENTERPRISE
Large-scale file systems and Map-Reduce
Learning MongoDB ZhangGang
Maximum Availability Architecture Enterprise Technology Centre.
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
VIDIZMO Deployment Options
Choosing a MySQL Replication & High Availability Solution
CHAPTER 3 Architectures for Distributed Systems
Introduction to Networks
Kubernetes Container Orchestration
Replication Middleware for Cloud Based Storage Service
View Change Protocols and Reconfiguration
Architecting Availability Groups
Scaling and Performance
Arrested by the CAP Handling Data in Distributed Systems
SpiraTest/Plan/Team Deployment Considerations
INFO 344 Web Tools And Development
Distributed File Systems
Fault-tolerance techniques RSM, Paxos
IST346: Scalability.
Content Delivery and Remote DNS services
Amazon AWS Certified Solutions Architect Professional solutions-architect-professional-practice-test.html.
Setting up PostgreSQL for Production in AWS
ClusterLion Automatic switchover for SAP HANA Robert Graf CEO
Presentation transcript:

MySQL HA An overview Kris Buytaert

● Senior Linux and Open Source ● „Infrastructure Architect“ ● I don't remember when I started using MySQL :) ● Specializing in Automated, Large Scale Deployments, Highly Available infrastructures, since 2008 also known as “the Cloud” ● Surviving the 10 th floor test ● DevOp

What is HA Clustering ? ● One service goes down => others take over its work ● IP address takeover, service takeover, ● Not designed for high-performance ● Not designed for high troughput (load balancing)

Does it Matter ? ● Downtime is expensive ● You mis out on $$$ ● Your boss complains ● New users don't return

Lies, Damn Lies, and Statistics Counting nines (slide by Alan R)

The Rules of HA ● Keep it Simple ● Prepare for Failure ● Complexity is the enemy of reliability

You care about ? ● Your data ? Consistent Consistent Realitime Realitime Eventual Consistent Eventual Consistent ● Your Connection Always Always Most of the time Most of the time

Eliminating the SPOF ● Find out what Will Fail Disks Disks Fans Fans Power (Supplies) Power (Supplies) ● Find out what Can Fail Network Network Going Out Of Memory Going Out Of Memory

Split Brain ● Communications failures can lead to separated partitions of the cluster ● If those partitions each try and take control of the cluster, then it's called a split-brain condition ● If this happens, then bad things will happen

Historical MySQL HA ● Replication 1 read write node 1 read write node Multiple read only nodes Multiple read only nodes Application needed to be modified Application needed to be modified

Solutions ● BYO ● DRBD ● MySQL Cluster NDBD ● Multi Master Replication ● MySQL Proxy ● MMM ● Flipper

Data vs Connection ● DATA : Replication Replication DRBD DRBD ● Connection LVS LVS Proxy Proxy Heartbeat / Pacemaker Heartbeat / Pacemaker

Shared Storage ● 1 MySQL instance ● Monitor MySQL node ● Stonith ● $$$ 1+1 <> 2 ● Storage = SPOF ● Split Brain :(

DRBD ● Distributed Replicated Block Device ● In the Linux Kernel (as of very recent) ● Usually only 1 mount Multi mount as of 8.X Multi mount as of 8.X Requires GFS / OCFS2 Requires GFS / OCFS2 ● Regular FS ext3... ● Only 1 MySQL instance Active accessing data ● Upon Failover MySQL needs to be started on other node

DRBD(2) ● What happens when you pull the plug of a Physical machine ? Minimal Timeout Minimal Timeout Why did the crash happen ? Why did the crash happen ? Is my data still correct ? Is my data still correct ? Innodb Consistency Checks ? Innodb Consistency Checks ? Lengthy ? Lengthy ? Check your BinLog size Check your BinLog size

MySQL Cluster NDBD ● Shared-nothing architecture ● Automatic partitioning ● Synchronous replication ● Fast automatic fail-over of data nodes ● In-memory indexes ● Not suitable for all query patterns (multi-table JOINs, range scans)

Title – Data

MySQL Cluster NDBD ● All indexed data needs to be in memory ● Good and bad experiences Better experiences when using the API Better experiences when using the API Bad when using the MySQL Server Bad when using the MySQL Server ● Test before you deploy ● Does not fit for all apps

Multi Master Replication ● Replicating the same table data both ways can lead to race conditions Auto_increment, unique keys, etc.. could cause problems If you write them 2x Auto_increment, unique keys, etc.. could cause problems If you write them 2x ● Both nodes are master ● Both nodes are slave ● Write in 1 get updates on the other M|S

MySQL Proxy ● Man in the middle ● Decides where to connect to LUA LUA ● Write rules to Redirect traffic Redirect traffic

Master Slave & Proxy ● Split Read and Write Actions ● No Application change required ● Sends specific queries to a specific node ● Based on Customer Customer User User Table Table Availability Availability

MySQL Proxy ● Your new SPOF ● Make your Proxy HA too ! Heartbeat OCF Resource Heartbeat OCF Resource

Breaking Replication ● If the master and slave gets out of sync ● Updates on slave with identical index id Check error log for disconnections and issues with replication Check error log for disconnections and issues with replication

Monitor your Setup ● Not just connectivity ● Also functional Query data Query data Check resultset is correct Check resultset is correct ● Check replication MaatKit MaatKit OpenARK OpenARK

Pulling Traffic ● Eg. for Cluster, MultiMaster setups DNS DNS Advanced Routing Advanced Routing LVS LVS Or the upcoming slides Or the upcoming slides

MMM ● Multi-Master Replication Manager for MySQL Perl scripts to perform monitoring/failover and management of MySQL master- master replication configurations Perl scripts to perform monitoring/failover and management of MySQL master- master replication configurations ● Balance master / slave configs based on replication state Map Virtual IP to the Best Node Map Virtual IP to the Best Node ●

Flipper ● Flipper is a Perl tool for managing read and write access pairs of MySQL servers ● master-master MySQL Servers ● Clients machines do not connect "directly" to either node instead, ● One IP for read, ● One IP for write. ● Flipper allows you to move these IP addresses between the nodes in a safe and controlled manner. ● per/

Linux-HA PaceMaker ● Plays well with others ● Manages more than MySQL ●...v3.. don't even think about the rest anymore ●

Conclusion ● Plenty of Alternatives ● Think about your Data ● Think about getting Queries to that Data ● Complexity is the enemy of reliability ● Keep it Simple ● Monitor inside the DB

Kris Buytaert Further Reading ?!