Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

20
Hochverfügbarkeit mit MariaDB Enterprise MariaDB Roadshow 2014 Hamburg - Berlin - Frankfurt Ralf Gebhardt, Sales Engineer [email protected]

description

Hochverfügbarkeit mit MariaDB Enterprise Presented by Ralf Gebhardt at the MariaDB Roadshow Germany: 4.7.2014 in Hamburg, 8.7.2014 in Berlin and 11.7.2014 in Frankfurt.

Transcript of Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

Page 1: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

Hochverfügbarkeit mit MariaDB Enterprise

MariaDB Roadshow 2014Hamburg - Berlin - Frankfurt

Ralf Gebhardt, Sales [email protected]

Page 2: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Agenda

• Introduction to High Availability• Different services that need HA• Different components of High Availability• Different MariaDB HA Solutions

•HA using MariaDB Replication•HA using MariaDB Galera Cluster

Page 3: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Introduction to High Availability

High availability is a system design protocol and associated implementation that ensures a certain degree of operational

continuity during a given measurement period

Page 4: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Introduction to High Availability

• High Availability isn’t always the same as Long Uptime

•A system that is “up” might still not be accessible

•A system that is “down” just once, but for a long time, isn’t highly available

• High Availability rather means•Long Mean Time Between Failures (MTBF)•Short Mean Time To Recover (MTTR)

Page 5: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Introduction to High Availability

• The level of availability is measured as the ratio of time the system is available over a year, expressed as a percentage

•99.9% availability means that the system is available at least 8.751 of 8.760 hours in a year, or that it is unavailable at the most 9 hours per year

•99.999% availability means that the system is available at least 525.595 or 525.600 minutes in a year, or that it is unavailable at the most 5 minutes per year

Page 6: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Maintaining High Availability

• There are two common situations that we try to protect ourselves from using an HA solution

•Datacenter failure – A whole datacenter becomes unavailable for some reason, like power failure, network failure, a virus or similar situations

•Server failure – An individualserver fails because of ahardware failure or somethingsimilar

Page 7: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Services in an HA Solution

• All services that make up the application stack needs HA for the system to achieve HA

•Web servers•Application servers•Applications•Database servers•Storage•Network

TCO for Unbreakable

Hardware

Page 8: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Services in an HA Solution

• Of the different types of services, there are two types

•Stateless servicesThese servers has no state beyond the current operation. If such a server fails, another server of the same type can replace it without having to transfer any set of data. Webservers and application servers are typical stateless services

•Stateful servicesThese services maintains a state, and that state needs to be preserved if a server fails, and has to be made available to any other server that takes it place. A database service such as a MariaDB server is a typical stateful service

Page 9: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Components of High Availability

• Monitoring and Management•Availability of the services needs to be monitored, to

be able to take action when there is a failure.A failover can be manual or automatic, but it has to be managed

• Failover / Load Balancing mechanism•Some mechanism to redirect traffic from the failed

server or Datacenter and to a working one

• Data redundancy•For stateful services, we need to make sure that data

is somehow made redundant

Page 10: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Monitoring and Management

• There are many different solutions here, some focused on specific services (in particular database), some as part of a Load Balancing software solution of an Appliance or a pure software based solution such as LinuxHA, HAProxy, MaxScale, MHA

Page 11: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Failover mechanism

• There is a wide range of options here too, in particular when it comes to Datacenter failover, which can be more complicated

• Common mechanisms range from application based failover and DNS failover to Load Balancing and Network Failover

Page 12: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Data Redundancy

• Providing Data Redundancy is complex, error prone and takes a toll on performance

• It also has to be mentioned that a SAN does not provide redundancy just because a disk set can be failed over from one server to another. A SAN might be a SPOF, but in some cases that is a risk that some customers is willing to take

Page 13: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Data Redundancy with MariaDB

• MariaDB Internal Replication•Asynchronous•Semi-Synchronous

• Storage based redundancy (Active/Passive)•DRBD (Distributed Replicated Block Device)•SAN (Storage Area Network)•VMWare replication

• MariaDB Galera Cluster

Page 14: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

HA using MariaDB Replication

• This is in many cases a good enough solution, but it has some issues

•The cluster is very loosely coupled, not all nodes are aware of all the other nodes for example

•Replication is asynchronous, so failing over is more difficult than usually (but MHA solves this)

•Adding a slave is difficult

• But there are also many advantages•Low performance penalty•Well known and easy to use technology

Page 15: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

HA using MariaDB Galera Cluster

• This a software-only solutionwith many advantages

•Scales writes and well as reads•“Proper” Cluster with built-in failover, locking and

split-brain protection•Synchronous replication with low overhead due to

optimistic locking

• There are some disadvantages•More overhead than using Asynchronous Replication•Only works with InnoDB•For distributed writes, some restrictions apply

Page 16: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

MariaDB Galera Cluster setup

MariaDB Server MariaDB Server MariaDB Server

Galera wsrep Library Galera wsrep Library Galera wsrep Library

Synchronous Replication

Load Balancer / Failover

Application / Application server

Page 17: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

Setting up MariaDB Galera Cluster

• MariaDB Galera Cluster consists of the MariaDB binary that in turns talks to the Galera wsrep library

• Once set up, Galera is configured using the usual my.cnf file, and is monitored using the SHOW GLOBAL STATUS command

Page 18: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

MariaDB Galera Cluster failover

• MariaDB Galera Cluster handles failed servers internally

• MariaDB Galera Cluster also handles split-brain protection and this requires at least 3 servers

• MariaDB Galera Cluster can also be configured without split-brain protection, for example when failover is manual or is handled in some other way

Page 19: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

© SkySQL – The MariaDB Company

MariaDB Galera Cluster setup

• If necessary to allow for protection against split-brain scenarios, but only using 2 database servers, a third server can be set up with a Galera specific arbitration agent

• Galera also can be used with it’s own simple Load Balancer, although it is much more common that other technologies are used, such as HA aware Connectors or a Load Balancer

Page 20: Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

Fragen?

www.mariadb.comwww.facebook.com/mariadb.dbms

www.twitter.com/mariadb

Vielen Dank!

Hochverfügbarkeit mit MariaDB Enterprise

© Copyright 2014 SkySQL Corporation Ab.SkySQL and MariaDB are trademarks or registered trademarks of SkySQL Corporation Ab in the European Union and United States of America and/or other

countries. MySQL is a trademark of Oracle Corporation Inc. Other names may be trademarks of their respective owners.