26
© 2015, MariaDB. © 2015, MariaDB Corp. MariaDB Roadshow Bern 2015 Optimale Hochverfügbarkeitsverfahren Ralf Gebhardt

Optimale Hochverfügbarkeitsverfahren

  • Upload
    mariadb

  • View
    209

  • Download
    0

Embed Size (px)

Citation preview

© 2015, MariaDB. © 2015, MariaDB Corp.

MariaDB Roadshow Bern 2015

Optimale Hochverfügbarkeitsverfahren

Ralf Gebhardt

© 2015, MariaDB.

Agenda

●  Introduction ●  Replication ○  Asynchronous Replication

○  Multi-Source Replication

●  Galera Cluster ●  MaxScale ●  Connectors ●  Other Ways of HA

2

© 2015, MariaDB.

Introduction into HA

“High  availability  is  a  system  design  protocol  and  associated  implementa6on  that  ensures  a  certain  degree  of  opera6onal  con6nuity  during  a  

given  measurement  period”  

3

© 2015, MariaDB.

Uptime, Downtime, 9s

4

     90%        1  nine        36.5  days  /  year        99%        2  nines      3.65  days  /  year        99.9%        3  nines      8.76  hours  /  year          99.99%      4  nines      52  minutes  /  year      99.999%      5  nines      5  minutes  /  year        99.9999%      6  nines      31  seconds  /  year  

Availability  =  upCme  /  (upCme  +  downCme)  

Availability  =  MTBF  /  (MTBF  +  MTTR)  

© 2015, MariaDB.

Terminology

●  Synchronous vs. Asynchronous ●  Shared Disk vs. Shared Nothing vs. Shared Memory ●  Single Point of Failure – SPOF ●  Failover vs. Switchover ●  Split-Brain ●  STONITH, Quorum

5

© 2015, MariaDB.

MariaDB Replication ●  Asynchronous: 3 Phases

○  Commit and write to binlog on Master

○  Ship changes to relay log on slave

○  Apply changes on slave

●  Master -> slave relationship

●  MariaDB 10.0 - Parallel-threaded on Slave

●  No conflict resolution ○  Master-master replication or

circular replication need application logic

6

Master

Slave(s)

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

7

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

8

DC1 DC2

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

9

DC1

DC2

© 2015, MariaDB.

MariaDB 10.0 Replication Features ●  Multi-Source Replication

●  Global Transaction ID (GTID)

○  Different implementation in MySQL!

○  With MariaDBDomain ID - Server ID - Transaction seq #

●  Parallel replication using the MariaDB group commit feature

10

© 2015, MariaDB.

HA with MariaDB 10 Replication

●  Typical 3 server setup

Active Passive

11

© 2015, MariaDB Corp.

●  Clustered MariaDB nodescooperate to remain in sync.

●  Synchronous replication withoptimistic locking delivers highavailability with little overhead.

●  Fast failover because all nodes remains synchronized.

●  Fully integrated binaries(NEW in 10.1)

MariaDB Galera Cluster

Load Balancingand Failover

Application / App Server

12

© 2015, MariaDB Corp.

MariaDB Galera Cluster

13

●  Provides “virtually” synchronous replication ●  Works with InnoDB ●  No slave lag ●  Certification and quorum ●  Transactions may be rolled back

if conflicts exit ●  Multi-master or master-slave

possible

© 2015, MariaDB Corp.

MariaDB Availability: MariaDB Cluster

14

1.  Transaction is processed locally up to commit time

© 2015, MariaDB Corp.

MariaDB Availability: MariaDB Cluster

15

1.  Transaction is processed locally up to commit time 2.  Transaction is replicated to whole cluster

© 2015, MariaDB Corp.

MariaDB Availability: MariaDB Cluster

16

1.  Transaction is processed locally up to commit time 2.  Transaction is replicated to whole cluster 3.  Client gets OK status

© 2015, MariaDB Corp.

Galera Replication

wsrep

MySQL

wsrep

MySQL

wsrep

MySQL

Client

trx trx

MariaDB Availability: MariaDB Cluster

17

1.  Transaction is processed locally up to commit time 2.  Transaction is replicated to whole cluster 3.  Client gets OK status 4.  Transaction is processed

© 2015, MariaDB.

Mon

itor

Filter & Logging

Routing

MaxScaleCore

Routing

MaxScale for HA

●  Open source configurable database proxy platform.

●  Plugin Architecture

●  HA Features

○  Read / Write splitter

○  Binlog server

○  Launchable scripts (NEW in 1.2)

18

© 2015, MariaDB.

MaxScale for HA

19

© 2015, MariaDB.

HA in Connector/J

●  Java Connector for MySQL / MariaDB

●  Support for failover in the connector (NEW in 1.2)

●  New host parameters

○  replication: Simple master-slave setups

○  failover: MariaDB master-master / cluster setup

●  Pros:

○  Built into the application

○  LGPL license

●  Cons: Too simple for complex failover scenarios

20

© 2015, MariaDB.

Other HA Solutions ●  Shared Disk

○  Active/Passive ○  Crash recovery needed ○  Is a SAN a SPOF?

●  DRBD ○  Synchronous block-based replication ○  Active/Passive ○  Crash recovery needed

●  Virtual Server based solutions

●  Script-based Solutions for Replication

○  MHA, Replication Manager, …

21

© 2015, MariaDB.

MariaDB HA: Resources

●  GTID documentationhttp://bit.ly/1yBbNUM

●  Multisource replication documentationhttp://bit.ly/1u3Je1L

●  Blogs ○  GTID: http://bit.ly/1qEMDAr

○  Multi source: http://bit.ly/1rLtIaK

●  HA Webinar https://goo.gl/Qnvy7b

22

© 2015, MariaDB.

MariaDB HA: MaxScale Resources

●  Binary Log server ○  MariaDB blog: http://goo.gl/1QjjlJ

○  Booking.com blog: http://goo.gl/yQ7524

●  MaxScale blog roll ○  https://goo.gl/JJeKOB

23

© 2015, MariaDB.

MariaDB HA: Connector/J Resources

●  Knowledge Base ○  About Connector/J: https://goo.gl/z8VI0S

○  Download: https://goo.gl/d4lrOU

24

© 2015, MariaDB.

MariaDB HA: Solving the Puzzle

●  MariaDB Services ○  HA Consulting https://goo.gl/g5XGUS

○  RDBA https://goo.gl/EJxGcf

■ Credits

■ Subscription

25

© 2015, MariaDB. © 2015, MariaDB Corp.

Thank You

mariadb.com

[email protected]

"MySQL is a registered trademark of Oracle and/or its affiliates. Other names may be trademarks of their respective owners. MariaDB is not affiliated with MySQL."