1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a...

129
1 / 129

Transcript of 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a...

Page 1: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

1 / 129

Page 2: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

2 / 129

Page 3: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL InnoDB Cluster

When MySQL High Availability is Made Easy

 

 

3 / 129

Page 4: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

 

Safe Harbor StatementThe following is intended to outline our general product direction. It is intended forinformation purpose only, and may not be incorporated into any contract. It is not acommitment to deliver any material, code, or functionality, and should not be relied up inmaking purchasing decisions. The development, release and timing of any features orfunctionality described for Oracle´s product remains at the sole discretion of Oracle.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

4 / 129

Page 5: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

about.me/lefred

Who am I ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

5 / 129

Page 6: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Frédéric Descamps@lefredMySQL EvangelistHacking MySQL since 3.23devops believerMySQL Community Manager since May2016 (🎂)living in Belgium

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

6 / 129

Page 7: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL InnoDB Cluster

Easy MySQL High Availability

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

7 / 129

Page 8: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

InnoDB

cluster

Ease-of-Use

Extreme Scale-Out

Out-of-Box Solution

Built-in HA

High P erformance

Everything Integr ated

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

8 / 129

Page 9: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Our vision in 4 steps

MySQL Document Store

Relational & Document Models

MySQL HA

Out-Of-Box HA

Read Scale-Out

Async Replication + A uto F ailover

Write Scale-Out

Sharding

E1

E3

E2 E4

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

9 / 129

Page 10: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Step 2´s Architecture

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

M

y

S

Q

L

S

h

e

l

l

I

n

n

o

D

B

c

l

u

s

t

e

r

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

M

p

M

M

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

10 / 129

Page 11: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Step 3´s ArchitectureA

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

M

y

S

Q

L

S

h

e

l

l

I

n

n

o

D

B

c

l

u

s

t

e

r

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

M

p

M

M

S1 S2 S3 S4 S...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

11 / 129

Page 12: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Step 4´s ArchitectureA

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

M

y

S

Q

L

S

h

e

l

l

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

I

n

n

o

D

B

c

l

u

s

t

e

r

M

p

M

M

S2 S3 S4 S...S1

I

n

n

o

D

B

c

l

u

s

t

e

r

M

p

M

M

S1 S2 S3 S4 S...

I

n

n

o

D

B

c

l

u

s

t

e

r

M

p

M

M

S1 S2 S3 S4 S...

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

A

p

p

l

i

c

a

t

i

o

n

M

y

S

Q

L

C

o

n

n

e

c

t

o

r

M

y

S

Q

L

R

o

u

t

e

r

replicaset 1

replicaset 2

replicaset 3

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

12 / 129

Page 13: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Group Replication: heart of MySQL InnoDBCluster

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

13 / 129

Page 14: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Group Replication: heart of MySQL InnoDBCluster

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

14 / 129

Page 15: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

But before going further...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

15 / 129

Page 16: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

What is

High Availability ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

16 / 129

Page 17: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

High AvailabilityHigh availability is a characteristic of a system, which aims to ensure an agreed level ofoperational performance, usually uptime, for a higher than normal period.

There are three principles of systems design in reliability engineering which can helpachieve high availability:

Elimination of single points of failure. This means adding redundancy to the systemso that failure of a component does not mean failure of the entire system.Reliable crossover. In redundant systems, the crossover point itself tends to becomea single point of failure. Reliable systems must provide for reliable crossover.Detection of failures as they occur. If the two principles above are observed, then auser may never see a failure. But the maintenance activity must.

Source: WikipediaCopyright @ 2017 Oracle and/or its affiliates. All rights reserved.

17 / 129

Page 18: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

18 / 129

Page 19: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Multiple solutions exist, some worse than the others ;-)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

19 / 129

Page 20: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Multiple solutions exist, some worse than the others ;-)

use of share storage

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

20 / 129

Page 21: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Multiple solutions exist, some worse than the others ;-)

use of share storageuse of share blocs by network (drbd)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

21 / 129

Page 22: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Multiple solutions exist, some worse than the others ;-)

use of share storageuse of share blocs by network (drbd)use of MySQL replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

22 / 129

Page 23: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Database Redundancy

How to achieve it ?

Multiple solutions exist, some worse than the others ;-)

use of share storageuse of share blocs by network (drbd)use of MySQL replication

Of course the last one is the technique most spread, more flexible and more reliable.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

23 / 129

Page 24: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL ReplicationThere are multiple types of MySQL replication:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

24 / 129

Page 25: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL ReplicationThere are multiple types of MySQL replication:

asynchronous replication (async)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

25 / 129

Page 26: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL ReplicationThere are multiple types of MySQL replication:

asynchronous replication (async)semi-synchronous replication (semi-sync)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

26 / 129

Page 27: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL ReplicationThere are multiple types of MySQL replication:

asynchronous replication (async)semi-synchronous replication (semi-sync)group replication - since (5.7.17) !!

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

27 / 129

Page 28: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

28 / 129

Page 29: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

29 / 129

Page 30: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)replicas provisioning is manual

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

30 / 129

Page 31: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)replicas provisioning is manualdata consistency on replicas is assumed and needs a manual verification

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

31 / 129

Page 32: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)replicas provisioning is manualdata consistency on replicas is assumed and needs a manual verificationcomplex topologies can be built

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

32 / 129

Page 33: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)replicas provisioning is manualdata consistency on replicas is assumed and needs a manual verificationcomplex topologies can be builtit´s even possible to create circular replication (not recommended)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

33 / 129

Page 34: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Asynchronous Replication(s)replicas (also called slaves) stream the replication logs from a unique master (multi-source replication is possible since 5.7.6)slaves can be laging (having delay), there is no delivery guarantee (unless for semi-sync)replicas provisioning is manualdata consistency on replicas is assumed and needs a manual verificationcomplex topologies can be builtit´s even possible to create circular replication (not recommended)write operations are safe only from a unique global master

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

34 / 129

Page 35: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL HA Architectures with asynchronousreplicationIt exists a lot of possible architectures and as much tools to enforce them.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

35 / 129

Page 36: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL HA Architectures with asynchronousreplicationIt exists a lot of possible architectures and as much tools to enforce them.

They are all based on the same principle:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

36 / 129

Page 37: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL HA Architectures with asynchronousreplicationIt exists a lot of possible architectures and as much tools to enforce them.

They are all based on the same principle:

1 master

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

37 / 129

Page 38: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL HA Architectures with asynchronousreplicationIt exists a lot of possible architectures and as much tools to enforce them.

They are all based on the same principle:

1 master1 or many replicas (slaves)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

38 / 129

Page 39: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL HA Architectures with asynchronousreplicationIt exists a lot of possible architectures and as much tools to enforce them.

They are all based on the same principle:

1 master1 or many replicas (slaves)

If the master as an issue, the most accurate slave needs to takeover the role and bepromoted as master for tall the remaining slaves still online.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

39 / 129

Page 40: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Automation

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

40 / 129

Page 41: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

41 / 129

Page 42: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

It exists a large amount of external tools that can be used to achieve this task. Most ofthem are only compatible with GNU/Linux.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

42 / 129

Page 43: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

It exists a large amount of external tools that can be used to achieve this task. Most ofthem are only compatible with GNU/Linux.

Their problem is that they create complexity in the architecture's design. You need to beDBA & sysadmin to manage those solutions:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

43 / 129

Page 44: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

It exists a large amount of external tools that can be used to achieve this task. Most ofthem are only compatible with GNU/Linux.

Their problem is that they create complexity in the architecture's design. You need to beDBA & sysadmin to manage those solutions:

MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

44 / 129

Page 45: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

It exists a large amount of external tools that can be used to achieve this task. Most ofthem are only compatible with GNU/Linux.

Their problem is that they create complexity in the architecture's design. You need to beDBA & sysadmin to manage those solutions:

MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)Pacemaker with MySQL dedicated OCF

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

45 / 129

Page 46: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

AutomationAnd this is the most complicated part...

It exists a large amount of external tools that can be used to achieve this task. Most ofthem are only compatible with GNU/Linux.

Their problem is that they create complexity in the architecture's design. You need to beDBA & sysadmin to manage those solutions:

MySQL-Utilities (mysqlrplcheck, mysqlrpladmin)Pacemaker with MySQL dedicated OCFcustom solutions...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

46 / 129

Page 47: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

47 / 129

Page 48: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQL

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

48 / 129

Page 49: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQLGR is an implementation of Replicated Database State Machine theory

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

49 / 129

Page 50: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQLGR is an implementation of Replicated Database State Machine theoryGR allows to write on all Group Members (cluster nodes) simultaneously whileretaining consistency

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

50 / 129

Page 51: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQLGR is an implementation of Replicated Database State Machine theoryGR allows to write on all Group Members (cluster nodes) simultaneously whileretaining consistencyGR implements conflict detection and resolution

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

51 / 129

Page 52: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQLGR is an implementation of Replicated Database State Machine theoryGR allows to write on all Group Members (cluster nodes) simultaneously whileretaining consistencyGR implements conflict detection and resolutionGR allows automatic distributed recovery

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

52 / 129

Page 53: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

but what is it ?!?

GR is a plugin for MySQL, made by MySQL and packaged with MySQLGR is an implementation of Replicated Database State Machine theoryGR allows to write on all Group Members (cluster nodes) simultaneously whileretaining consistencyGR implements conflict detection and resolutionGR allows automatic distributed recoverySupported on all MySQL platforms !!

Linux, Windows, Solaris, OSX, FreeBSD

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

53 / 129

Page 54: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocol

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

54 / 129

Page 55: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State Machine

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

55 / 129

Page 56: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State MachinePaxos based protocol

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

56 / 129

Page 57: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State MachinePaxos based protocolits task: deliver messages across the distributed system:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

57 / 129

Page 58: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State MachinePaxos based protocolits task: deliver messages across the distributed system:

atomically

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

58 / 129

Page 59: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State MachinePaxos based protocolits task: deliver messages across the distributed system:

atomicallyin Total Order

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

59 / 129

Page 60: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Communication System (GCS)MySQL Xcom protocolReplicated Database State MachinePaxos based protocolits task: deliver messages across the distributed system:

atomicallyin Total Order

MySQL Group Replication receives the Ordered 'tickets' from this GCS subsystem.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

60 / 129

Page 61: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

61 / 129

Page 62: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?no longer necessary to handle server fail-over manually or with a complicated script

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

62 / 129

Page 63: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?no longer necessary to handle server fail-over manually or with a complicated scriptGR provides fault tolerance

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

63 / 129

Page 64: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?no longer necessary to handle server fail-over manually or with a complicated scriptGR provides fault toleranceGR enables update-everywhere setups

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

64 / 129

Page 65: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?no longer necessary to handle server fail-over manually or with a complicated scriptGR provides fault toleranceGR enables update-everywhere setupsGR handles crashes, failures, re-connetcs automatically

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

65 / 129

Page 66: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

And for users ?no longer necessary to handle server fail-over manually or with a complicated scriptGR provides fault toleranceGR enables update-everywhere setupsGR handles crashes, failures, re-connetcs automaticallyAllows an easy setup of a MySQL service high available !

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

66 / 129

Page 67: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

OK, but how does it work ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

67 / 129

Page 68: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

OK, but how does it work ?

it's just magic !

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

68 / 129

Page 69: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

OK, but how does it work ?

it's just magic !

... no, in fact the writesets replication is synchronous and then certification and apply ofthe changes are local to each nodes and asynchronous.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

69 / 129

Page 70: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

OK, but how does it work ?

it's just magic !

... no, in fact the writesets replication is synchronous and then certification and apply ofthe changes are local to each nodes and asynchronous.

not that easy to understand... right ? As a picture is worth a 1000 words, let's illustratethis...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

70 / 129

Page 71: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

71 / 129

Page 72: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

72 / 129

Page 73: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

73 / 129

Page 74: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

74 / 129

Page 75: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

75 / 129

Page 76: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

76 / 129

Page 77: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

77 / 129

Page 78: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

78 / 129

Page 79: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

79 / 129

Page 80: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

80 / 129

Page 81: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

81 / 129

Page 82: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Group Replication

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

82 / 129

Page 83: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

83 / 129

Page 84: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

84 / 129

Page 85: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactions

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

85 / 129

Page 86: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

86 / 129

Page 87: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/node

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

87 / 129

Page 88: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every node

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

88 / 129

Page 89: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every noderesults are not reported to the group

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

89 / 129

Page 90: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every noderesults are not reported to the group

pass: enter in the apply queue

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

90 / 129

Page 91: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every noderesults are not reported to the group

pass: enter in the apply queuefail: drop the transaction

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

91 / 129

Page 92: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every noderesults are not reported to the group

pass: enter in the apply queuefail: drop the transaction

serialized by the total order in GCS/XCOM + GTID

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

92 / 129

Page 93: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

CertificationCertification is the process that only needs to answer the following unique question:

can the write (transaction) be applied ?based on unapplied earlier transactionssuch conflicts must come for other members/nodes

happens on every member/nodeshould be deterministic on every noderesults are not reported to the group

pass: enter in the apply queuefail: drop the transaction

serialized by the total order in GCS/XCOM + GTIDcost is based on trx size (# rows & # keys)

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

93 / 129

Page 94: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

GTIDGTIDs are the same as those used by asynchronous replication.

mysql> SELECT * FROM performance_schema.replication_connection_status\G ************************** 1. row *************************** CHANNEL_NAME: group_replication_applier GROUP_NAME: afb80f36-2bff-11e6-84e0-0800277dd3bf SOURCE_UUID: afb80f36-2bff-11e6-84e0-0800277dd3bf THREAD_ID: NULL SERVICE_STATE: ON COUNT_RECEIVED_HEARTBEATS: 0 LAST_HEARTBEAT_TIMESTAMP: 0000-00-00 00:00:00 RECEIVED_TRANSACTION_SET: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

94 / 129

Page 95: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

but transactions use the Group´s GTID

mysql> show master status\G ************************** 1. row *************************** File: mysql4-bin.000001 Position: 1501 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

95 / 129

Page 96: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables only

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

96 / 129

Page 97: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables onlyevery tables must have a PK defined

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

97 / 129

Page 98: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supported

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

98 / 129

Page 99: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supporteda good network with low latency is important

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

99 / 129

Page 100: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supporteda good network with low latency is importantmaximum of 9 members per group

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

100 / 129

Page 101: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirementsexclusively works with InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supporteda good network with low latency is importantmaximum of 9 members per grouplog-bin must be enabled and only ROW format is supported

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

101 / 129

Page 102: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirements (2)enable GTIDs

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

102 / 129

Page 103: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirements (2)enable GTIDsreplication meta-data must be stored in system tables

--master-info-repository=TABLE --relay-log-info-repository=TABLE

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

103 / 129

Page 104: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirements (2)enable GTIDsreplication meta-data must be stored in system tables

--master-info-repository=TABLE --relay-log-info-repository=TABLE

writesets extraction must be enabled

--transaction-write-set-extraction=XXHASH64

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

104 / 129

Page 105: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Requirements (2)enable GTIDsreplication meta-data must be stored in system tables

--master-info-repository=TABLE --relay-log-info-repository=TABLE

writesets extraction must be enabled

--transaction-write-set-extraction=XXHASH64

log-slave-updates must also be enabled

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

105 / 129

Page 106: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Limitationsbinlog checksum is not supported (but we have checksum in the replication channel)

--binlog-checksum=NONE

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

106 / 129

Page 107: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Limitationsbinlog checksum is not supported (but we have checksum in the replication channel)

--binlog-checksum=NONE

savepoints were not supported before 5.7.19 & 8.0.1

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

107 / 129

Page 108: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Limitationsbinlog checksum is not supported (but we have checksum in the replication channel)

--binlog-checksum=NONE

savepoints were not supported before 5.7.19 & 8.0.1SERIALIZABLE is not supported as transaction isolation level

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

108 / 129

Page 109: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Limitationsbinlog checksum is not supported (but we have checksum in the replication channel)

--binlog-checksum=NONE

savepoints were not supported before 5.7.19 & 8.0.1SERIALIZABLE is not supported as transaction isolation levelhttp://lefred.be/content/mysql-group-replication-limitations-savepoints/http://lefred.be/content/mysql-group-replication-and-table-design/

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

109 / 129

Page 110: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

110 / 129

Page 111: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Router (GA!)MySQL Router is lightweight middleware that provides transparent routing between yourapplication and backend MySQL Servers. It can be used for a wide variety of use cases,such as providing high availability and scalability by effectively routing database traffic toappropriate backend MySQL Servers.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

111 / 129

Page 112: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Router (GA!)MySQL Router is lightweight middleware that provides transparent routing between yourapplication and backend MySQL Servers. It can be used for a wide variety of use cases,such as providing high availability and scalability by effectively routing database traffic toappropriate backend MySQL Servers.

MySQL Router doesn´t require any specific configuration. It configures itself automatically(bootstrap) using MySQL InnoDB Cluster´s metadata.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

112 / 129

Page 113: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Router (GA!)MySQL Router is lightweight middleware that provides transparent routing between yourapplication and backend MySQL Servers. It can be used for a wide variety of use cases,such as providing high availability and scalability by effectively routing database traffic toappropriate backend MySQL Servers.

MySQL Router doesn´t require any specific configuration. It configures itself automatically(bootstrap) using MySQL InnoDB Cluster´s metadata.

The MySQL Router development will be focusing on sharding.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

113 / 129

Page 114: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

ProxySQL has native support for GroupReplication which makes it a good choice foradvanced users.

ProxySQLIf you need some specific features that are not yet available in MySQL Router, liketransparent R/W splitting, then you can use your software of choice.

We are also collaborating with ProxySQL.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

114 / 129

Page 115: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

115 / 129

Page 116: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (GA!)The MySQL Shell is an interactive Javascript, Python, or SQL interface supportingdevelopment and administration for the MySQL Server and is a component of the MySQLServer. You can use the MySQL Shell to perform data queries and updates as well asvarious administration operations.

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

116 / 129

Page 117: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

117 / 129

Page 118: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operations

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

118 / 129

Page 119: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operationsDocument and Relational Models

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

119 / 129

Page 120: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operationsDocument and Relational ModelsCRUD Document and Relational APIs via scripting

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

120 / 129

Page 121: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operationsDocument and Relational ModelsCRUD Document and Relational APIs via scriptingTraditional Table, JSON, Tab Separated output results formats

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

121 / 129

Page 122: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operationsDocument and Relational ModelsCRUD Document and Relational APIs via scriptingTraditional Table, JSON, Tab Separated output results formatsMySQL Standard and X Protocols

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

122 / 129

Page 123: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (2)The MySQL Shell provides:

Both Interactive and Batch operationsDocument and Relational ModelsCRUD Document and Relational APIs via scriptingTraditional Table, JSON, Tab Separated output results formatsMySQL Standard and X Protocolsand more...

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

123 / 129

Page 124: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

MySQL Shell (3)PREVIEW: the new Shell´s prompt is nice and clear !

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

124 / 129

Page 125: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Deploying a MySQL using MySQL Shell´sadminAPI:mysql-js> var i1 = 'root@instance01:3306';mysql-js> var i2 = 'root@instance02:3306';mysql-js> var i3 = 'root@instance02:3306';

mysql-js> dba.checkInstanceCon�guration(i1);mysql-js> dba.checkInstanceCon�guration(i2);mysql-js> dba.checkInstanceCon�guration(i3);

mysql-js> shell.connect(i1);mysql-js> var cluster = dba.createCluster('InnovationDay');

mysql-js> cluster.checkInstanceState(i2); mysql-js> cluster.addInstance(i2);

mysql-js> cluster.checkInstanceState(i3);mysql-js> cluster.addInstance(i3);

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

125 / 129

Page 126: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

instance01.yaml :

classes: - innodbcluster

innodbcluster::mysql_serverid: 1

Thanks to the MySQL Shell we can automate everything ;-)

https://github.com/lefred/puppet-lefred-innodbcluster

Super easy using hiera:

common.yaml:

innodbcluster::mysql_root_password: StRongP4ssw0rD!innodbcluster::mysql_bind_interface: eth1innodbcluster::cluster_name: InnovationDayinnodbcluster::grant::user: fredinnodbcluster::grant::password: fredinnodbcluster::seed: instance01

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

126 / 129

Page 127: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

example (2)With hiera-eyaml you can even encrypt your password:

innodbcluster::mysql_root_password: > ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI ... FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz gcXTgBAnb1gGrBZAfAiv/ztwuZ9z]innodbcluster::mysql_bind_interface: eth1innodbcluster::cluster_name: InnovationDayinnodbcluster::grant::user: rootinnodbcluster::grant::password: > ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQEw DQYJKoZIhvcNAQEBBQAEggEAhqKUTXZ/4L8/aL3XARMfDBEI+s5HPshPg9BI ... FLfovstrb8zmcbk5yb/KD0lDM8Elas0lrnpk8MxwNfKw+hB299JFp8ldAtUk ODIieTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBJEeoyzHtW/WGpbiUz gcXTgBAnb1gGrBZAfAiv/ztwuZ9z]

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

127 / 129

Page 128: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Resourceshttp://lefred.be/content/mysql-innodb-cluster-mysql-shell-starter-guide/

http://lefred.be/content/mysql-innodb-cluster-automated-installation-with-puppet/

http://lefred.be/content/category/mysql/group-replication/

https://www.slideshare.net/lefred.descamps/mysql-devops-webinar

http://mysqlserverteam.com/innodb-cluster-in-opc/

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

128 / 129

Page 129: 1 / 129 - MySQL · 2017-05-08 · High Availability High availability is a characteristic of a system, which aims to ensure an agreed level of operational performance, usually uptime,

Thank you !

Any Questions ?

Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.

129 / 129