Optimale Hochverfügbarkeitsverfahren - Dezember 2015

26
© 2015, MariaDB. © 2015, MariaDB Corp. MariaDB Roadshow Berlin 2015 Optimale Hochverfügbarkeitsverfahren Ralf Gebhardt, Principal Sales Engineer

Transcript of Optimale Hochverfügbarkeitsverfahren - Dezember 2015

Page 1: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB. © 2015, MariaDB Corp.

MariaDB Roadshow Berlin 2015

Optimale Hochverfügbarkeitsverfahren

Ralf Gebhardt, Principal Sales Engineer

Page 2: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

Agenda

●  Introduction ●  Replication ○  Asynchronous Replication

○  Multi-Source Replication

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

2

Page 3: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

Introduction into HA

“Highavailabilityisasystemdesignprotocolandassociatedimplementa6onthatensuresacertaindegreeofopera6onalcon6nuityduringa

givenmeasurementperiod”

3

Page 4: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

Uptime, Downtime, 9s

4

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

Availability=upCme/(upCme+downCme)

Availability=MTBF/(MTBF+MTTR)

Page 5: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 6: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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)

Page 7: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

7

Page 8: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

8

DC1 DC2

Page 9: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

HA with Replication

●  A typical 4 server setup

Active Passive

9

DC1

DC2

Page 10: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 11: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

HA with MariaDB 10 Replication

●  Typical 3 server setup

Active Passive

11

Page 12: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 13: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 14: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB Corp.

MariaDB Availability: MariaDB Cluster

14

1.  Transaction is processed locally up to commit time

Page 15: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB Corp.

MariaDB Availability: MariaDB Cluster

15

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

Page 16: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 17: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 18: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 19: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

MaxScale for HA

19

Page 20: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 21: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 22: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 23: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 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

Page 24: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

MariaDB HA: Connector/J Resources

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

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

24

Page 25: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB.

MariaDB HA: Solving the Puzzle

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

○  RDBA https://goo.gl/EJxGcf

■ Credits

■ Subscription

25

Page 26: Optimale Hochverfügbarkeitsverfahren - Dezember 2015

© 2015, MariaDB. © 2015, MariaDB Corp.

Vielen Dank!

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."