Más contenido relacionado La actualidad más candente (20) Similar a Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt (20) Más de MariaDB Corporation (20) Hochverfügbarkeit mit MariaDB Enterprise - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt2. © 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
3. © 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
4. © 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)
5. © 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
6. © 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 individual
server fails because of a
hardware failure or something
similar
7. © 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
8. © SkySQL – The MariaDB Company
Services in an HA Solution
• Of the different types of services, there are
two types
• Stateless services
These 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 services
These 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
9. © 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
10. © 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
11. © 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
12. © 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
13. © 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
14. © 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
15. © SkySQL – The MariaDB Company
HA using MariaDB Galera Cluster
• This a software-only solution
with 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
16. © 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
17. © 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
18. © 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
19. © 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