MySQL High Availability. Why High Availability Matters – Downtime is expensive – You miss $$$ – Your boss complains – New Users don't return.

Slides:



Advertisements
Similar presentations
From Startup to Enterprise A Story of MySQL Evolution Vidur Apparao, CTO Stephen OSullivan, Manager of Data and Grid Technologies April 2009.
Advertisements

Mecanismos de alta disponibilidad con Microsoft SQL Server 2008 Por: ISC Lenin López Fernández de Lara.
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.
Database Optimization & Maintenance Tim Richard ECM Training Conference#dbwestECM Agenda SQL Configuration OnBase DB Planning Backups Integrity.
CS526 Dr.Chow1 HIGH AVAILABILITY LINUX VIRTUAL SERVER By P. Jaya Sunderam and Ankur Deshmukh.
Presentation by Krishna
Backup and Recovery Part 1.
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.
1 The Google File System Reporter: You-Wei Zhang.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Sofia, Bulgaria | 9-10 October SQL Server 2005 High Availability for developers Vladimir Tchalkov Crossroad Ltd. Vladimir Tchalkov Crossroad Ltd.
Chapter 8 Implementing Disaster Recovery and High Availability Hands-On Virtual Computing.
Clustering SQL Server Tom Pullen Senior DBA, RM Education
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.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
MySQL. Dept. of Computing Science, University of Aberdeen2 In this lecture you will learn The main subsystems in MySQL architecture The different storage.
Presented by, MySQL AB® & O’Reilly Media, Inc. 0 to 60 in 3.1 Tyler Carlton Cory Sessions.
1 Moshe Shadmon ScaleDB Scaling MySQL in the Cloud.
Module 9 Planning a Disaster Recovery Solution. Module Overview Planning for Disaster Mitigation Planning Exchange Server Backup Planning Exchange Server.
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.
mysql-proxy By Farhad Saberi - Overview and architecture - Making The case for a proxy - Lua - Lua examples - The admin interface - currently.
G063 - Distributed Databases. Learning Objectives: By the end of this topic you should be able to: explain how databases may be stored in more than one.
1 Week #10Business Continuity Backing Up Data Configuring Shadow Copies Providing Server and Service Availability.
INFORMATION MANAGEMENT Unit 2 SO 4 Explain the advantages of using a database approach compared to using traditional file processing; Advantages including.
VICTORIA UNIVERSITY OF WELLINGTON Te Whare Wananga o te Upoko o te Ika a Maui SWEN 432 Advanced Database Design and Implementation MongoDB Architecture.
Fast Crash Recovery in RAMCloud. Motivation The role of DRAM has been increasing – Facebook used 150TB of DRAM For 200TB of disk storage However, there.
ESRI User Conference 2004 ArcSDE. Some Nuggets Setup Performance Distribution Geodatabase History.
High Availability in DB2 Nishant Sinha
Virtual Machine Movement and Hyper-V Replica
Replicazione e QoS nella gestione di database grid-oriented Barbara Martelli INFN - CNAF.
Introduction to Core Database Concepts Getting started with Databases and Structure Query Language (SQL)
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
High-Availability MySQL with DR:BD and Heartbeat: MTV Japan mobile services ©2008 MTV Networks Japan K.K.
Cofax Scalability Document Version Scaling Cofax in General The scalability of Cofax is directly related to the system software, hardware and network.
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
MySQL High Availability & Drupal. Who is Kris Buytaert – Not related to Dries (afaik) – Linux and Open Source Consultant – Infrastructure Architect –
MySQL HA An overview Kris Buytaert. ● Senior Linux and Open Source ● „Infrastructure Architect“ ● I don't remember when I started.
High Availability Clusters in Linux Sulamita Garcia EDS Unix Specialist
USEIMPROVEEVANGELIZE Solutions for High Availability and Disaster Recovery with MySQL ● Detlef Ulherr ● Sun Microsystems.
MySQL Cluster overview and ndb-7.0 features demo
Calgary Oracle User Group
Jean-Philippe Baud, IT-GD, CERN November 2007
REPLICATION & LOAD BALANCING
You Inherited a Database Now What?
Failover and High Availability
High Availability 24 hours a day, 7 days a week, 365 days a year…
Hadoop.
High Availability Linux (HA Linux)
Integrating HA Legacy Products into OpenSAF based system
MySQL: The Elephant in the Room Rob Wultsch
AlwaysOn Mirroring, Clustering
Physical Changes That Don’t Change the Logical Design
R-GMA as an example of a generic framework for information exchange
Physical Database Design and Performance
CSE-291 (Cloud Computing) Fall 2016
A Technical Overview of Microsoft® SQL Server™ 2005 High Availability Beta 2 Matthew Stephen IT Pro Evangelist (SQL Server)
Choosing a MySQL Replication & High Availability Solution
Alejandro Álvarez on behalf of the FTS team
Test Upgrade Name Title Company 9/18/2018 Microsoft SharePoint
View Change Protocols and Reconfiguration
Scaling and Performance
What’s new in SQL Server 2016 Availability Groups
Physical Database Design
You Inherited a Database Now What?
High Availability/Disaster Recovery Solution
Distributed Availability Groups
Overview Multimedia: The Role of WINS in the Network Infrastructure
Presentation transcript:

MySQL High Availability

Why High Availability Matters – Downtime is expensive – You miss $$$ – Your boss complains – New Users don't return

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)

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 –

Eliminating the SPOF – Find out what will fail – Disks – Find out what can fail – Network Cables – Going out of Memory

The rules of High Availability – Prepare for failure – Keep It Simple – Complexity is the enemy of reliability (Alan R)

Data HA vs Connectivy Ha – MySQL = DATA – Connection » Linux Heartbeat » Client (multi DS)

Historical MySQL “Clustering” – Replication – LVS – 1 read write node – Multiple read only nodes – Application needed to be modified

More Recent Alternatvies – Cluster – Multimaster Replication (autoidx) – MySQL Proxy – DRBD

Other Alternatives – MySQL HA Scripting stuff – How to Fail back ? – Are we sure about the replicated data ? » Mysql-ha.sf.net – PeerFS – Proprietary – Support for myisam cluster – No support for innodb – Emic (now Continuent) – HA, Scalablilty, Manageability

MySqL Cluster – Original Ericsson Code – Bought by MySQL - Is an Engine such as MyISAM, InnoDB

MySQL Cluster – Shared Nothing Clustering – Automatic Partitioning – Synchronous Replication – Main Memory Engine only ! All data lives in memory ! Disk Based is in progress – As of MySQL 4.1

Shared Nothing No SPOF Any single server can fail often multiple failures also survive No extra hardware (expensive) required No dependency on other nodes

Data Partitioning – Data is horizontally partitioned over the nodes - Each node is in charge of only a piece of the data - Data can be read in parallel - E.g 4 data nodes could have 4 data fragments with each ¼ of the data. 4Gb database requires 1Gb on 4 nodes each.

Replication – Data is replicated to NrOfReplicas Nodes – Typically 2 or more – Highly Available – Guaranteed at Commit time to be present in multiple nodes - Automatic node takeover. If you only have 2 nodes and you need to store 2 Gb of data you need 2Gb of memory per node!

Main Memory System – Everything (data + indexes) are in Memory ! – High Perfomance – Asynchronous disk writes – Available memory restricts database size

Title – Data

Cluster Components – ndb_mgmd the management nodes – ndbd the cluster storage nodes – mysqld, the traditional MySqld talking to the cluster engine Can run on the same or different servers For true HA ndb_mgmd can’t be on one of the ndbd nodes.

Management Node – In charge of cluster config – Only Needs to be running when nodes start – Further Management roles Start Backups Monitor node status Logging Master / slave Arbitration

MySQL Node – Standard MySQL node compiled with ndbd – Can use other storage engines – One creates tables with ENGINE=NDBCluster – Can be enabled by default

NDB Data Nodes – The actual Data Stores – Handle Replication Partitioning Failover – Has to be a multiple of NrOfReplicas

Title – Data

Limitations Database Size = Required Memory Network troughput – ==> Dolphin HSI

Pulling Traffic to the Cluster ● DNS Loadbalancing ● Advertise routing (ripd/vrrpd/bgpd) ● LVS ● Linux HA

Mon + HeartBeat To which mysqld does your application talk ? Create 1 Virtual MySQL IP ● Have mon connect to the MySQL DB ● Test content select from cluster node. ● Really test content select ! ● If mysqld fails (according to mon) ● Failover using heartbeat. Only IP is taken over + routing

/

Mon ● ● General purpose scheduler and alert management tool ● Monitors service availability ● Triggers alerts upon failure detection ● /etc/mon/ ● /usr/lib/mon/mon.d/ ● /usr/lib/mon/alert.d/

2 Clusters ● MySQL Cluster ● Linux HA Cluster – Both can have different master nodes – MySQL Query traffic can be on DB-B – Where as the NDB Master node is on DB-A

Adding Disk Based Storage ● Certain tables do not Fit In Memory ● Feature as of ● Uses Tablespaces and Logfiles groups in files ● Only non indexed fields are on disk !

Configuring Table Spaces Create a LOGFILE GROUP and a TABLESPACE. CREATE LOGFILE GROUP lg1 ADD UNDOFILE 'undofile.dat' INITIAL_SIZE 16M UNDO_BUFFER_SIZE = 1M ENGINE = NDB; CREATE TABLESPACE ts1 ADD DATAFILE 'datafile.dat' USE LOGFILE GROUP lg1 INITIAL_SIZE 12M ENGINE NDB;

Creating A Table to using Disk based Storage CREATE TABLE t1 (a int, b int, c int, d int, e int, primary key(a), index(a,b)) TABLESPACE ts1 STORAGE DISK engine=ndb;

Verifying NDB tables(diskbased) ~]$ ndb_desc -d pmt terminalderivedmetric -- terminalderivedmetric -- Version: Fragment type: 5 K Value: 6 Min load factor: 78 Max load factor: 80 Temporary table: no Number of attributes: 5 Number of primary keys: 4 Length of frm data: 369 Row Checksum: 1 Row GCI: 1 TableStatus: Retrieved -- Attributes -- isp_id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY sit_id Int PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY derivedmetricclass_id Varchar(50;latin1_swedish_ci) PRIMARY KEY DISTRIBUTION KEY AT=SHORT_VAR ST=MEMORY timestamp Timestamp PRIMARY KEY DISTRIBUTION KEY AT=FIXED ST=MEMORY value Double NOT NULL AT=FIXED ST=DISK -- Indexes -- PRIMARY KEY(isp_id, sit_id, derivedmetricclass_id, timestamp) - UniqueHashIndex PRIMARY(isp_id, sit_id, derivedmetricclass_id, timestamp) - OrderedIndex DMID(derivedmetricclass_id, timestamp) - OrderedIndex IDS(isp_id, sit_id) - OrderedIndex NDBT_ProgramExit: 0 - OK

When to use MySQL Cluster ? Small Datasets No large datasets e.g Session Handling HA Speed

What with Large data ? Typically “logs” Use MySQL Cluster as frontend Select from into archived Delete from

What else with Large data ? Partition your data manually Use MySQL partitioning Use MultiMaster Replication Use proxy to partition

DRBD Replicates your data Recovery is still needed

MySQL Proxy Man in the middle Decides where to connect to LuA

MySQL Proxy Split Read and Write actions Send specific queries to a specific node per customer per user per table Loadbalance

Conclusions : MySQL only cares about your data You need to look after connections With ndbd: limit = your memory budget Multimaster is back Proxy deserves your attention

Kris Buytaert Further Reading Contact: