MySQL InnoDB Cluster - Group Replication

Preview:

Citation preview

1 / 126

MySQL Group Replication in a nutshell

the core of MySQL InnoDB Cluster

 

Oracle Open World

September 19th 2016

 

Frédéric Descamps

MySQL Community Manager

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

2 / 126

 

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 @ 2016 Oracle and/or its affiliates. All rights reserved.

3 / 126

Join us!

MySQL Community Reception @ OracleOpenWorld

Celebrate, Have Fun and Mingle with Oracle’s MySQL Engineers & Your Peers

Tuesday, September 20, 7.00 pmJillian’s at Metreon: 175 Fourth Street, San Francisco

At the corner of Howard and 4th st.; only 2-min walk from Moscone Center (sameplace as last year)

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

4 / 126

about.me/lefred

Who am I ?

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

5 / 126

Frédéric Descamps@lefredMySQL EvangelistManaging MySQL since 3.23devops believer

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

6 / 126

get more at the conference

MySQL Group Replication

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

7 / 126

Other sessionsCON2907 - MySQL High AvailabilityMatt LordCON4669 - MySQL High Availability with Group ReplicationNuno GomesCON3373 - The State of the Art of MySQL ReplicationLuis SoaresHOL2912 - Building a Highly Available MySQL Database Service with Group ReplicationMatt Lord

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

8 / 126

AgendaGroup Replication concepts

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

9 / 126

AgendaGroup Replication conceptsUsing new & cool tools

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

10 / 126

AgendaGroup Replication conceptsUsing new & cool toolsApplication interaction

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

11 / 126

the magic explained

Group Replication Concept

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

12 / 126

Group Replication : what is it ?

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

13 / 126

Group Replication : what is it ?MySQL is one of the major components of MySQL InnoDB Cluster

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

14 / 126

Group Replication : what is it ?MySQL is one of the major components of MySQL InnoDB Cluster  

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

15 / 126

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

16 / 126

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

17 / 126

Group replication is a plugin !

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

18 / 126

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

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

19 / 126

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

MySQL Group Communication System (GCS) is based on Paxos

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

20 / 126

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

MySQL Group Communication System (GCS) is based on PaxosProvides virtually synchronous replication for MySQL 5.7+

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

21 / 126

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

MySQL Group Communication System (GCS) is based on PaxosProvides virtually synchronous replication for MySQL 5.7+Supported on all MySQL platforms !!

Linux, Windows, Solaris, OSX, FreeBSD

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

22 / 126

 

 

 

“Multi-master update anywhere replication plugin for MySQL with built-in conflictdetection and resolution, automatic distributed recovery, and group membership.”

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

23 / 126

Group Replication : how does it work ?

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

24 / 126

Group Replication : how does it work ?A node (member of the group) send the changes (binlog events) made by atransaction to the group through the GCS.

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

25 / 126

Group Replication : how does it work ?A node (member of the group) send the changes (binlog events) made by atransaction to the group through the GCS.All members consume the writeset and certify it

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

26 / 126

Group Replication : how does it work ?A node (member of the group) send the changes (binlog events) made by atransaction to the group through the GCS.All members consume the writeset and certify itIf passed it is applied, if failed, transaction is rolled back on originating server anddiscarded at other servers.

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

27 / 126

OK... but how does it work ?!

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

28 / 126

OK... but how does it work ?!It's just magic !

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

29 / 126

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 @ 2016 Oracle and/or its affiliates. All rights reserved.

30 / 126

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 ? Let's illustrate this...

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

31 / 126

MySQL Group Replication (autocommit)

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

32 / 126

MySQL Group Replication (autocommit)

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

33 / 126

MySQL Group Replication (autocommit)

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

34 / 126

MySQL Group Replication (autocommit)

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

35 / 126

MySQL Group Replication (autocommit)

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

36 / 126

MySQL Group Replication (autocommit)

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

37 / 126

MySQL Group Replication (autocommit)

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

38 / 126

MySQL Group Replication (full transaction)

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

39 / 126

MySQL Group Replication (full transaction)

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

40 / 126

MySQL Group Replication (full transaction)

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

41 / 126

MySQL Group Replication (full transaction)

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

42 / 126

MySQL Group Replication (full transaction)

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

43 / 126

MySQL Group Replication (full transaction)

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

44 / 126

MySQL Group Replication (full transaction)

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

45 / 126

MySQL Group Replication (full transaction)

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

46 / 126

MySQL Group Replication (full transaction)

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

47 / 126

Group Replication : Optimistic LockingWith GR we use what we call optimistic locking, it means we consider a resource free andthis will be confirmed or not during certification.

Let's first have a look at the traditional locking to compare.

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

48 / 126

Traditional locking

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

49 / 126

Traditional locking

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

50 / 126

Traditional locking

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

51 / 126

Traditional locking

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

52 / 126

Traditional locking

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

53 / 126

Traditional locking

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

54 / 126

Optimistic Locking

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

55 / 126

Optimistic Locking

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

56 / 126

Optimistic Locking

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

57 / 126

Optimistic Locking

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

58 / 126

Optimistic Locking

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

59 / 126

Optimistic Locking

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

60 / 126

Optimistic Locking

The system returns error 149 as certification failed:

ERROR 1180 (HY000): Got error 149 during COMMIT

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

61 / 126

Group Replication : requirementsexclusively use of InnoDB tables only

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

62 / 126

Group Replication : requirementsexclusively use of InnoDB tables onlyevery tables must have a PK defined

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

63 / 126

Group Replication : requirementsexclusively use of InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supported

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

64 / 126

Group Replication : requirementsexclusively use of InnoDB tables onlyevery tables must have a PK definedonly IPV4 is supporteda good network with low latency is important

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

65 / 126

Group Replication : requirementsexclusively use of 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 @ 2016 Oracle and/or its affiliates. All rights reserved.

66 / 126

Group Replication : requirementsexclusively use of 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 @ 2016 Oracle and/or its affiliates. All rights reserved.

67 / 126

Group Replication : requirements (2)enable GTIDs

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

68 / 126

Group Replication : requirements (2)enable GTIDsreplication meta-data must be stored on system tables

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

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

69 / 126

Group Replication : requirements (2)enable GTIDsreplication meta-data must be stored on system tables

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

writesets extraction must be enabled

--transaction-write-set-extraction=XXHASH64

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

70 / 126

Group Replication : requirements (2)enable GTIDsreplication meta-data must be stored on 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 be enabled

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

71 / 126

Group Replication : limitationsThere are also some technical limitations:

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

72 / 126

Group Replication : limitationsThere are also some technical limitations:

binlog checksum is not supported

--binlog-checksum=NONE

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

73 / 126

Group Replication : limitationsThere are also some technical limitations:

binlog checksum is not supported

--binlog-checksum=NONE

Savepoints are not supported

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

74 / 126

Group Replication : limitationsThere are also some technical limitations:

binlog checksum is not supported

--binlog-checksum=NONE

Savepoints are not supportedSERIALIZABLE is not supported as transaction isolation level

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

75 / 126

Group Replication : limitationsThere are also some technical limitations:

binlog checksum is not supported

--binlog-checksum=NONE

Savepoints are not supportedSERIALIZABLE is not supported as transaction isolation levelan object cannot be changed concurrently at different servers by two operations,where one of them is a DDL and the other is either a DML or DDL.

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

76 / 126

are we compatible ?

Pre-study

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

77 / 126

Is my workload ready for Group Replication ?Large transactions are more vulnerable because:

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

78 / 126

Is my workload ready for Group Replication ?Large transactions are more vulnerable because:

Large write set may increase the likelihood of certification conflicts

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

79 / 126

Is my workload ready for Group Replication ?Large transactions are more vulnerable because:

Large write set may increase the likelihood of certification conflictsTransaction taking longer to execute may be more vulnerable to be aborted by acertified transaction.

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

80 / 126

Is my workload ready for Group Replication ?Large transactions are more vulnerable because:

Large write set may increase the likelihood of certification conflictsTransaction taking longer to execute may be more vulnerable to be aborted by acertified transaction.

Small transactions changing a very small set of data (hotspots):

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

81 / 126

Is my workload ready for Group Replication ?Large transactions are more vulnerable because:

Large write set may increase the likelihood of certification conflictsTransaction taking longer to execute may be more vulnerable to be aborted by acertified transaction.

Small transactions changing a very small set of data (hotspots):Concurrently executing them at different sites will trade-off contention with rollbacks due to the optimistic execution

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

82 / 126

Therefore, when using Group Replication, we should pay attention to these points:

PK is mandatory (and a good one is better)avoid large transactionsavoid hotspot

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

83 / 126

Scheme verificationWe will see now a list a queries that allows us to analyze our scheme. We will look for:

non InnoDB tablestables without PKtables with a bad PK

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

84 / 126

Non InnoDB tables

 

SELECT table_schema, table_name, engine, table_rows, (index_length+data_length)/1024/1024 AS sizeMB FROM information_schema.tables WHERE engine != 'innodb' AND table_schema NOT IN ('information_schema', 'mysql', 'performance_schema');

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

 85 / 126

Tables Without Primary Keyselect tables.table_schema, tables.table_name, tables.engine, tables.table_rowsfrom information_schema.tablesleft join ( select table_schema, table_name from information_schema.statistics group by table_schema, table_name, index_name having sum( case when non_unique = 0 and nullable != 'YES' then 1 else 0 end ) = count(*)) pukson tables.table_schema = puks.table_schemaand tables.table_name = puks.table_namewhere puks.table_name is nulland tables.table_type = 'BASE TABLE' and engine='InnoDB';

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

 86 / 126

Tables with bad primarky keys

 

set SQL_MODE=""; select a.TABLE_SCHEMA,a.TABLE_NAME, b.ENGINE, a.COLUMN_NAME, a.DATA_TYPE, a.COLUMN_TYPE, a.COLUMN_KEY, b.TABLE_ROWS from information_schema.COLUMNS as a join information_schema.TABLES as b on b.TABLE_NAME=a.TABLE_NAME and b.TABLE_SCHEMA=a.TABLE_SCHEMA where COLUMN_KEY='PRI' and ENGINE="InnoDB" and DATA_TYPE not like '%int' and DATA_TYPE not like 'enum%' and DATA_TYPE not like 'date%' and DATA_TYPE not like 'time%' and a.TABLE_SCHEMA not in ('mysql','sys')group by table_schema, table_name;

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

 87 / 126

Workload analysisNow it's time to play with Performance_Schema to analyze our workload.

The goal is to identify:

transactions with most statements (and most writes in particular)transactions with most rows affectedlargest statements by row affectedqueries updating most the same PK and therefore having to wait more)

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

88 / 126

Setup Performance_Schema

We need to enable some consumers and instruments:

update performance_schema.setup_consumers set enabled = 'yes' where name like 'events_statement%' or name like 'events_transaction%';

update performance_schema.setup_instruments set enabled = 'yes', timed = 'yes' where name = 'transaction';

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

 89 / 126

Find the transactions with most statements

 

select t.thread_id, t.event_id, count(*) statement_count, sum(s.rows_affected) rows_affected, length(replace(group_concat( case when s.event_name = "statement/sql/update" then 1 when s.event_name = "statement/sql/insert" then 1 when s.event_name = "statement/sql/delete" then 1 else null end),',','')) as "# write statements" from performance_schema.events_transactions_history_long t join performance_schema.events_statements_history_long s on t.thread_id = s.thread_id and t.event_id = s.nesting_event_id group by t.thread_id, t.event_id order by rows_affected desc limit 10;

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

 90 / 126

Find the transactions with most statements

It's possible to see what are all these statements in one transaction:

set group_concat_max_len = 1000000;

select t.thread_id, t.event_id, count(*) statement_count, sum(s.rows_affected) rows_affected, group_concat(sql_text order by s.event_id separator '\n') statements from performance_schema.events_transactions_history_long t join performance_schema.events_statements_history_long s on t.thread_id = s.thread_id and t.event_id = s.nesting_event_id group by t.thread_id, t.event_id order by statement_count desc limit 1\G

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

 91 / 126

Find the transactions with most rows affected

 

select t.thread_id, t.event_id, count(*) statement_count, sum(s.rows_affected) rows_affected, length(replace(group_concat( case when s.event_name = "statement/sql/update" then 1 when s.event_name = "statement/sql/insert" then 1 when s.event_name = "statement/sql/delete" then 1 else null end),',','')) as "# write statements" from performance_schema.events_transactions_history_long t join performance_schema.events_statements_history_long s on t.thread_id = s.thread_id and t.event_id = s.nesting_event_id group by t.thread_id, t.event_id order by rows_affected desc limit 10;

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

 92 / 126

Find the transactions with most rows affected

It's again possible the see what are the statements:

select t.thread_id, t.event_id, count(*) statement_count, sum(s.rows_affected) rows_affected, group_concat(sql_text order by s.event_id separator '\n') statements from performance_schema.events_transactions_history_long t join performance_schema.events_statements_history_long s on t.thread_id = s.thread_id and t.event_id = s.nesting_event_id group by t.thread_id, t.event_id order by rows_affected desc limit 1\G

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

 93 / 126

Find the transactions with most rows affected

It's again possible the see what are the statements:

select t.thread_id, t.event_id, count(*) statement_count, sum(s.rows_affected) rows_affected, group_concat(sql_text order by s.event_id separator '\n') statements from performance_schema.events_transactions_history_long t join performance_schema.events_statements_history_long s on t.thread_id = s.thread_id and t.event_id = s.nesting_event_id group by t.thread_id, t.event_id order by rows_affected desc limit 1\G

Don't forget to verify the auto_commit ones are they are not returned with the queryabove.

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

 94 / 126

Find largest statements by row affected

 

select query, db, rows_affected, rows_affected_avg from sys.statement_analysis order by rows_affected_avg desc limit 10;

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

 95 / 126

Find queries that write the most.

Looking for lots of updates/timer_wait to the same PKs.

 

select * from performance_schema.events_statements_history_long where rows_affected > 1 order by timer_wait desc limit 20\G

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

 96 / 126

help me to configure my InnoDB Cluster

Using new cool tools

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

97 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:

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

98 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:JavaScript

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

99 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:JavaScriptPython

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

100 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:JavaScriptPythonSQL

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

101 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:JavaScriptPythonSQL

Supports both Document and Relational models

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

102 / 126

MySQL ShellThe MySQL Team extended MySQL Shell to use the new Admin API.

Now MySQL Shell is a single unified client for all adminstrative and operatons tasks.

Multi-Language:JavaScriptPythonSQL

Supports both Document and Relational modelsExposes full Development and Admin API

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

103 / 126

MySQL Shell: Admin APImysql-js> dba.help()

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

104 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL API

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

105 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

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

106 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

create cluster

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

107 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

create clusterdeploy MySQL instances (in sandbox only for the moment)

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

108 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

create clusterdeploy MySQL instances (in sandbox only for the moment)get cluster info

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

109 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

create clusterdeploy MySQL instances (in sandbox only for the moment)get cluster infostart/stop MySQL instances

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

110 / 126

MySQL Shell: Admin APImysql-js> dba.help()

the global variable dba is used to access the MySQL APIperform DBA operations to manage MySQL InnoDB Cluster:

create clusterdeploy MySQL instances (in sandbox only for the moment)get cluster infostart/stop MySQL instancesvalidate MySQL instances

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

111 / 126

mysqlprovisionThe mysqlprovision utility is designed to facilitate the management of MySQL GroupReplication, allowing users to start a replica set (a new replication group), to add/removemembers to/from an existing group. It can also check if an instance meets all therequirements to successfully create a new group or to be added to an existing group. Thisutility is also capable of modifying MySQL option files of existing instances in order forthem to meet the requirements of Group Replication.

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

112 / 126

let's create our first MySQL InnoDB Cluster

Demo time !

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

113 / 126

MySQL InnoDB Cluster

demo

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

114 / 126

full HA ?

Application interaction

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

115 / 126

MySQL RouterMySQL ShellMySQL Group ReplicationMySQL Server

MySQL InnoDB ClusterSo MySQL InnoDB Cluster is composed by:

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

116 / 126

MySQL RouterMySQL ShellMySQL Group ReplicationMySQL Server

MySQL InnoDB ClusterSo MySQL InnoDB Cluster is composed by:

 

CON2907 - MySQL High Availability - Matt Lord - Wed 12:15

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

117 / 126

MySQL RouterTransparent client connection routing (TCP level 4)

load balancingconnection failover

Native support for InnoDB Clusters

understands Group Replication topologyutilizes metadata schema stored on each members

bootstrap and auto-configsupports multi-master and single primary modes

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

118 / 126

MySQL Router & Group Replication

Quick demo !

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

119 / 126

MySQL Router & Group Replication

demo

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

120 / 126

Any other alternatives ?

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

121 / 126

Any other alternatives ?It's possible to use MySQL Group Replication with other proxies/load-balancers

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

122 / 126

Any other alternatives ?It's possible to use MySQL Group Replication with other proxies/load-balancers

HAProxy : http://lefred.be/content/mysql-group-replication-as-ha-solution/

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

123 / 126

ProxySQL : http://lefred.be/content/ha-with-mysql-group-replication-and-proxysql/

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

124 / 126

Questions ?

Thank you !   

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

125 / 126

Join us!Register: http://tinyurl.com/mysqloow16

MySQL Community Reception @ OracleOpenWorld

Tuesday, September 20, 7.00 pmJillian’s at Metreon: 175 Fourth Street, San Francisco

At the corner of Howard and 4th st.; only 2-min walk from Moscone Center (sameplace as last year)

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

126 / 126

Recommended