SlideShare a Scribd company logo
1 of 192
Download to read offline
1 / 192
MySQL Group Replication in a nutshell
MySQL InnoDB Cluster: hands-on tutorial
 
Percona Live Amsterdam- October 2016
 
Frédéric Descamps - MySQL Community Manager - Oracle
Kenny Gryp - MySQL Practice Manager - Percona
2 / 192
 
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purpose only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied up in
making purchasing decisions. The development, release and timing of any features or
functionality described for Oracle's product remains at the sole discretion of Oracle.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
3 / 192
about.me/lefred
Who are we ?
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
4 / 192
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
5 / 192
Frédéric Descamps
@lefred
MySQL Evangelist
Managing MySQL since 3.23
devops believer
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
6 / 192
Kenny Gryp
@gryp
MySQL Practice Manager
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
7 / 192
get more at the conference
MySQL Group Replication
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
8 / 192
Other session
MySQL Replication: Latest Developments
LuìsSoares
Tuesday 4 October 2016
3:10pmto 4:00pm- Zürich 1
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
9 / 192
Agenda
Prepare your workstation
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
10 / 192
Agenda
Prepare your workstation
Group Replication concepts
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
11 / 192
Agenda
Prepare your workstation
Group Replication concepts
Migration fromMaster-Slave to GR
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
12 / 192
Agenda
Prepare your workstation
Group Replication concepts
Migration fromMaster-Slave to GR
Howto monitor ?
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
13 / 192
Agenda
Prepare your workstation
Group Replication concepts
Migration fromMaster-Slave to GR
Howto monitor ?
Application interaction
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
14 / 192
VirtualBox
Setup your workstation
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
15 / 192
Setup your workstation
Install VirtualBox 5
On the USB key, there is a file called PLAM16_GR.ova, please copy it on your
laptop and doubleclick on it
Start all virtual machines (mysql1, mysql2, mysql3 &mysql4)
Install putty if you are using Windows
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
16 / 192
Setup your workstation
Install VirtualBox 5
On the USB key, there is a file called PLAM16_GR.ova, please copy it on your
laptop and doubleclick on it
Start all virtual machines (mysql1, mysql2, mysql3 &mysql4)
Install putty if you are using Windows
Try to connect to all VM's fromyour terminal or putty (rootpasswordisX):
ssh -p 8821 root@127.0.0.1 to mysql1
ssh -p 8822 root@127.0.0.1 to mysql2
ssh -p 8823 root@127.0.0.1 to mysql3
ssh -p 8824 root@127.0.0.1 to mysql4
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
17 / 192
LAB1: Current situation
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
18 / 192
launch
run_app.sh
on mysql1 into
a screen
session
verify that
mysql2 is a
running slave
LAB1: Current situation
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
19 / 192
Summary
 
+--------+----------+--------------+-----------------+
| | ROLE | SSH PORT | INTERNAL IP |
+--------+----------+--------------+-----------------+
| | | | |
| mysql1 | master | 8821 | 192.168.56.11 |
| | | | |
| mysql2 | slave | 8822 | 192.168.56.12 |
| | | | |
| mysql3 | n/a | 8823 | 192.168.56.13 |
| | | | |
| mysql4 | n/a | 8824 | 192.168.56.14 |
| | | | |
+--------+----------+--------------+-----------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
20 / 192
the magic explained
Group Replication Concept
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
21 / 192
Group Replication : what is it ?
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
22 / 192
Group Replication : what is it ?
MySQL Group Replication is one of the major components of MySQL InnoDB Cluster
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
23 / 192
Group Replication : what is it ?
MySQL Group Replication is one of the major components of MySQL InnoDB Cluster  
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
24 / 192
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
25 / 192
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
26 / 192
Group replication is a plugin !
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
27 / 192
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.
28 / 192
Group replication is a plugin !
GR is a plugin for MySQL, made by MySQL and packaged with MySQL
GR is an implementation of Replicated Database State Machine theory
MySQL Group Communication System(GCS) is based on Paxos Mencius
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
29 / 192
Group replication is a plugin !
GR is a plugin for MySQL, made by MySQL and packaged with MySQL
GR is an implementation of Replicated Database State Machine theory
MySQL Group Communication System(GCS) is based on Paxos Mencius
Provides virtually synchronous replication for MySQL 5.7+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
30 / 192
Group replication is a plugin !
GR is a plugin for MySQL, made by MySQL and packaged with MySQL
GR is an implementation of Replicated Database State Machine theory
MySQL Group Communication System(GCS) is based on Paxos Mencius
Provides 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.
31 / 192
“Multi-masterupdateanywherereplicationpluginforMySQLwithbuilt-inconflict
detectionandresolution,automaticdistributedrecovery,andgroupmembership.”
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
32 / 192
Group Replication : how does it work ?
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
33 / 192
Group Replication : how does it work ?
A node (member of the group) sends the changes (binlog events) made by a
transaction to the group through the GCS.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
34 / 192
Group Replication : how does it work ?
A node (member of the group) sends the changes (binlog events) made by a
transaction to the group through the GCS.
All members consume the writeset and certify it, no need to wait for all members,
ack by the majority is enough.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
35 / 192
Group Replication : how does it work ?
A node (member of the group) sends the changes (binlog events) made by a
transaction to the group through the GCS.
All members consume the writeset and certify it, no need to wait for all members,
ack by the majority is enough.
If passed it is applied, if failed, transaction is rolled back on originating server and
discarded at other servers.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
36 / 192
OK... but how does it work ?!
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
37 / 192
OK... but how does it work ?!
It's just magic !
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
38 / 192
OK... but how does it work ?!
It's just magic !
... no, the writeset replication is synchronous and then certification and applying of the
changes happen locally on each node and is asynchronous.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
39 / 192
OK... but how does it work ?!
It's just magic !
... no, the writeset replication is synchronous and then certification and applying of the
changes happen locally on each node and is asynchronous.
not that easy to understand... right ? Let's illustrate this...
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
40 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
41 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
42 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
43 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
44 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
45 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
46 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
47 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
48 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
49 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
50 / 192
MySQL Group Replication (autocommit)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
51 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
52 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
53 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
54 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
55 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
56 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
57 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
58 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
59 / 192
MySQL Group Replication (full transaction)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
60 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
61 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
62 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
63 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
64 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
65 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
66 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
67 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
68 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
69 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
70 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
71 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
72 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
73 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
74 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
75 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
76 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
77 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
78 / 192
Group Replication : Total Order Delivery - GTID
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
79 / 192
Group Replication : Optimistic Locking
Group Replication uses optimistic locking
during a transaction, local (InnoDB) locking happens
optimistically assumes there will be no conflicts across nodes
(no communication between nodes necessary)
cluster-wide conflict resolution happens only at COMMIT, during certification
Let's first have a look at the traditional locking to compare.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
80 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
81 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
82 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
83 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
84 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
85 / 192
Traditional locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
86 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
87 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
88 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
89 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
90 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
91 / 192
Optimistic Locking
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
92 / 192
Optimistic Locking
The systemreturns error 149 as certification failed:
ERROR 1180 (HY000): Got error 149 during COMMIT
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
93 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
94 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
every tables must have a PK defined
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
95 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
every tables must have a PK defined
only IPV4 is supported
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
96 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
every tables must have a PK defined
only IPV4 is supported
a good network with lowlatency is important
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
97 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
every tables must have a PK defined
only IPV4 is supported
a good network with lowlatency is important
maximumof 9 members per group
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
98 / 192
Group Replication : requirements
exclusively works with InnoDB tables only
every tables must have a PK defined
only IPV4 is supported
a good network with lowlatency is important
maximumof 9 members per group
log-bin must be enabled and only ROWformat is supported
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
99 / 192
Group Replication : requirements (2)
enable GTIDs
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
100 / 192
Group Replication : requirements (2)
enable GTIDs
replication meta-data must be stored on systemtables
--master-info-repository=TABLE
--relay-log-info-repository=TABLE
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
101 / 192
Group Replication : requirements (2)
enable GTIDs
replication meta-data must be stored on systemtables
--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.
102 / 192
Group Replication : requirements (2)
enable GTIDs
replication meta-data must be stored on systemtables
--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.
103 / 192
Group Replication : limitations
There are also some technical limitations:
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
104 / 192
Group Replication : limitations
There are also some technical limitations:
binlog checksumis not supported
--binlog-checksum=NONE
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
105 / 192
Group Replication : limitations
There are also some technical limitations:
binlog checksumis not supported
--binlog-checksum=NONE
Savepoints are not supported
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
106 / 192
Group Replication : limitations
There are also some technical limitations:
binlog checksumis not supported
--binlog-checksum=NONE
Savepoints are not supported
SERIALIZABLEis not supported as transaction isolation level
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
107 / 192
Group Replication : limitations
There are also some technical limitations:
binlog checksumis not supported
--binlog-checksum=NONE
Savepoints are not supported
SERIALIZABLEis not supported as transaction isolation level
an object cannot be changed concurrently at different servers by two operations,
where one of themis a DDL and the other is either a DML or DDL.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
108 / 192
Is my workload ready for Group Replication ?
As the writesets (transactions) are replicated to all available nodes on commit, and as
they are certified on every node, a very large writeset could increase the amount of
certification errors.
Additionally, changing the same record on all the nodes (hotspot) concurrently will also
cause problems.
And finally, the certification uses the primary key of the tables, a table without PK is also
a problem.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
109 / 192
Is my workload ready for Group Replication ?
Therefore, when using Group Replication, we should pay attention to these points:
PK is mandatory (and a good one is better)
avoid large transactions
avoid hotspot
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
110 / 192
ready ?
Migration from Master-Slave to GR
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
111 / 192
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
112 / 192
1) We install and
setup MySQL InnoDB
Cluster on one of the
newservers
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
113 / 192
2) We restore a
backup
3) setup
asynchronous
replication on the new
server.
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
114 / 192
4) We add a new
instance to our group
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
115 / 192
5) We point the
application to one of
our newnodes.
6) We wait and check
that asynchronous
replication is caught
up
7) we stop those
asynchronous slaves
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
116 / 192
8) We attach the
mysql2 slave to the
group
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
117 / 192
9) Use MySQL Router
for directing traffic
The plan
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
118 / 192
MySQL InnoDB Cluster fromLabs is already
installed on mysql3.
Let's take a backup on mysql1:
[mysql1 ~]# xtrabackup --backup 
--target-dir=/tmp/backup 
--user=root 
--password=X --host=127.0.0.1
[mysql1 ~]# xtrabackup --prepare 
--target-dir=/tmp/backup
LAB2: Prepare mysql3
Asynchronousslave
119 / 192
LAB2: Prepare mysql3 (2)
Asynchronousslave
Copy the backup frommysql1 to mysql3:
[mysql1 ~]# scp -r /tmp/backup mysql3:/tmp
And restore it:
[mysql3 ~]# xtrabackup --copy-back --target-dir=/tmp/backup
[mysql3 ~]# chown -R mysql. /var/lib/mysql
120 / 192
LAB3: mysql3 as asynchronous slave (2)
Asynchronousslave
Configure /etc/my.cnf:
[mysqld]
...
server_id=3
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
121 / 192
LAB2: Prepare mysql3 (3)
Asynchronousslave
Let's start MySQL on mysql3:
[mysql3 ~]# systemctl start mysqld
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
122 / 192
find the GTIDs purged
change MASTER
set the purged GTIDs
start replication
LAB3: mysql3 as asynchronous slave (1)
 
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
123 / 192
LAB3: mysql3 as asynchronous slave (2)
Find the latest purged GTIDs:
[mysql3 ~]# cat /tmp/backup/xtrabackup_binlog_info
mysql-bin.000002 167646328 b346474c-8601-11e6-9b39-08002718d305:1-771
Connect to mysql3 and setup replication:
mysql> CHANGE MASTER TO MASTER_HOST="mysql1",
MASTER_USER="repl_async", MASTER_PASSWORD='Xslave',
MASTER_AUTO_POSITION=1;
mysql> RESET MASTER;
mysql> SET global gtid_purged="VALUE FOUND PREVIOUSLY";
mysql> START SLAVE;
Check that you receive the application's traffic
124 / 192
Disclamer !
The following commands to manage and use MySQL InnoDB Cluster are compatible with
MySQL InnoDB Cluster 5.7.15 Previewfromlabs.
Functions may change in future releases.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
125 / 192
LAB4: MySQL InnoDB Cluster
Createasingleinstancecluster
Time to use the newMySQL Shell !
[mysql3 ~]# mysqlsh
Let's verify if our server is ready to become a member of a newcluster:
mysql-js> dba.validateInstance('root@mysql3:3306')
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
126 / 192
LAB4: configuration settings (2)
mysql3's my.cnf
Configure /etc/my.cnf:
[mysqld]
...
server_id=3
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
binlog_checksum = none
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
127 / 192
LAB4: configuration settings (2)
mysql3's my.cnf
Configure /etc/my.cnf:
[mysqld]
...
server_id=3
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
binlog_checksum = none
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
[mysql3 ~]# systemctl restart mysqld
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
128 / 192
LAB4: MySQL InnoDB Cluster (3)
Createasingleinstancecluster
[mysql3 ~]# mysqlsh
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
129 / 192
LAB4: MySQL InnoDB Cluster (3)
Createasingleinstancecluster
[mysql3 ~]# mysqlsh
mysql-js> dba.validateInstance('root@mysql3:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.createCluster('plam')
The KEY is the only credential we need to remember to manage our cluster.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
130 / 192
LAB4: MySQL InnoDB Cluster (3)
Createasingleinstancecluster
[mysql3 ~]# mysqlsh
mysql-js> dba.validateInstance('root@mysql3:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.createCluster('plam')
The KEY is the only credential we need to remember to manage our cluster.
mysql-js> cluster.status()
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
131 / 192
Cluster Status
mysql-js> cluster.status()
{
"clusterName": "plam",
"defaultReplicaSet": {
"status": "Cluster is NOT tolerant to any failures.",
"topology": {
"mysql3:3306": {
"address": "mysql3:3306",
"status": "ONLINE",
"role": "HA",
"mode": "R/W",
"leaves": {}
}
}
}
}
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
132 / 192
Add mysql4 to the Group:
restore the backup
set the purged GTIDs
use MySQL shell
LAB5: add mysql4 to the cluster (1)
 
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
133 / 192
LAB5: add mysql4 to the cluster (2)
Copy the backup frommysql1 to mysql4:
[mysql1 ~]# scp -r /tmp/backup mysql4:/tmp
And restore it:
[mysql4 ~]# xtrabackup --copy-back --target-dir=/tmp/backup
[mysql4 ~]# chown -R mysql. /var/lib/mysql
Start MySQL on mysql4:
[mysql4 ~]# systemctl start mysqld
134 / 192
LAB5: MySQL shell to add an instance (3)
[mysql4 ~]# mysqlsh
Let's verify the config:
mysql-js> dba.validateInstance('root@mysql4:3306')
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
135 / 192
LAB5: MySQL shell to add an instance (4)
Configure /etc/my.cnf:
[mysqld]
...
server_id=4
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
binlog_checksum = none
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
136 / 192
LAB5: MySQL shell to add an instance (4)
Configure /etc/my.cnf:
[mysqld]
...
server_id=4
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
binlog_checksum = none
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
[mysql4 ~]# systemctl restart mysqld
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
137 / 192
LAB5: MySQL InnoDB Cluster (4)
Groupof2instances
Find the latest purged GTIDs:
[mysql4 ~]# cat /tmp/backup/xtrabackup_binlog_info
mysql-bin.000002 167646328 b346474c-8601-11e6-9b39-08002718d305:1-77177
Connect to mysql4 and set GTID_PURGED
[mysql4 ~]# mysqlsh
mysql-js> c root@mysql4:3306
mysql-js> sql
mysql-sql> RESET MASTER;
mysql-sql> SET global gtid_purged="VALUE FOUND PREVIOUSLY";
138 / 192
LAB5: MySQL InnoDB Cluster (5)
mysql-sql> js
mysql-js> dba.validateInstance('root@mysql4:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.getCluster('plam')
mysql-js> cluster.addInstance("root@mysql4:3306")
mysql-js> cluster.status()
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
139 / 192
Cluster Status
mysql-js> cluster.status()
{
"clusterName": "plam",
"defaultReplicaSet": {
"status": "Cluster is NOT tolerant to any failures.",
"topology": {
"mysql3:3306": {
"address": "mysql3:3306",
"status": "ONLINE",
"role": "HA",
"mode": "R/W",
"leaves": {
"mysql4:3306": {
"address": "mysql4:3306",
"status": "RECOVERING",
"role": "HA",
"mode": "R/O",
"leaves": {}
}
}
}
}
}
}
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
140 / 192
Recovering progress
On standard MySQL, monitor the group_replication_recovery channel to see
the progress:
mysql> show slave status for channel 'group_replication_recovery'G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: mysql3
Master_User: mysql_innodb_cluster_rpl_user
...
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
...
Retrieved_Gtid_Set: 6e7d7848-860f-11e6-92e4-08002718d305:1-6,
7c1f0c2d-860d-11e6-9df7-08002718d305:1-15,
b346474c-8601-11e6-9b39-08002718d305:1964-77177,
e8c524df-860d-11e6-9df7-08002718d305:1-2
Executed_Gtid_Set: 7c1f0c2d-860d-11e6-9df7-08002718d305:1-7,
b346474c-8601-11e6-9b39-08002718d305:1-45408,
e8c524df-860d-11e6-9df7-08002718d305:1-2
...
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
141 / 192
point the application
to the cluster
Migrate the application
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
142 / 192
LAB6: Migrate the application
Nowwe need to point the application to mysql3, this is the only downtime !
...
[ 21257s] threads: 4, tps: 12.00, reads: 167.94, writes: 47.98, response time: 18
[ 21258s] threads: 4, tps: 6.00, reads: 83.96, writes: 23.99, response time: 14
[ 21259s] threads: 4, tps: 7.00, reads: 98.05, writes: 28.01, response time: 16
[ 31250s] threads: 4, tps: 8.00, reads: 111.95, writes: 31.99, response time: 30
[ 31251s] threads: 4, tps: 11.00, reads: 154.01, writes: 44.00, response time: 13
[ 31252s] threads: 4, tps: 11.00, reads: 153.94, writes: 43.98, response time: 12
[ 31253s] threads: 4, tps: 10.01, reads: 140.07, writes: 40.02, response time: 17
^C
[mysql1 ~]# run_app.sh mysql3
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
143 / 192
LAB6: Migrate the application
Make sure replication is running properly on mysql2 and mysql3.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
144 / 192
LAB6: Migrate the application
Make sure replication is running properly on mysql2 and mysql3.
************************** 1. row ***************************
...
Master_Host: mysql1
Slave_IO_Running: Yes
Slave_SQL_Running: No
...
Last_SQL_Errno: 3100
Last_SQL_Error: Error in Xid_log_event: Commit could not be completed,
'Error on observer while running replication hook 'before_commit'.'
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: 8fbcd944-8760-11e6-9b4e-08002718d305
...
Last_SQL_Error_Timestamp: 160930 23:04:07
Retrieved_Gtid_Set: 8fbcd944-8760-11e6-9b4e-08002718d305:360-3704
Executed_Gtid_Set: 0b31b4f3-8762-11e6-bb35-08002718d305:1-7,
30212757-8762-11e6-ad73-08002718d305:1-2,
8fbcd944-8760-11e6-9b4e-08002718d305:1-2652
Auto_Position: 1
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
145 / 192
LAB6: Migrate the application
Fix replication if necessary:
mysql3> start slave;
mysql3> show slave status;
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
146 / 192
LAB6: Migrate the application
Fix replication if necessary:
mysql3> start slave;
mysql3> show slave status;
Stop asynchronous replication on mysql2 and mysql3:
mysql2> stop slave;
mysql3> stop slave;
Make sure gtid_executed range on mysql2 is lower or equal than on mysql3
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
147 / 192
LAB6: Migrate the application
Fix replication if necessary:
mysql3> start slave;
mysql3> show slave status;
Stop asynchronous replication on mysql2 and mysql3:
mysql2> stop slave;
mysql3> stop slave;
Make sure gtid_executed range on mysql2 is lower or equal than on mysql3
mysql2> set global super_read_only=off;# http://bugs.mysql.com/bug.php?id=83234
mysql2> reset slave all;
mysql3> reset slave all;
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
148 / 192
previous slave
(mysql2) can now
be part of the cluster
Add a third instance
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
149 / 192
LAB7: Add mysql2 to the group
We first validate the instance using MySQL shell and we modify the configuration.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
150 / 192
LAB7: Add mysql2 to the group
We first validate the instance using MySQL shell and we modify the configuration.
[mysqld]
...
super_read_only=0
server_id=2
binlog_checksum = none
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
151 / 192
LAB7: Add mysql2 to the group
We first validate the instance using MySQL shell and we modify the configuration.
[mysqld]
...
super_read_only=0
server_id=2
binlog_checksum = none
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
master_info_repository = TABLE
relay_log_info_repository = TABLE
transaction_write_set_extraction = XXHASH64
[mysql2 ~]# systemctl restart mysqld
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
152 / 192
LAB7: Add mysql2 to the group (2)
Back in MySQL shell we add the newinstance:
[mysql2 ~]# mysqlsh
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
153 / 192
LAB7: Add mysql2 to the group (2)
Back in MySQL shell we add the newinstance:
[mysql2 ~]# mysqlsh
mysql-js> dba.validateInstance('root@mysql2:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.getCluster('plam')
mysql-js> cluster.addInstance("root@mysql2:3306")
mysql-js> cluster.status()
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
154 / 192
LAB7: Add mysql2 to the group (3)
{
"clusterName": "plam",
"defaultReplicaSet": {
"status": "Cluster tolerant to up to ONE failure.",
"topology": {
"mysql3:3306": {
"address": "mysql3:3306",
"status": "ONLINE",
"role": "HA",
"mode": "R/W",
"leaves": {
"mysql4:3306": {
"address": "mysql4:3306",
"status": "ONLINE",
"role": "HA",
"mode": "R/O",
"leaves": {}
},
"mysql2:3306": {
"address": "mysql2:3306",
"status": "ONLINE",
"role": "HA",
"mode": "R/O",
"leaves": {}
}
} Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
155 / 192
WOOHOOOOW
IT WORKS!
156 / 192
writing to a single server
Single Primary Mode
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
157 / 192
Default = Single Primary Mode
By default, MySQL InnoDB Cluster enables Single Primary Mode.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
158 / 192
Default = Single Primary Mode
By default, MySQL InnoDB Cluster enables Single Primary Mode.
mysql> show global variables like 'group_replication_single_primary_mode';
+---------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------+-------+
| group_replication_single_primary_mode | ON |
+---------------------------------------+-------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
159 / 192
Default = Single Primary Mode
By default, MySQL InnoDB Cluster enables Single Primary Mode.
mysql> show global variables like 'group_replication_single_primary_mode';
+---------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------+-------+
| group_replication_single_primary_mode | ON |
+---------------------------------------+-------+
In Single Primary Mode, a single member acts as the writable master (PRIMARY) and the
rest of the members act as hot-standbys (SECONDARY).
The group itself coordinates and configures itself automatically to determine which
member will act as the PRIMARY, through a leader election mechanism.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
160 / 192
Who's the Primary Master ?
As the Primary Master is elected, all nodes part of the group knows which one was
elected. This value is exposed in status variables:
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
161 / 192
Who's the Primary Master ?
As the Primary Master is elected, all nodes part of the group knows which one was
elected. This value is exposed in status variables:
mysql> show status like 'group_replication_primary_member';
+----------------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------------+--------------------------------------+
| group_replication_primary_member | 28a4e51f-860e-11e6-bdc4-08002718d305 |
+----------------------------------+--------------------------------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
162 / 192
Who's the Primary Master ?
As the Primary Master is elected, all nodes part of the group knows which one was
elected. This value is exposed in status variables:
mysql> show status like 'group_replication_primary_member';
+----------------------------------+--------------------------------------+
| Variable_name | Value |
+----------------------------------+--------------------------------------+
| group_replication_primary_member | 28a4e51f-860e-11e6-bdc4-08002718d305 |
+----------------------------------+--------------------------------------+
mysql> select member_host as "primary master"
from performance_schema.global_status
join performance_schema.replication_group_members
where variable_name = 'group_replication_primary_member'
and member_id=variable_value;
+---------------+
| primary master|
+---------------+
| mysql3 |
+---------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
163 / 192
get more info
Monitoring
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
164 / 192
Performance Schema
Group Replication uses Performance_Schema to expose status
mysql3> SELECT * FROM performance_schema.replication_group_membersG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b
MEMBER_HOST: mysql3.localdomain
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
165 / 192
Performance Schema
Group Replication uses Performance_Schema to expose status
mysql3> SELECT * FROM performance_schema.replication_group_membersG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b
MEMBER_HOST: mysql3.localdomain
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
mysql3> SELECT * FROM performance_schema.replication_connection_statusG
*************************** 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-2
LAST_ERROR_NUMBER: 0
LAST_ERROR_MESSAGE:
LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
166 / 192
Member State
These are the different possible state for a node member:
ONLINE
OFFLINE
RECOVERING
ERROR: when a node is leaving but the plugin was not instructed to stop
UNREACHABLE
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
167 / 192
Status information & metrics
Members
mysql> SELECT * FROM performance_schema.replication_group_membersG
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
168 / 192
Status information & metrics
Members
mysql> SELECT * FROM performance_schema.replication_group_membersG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b
MEMBER_HOST: mysql3.localdomain
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
*************************** 2. row ***************************
CHANNEL_NAME: group_replication_applier
MEMBER_ID: e1544c9d-4451-11e6-9f5a-08002774c31b
MEMBER_HOST: mysql4.localdomain.localdomain
MEMBER_PORT: 3306
MEMBER_STATE: ONLINE
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
169 / 192
Status information & metrics
Connections
mysql> SELECT * FROM performance_schema.replication_connection_statusG
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
170 / 192
Status information & metrics
Connections
mysql> SELECT * FROM performance_schema.replication_connection_statusG
*************************** 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: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089,
afb80f36-2bff-11e6-84e0-0800277dd3bf:1-2834
LAST_ERROR_NUMBER: 0
LAST_ERROR_MESSAGE:
LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00
*************************** 2. row ***************************
CHANNEL_NAME: group_replication_recovery
GROUP_NAME:
SOURCE_UUID:
THREAD_ID: NULL
SERVICE_STATE: OFF
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
171 / 192
Status information & metrics
Local node status
mysql> select * from performance_schema.replication_group_member_statsG
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
172 / 192
Status information & metrics
Local node status
mysql> select * from performance_schema.replication_group_member_statsG
*************************** 1. row ***************************
CHANNEL_NAME: group_replication_applier
VIEW_ID: 14679667214442885:4
MEMBER_ID: e1544c9d-4451-11e6-9f5a-08002774c31b
COUNT_TRANSACTIONS_IN_QUEUE: 0
COUNT_TRANSACTIONS_CHECKED: 5961
COUNT_CONFLICTS_DETECTED: 0
COUNT_TRANSACTIONS_ROWS_VALIDATING: 0
TRANSACTIONS_COMMITTED_ALL_MEMBERS: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089,
afb80f36-2bff-11e6-84e0-0800277dd3bf:1-5718
LAST_CONFLICT_FREE_TRANSACTION: afb80f36-2bff-11e6-84e0-0800277dd3bf:5718
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
173 / 192
Performance_Schema
You can find GR information in the following Performance_Schema tables:
replication_applier_con guration
replication_applier_status
replication_applier_status_by_worker
replication_connection_con guration
replication_connection_status
replication_group_member_stats
replication_group_members
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
174 / 192
Status during recovery
mysql> SHOW SLAVE STATUS FOR CHANNEL 'group_replication_recovery'G
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
175 / 192
Status during recovery
mysql> SHOW SLAVE STATUS FOR CHANNEL 'group_replication_recovery'G
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: <NULL>
Master_User: gr_repl
Master_Port: 0
...
Relay_Log_File: mysql4-relay-bin-group_replication_recovery.000001
...
Slave_IO_Running: No
Slave_SQL_Running: No
...
Executed_Gtid_Set: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089,
afb80f36-2bff-11e6-84e0-0800277dd3bf:1-5718
...
Channel_Name: group_replication_recovery
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
176 / 192
Sys Schema
The easiest way to detect if a node is a member of the primary component (when there
are partitioning of your nodes due to network issues for example) and therefore a valid
candidate for routing queries to it, is to use the sys table.
Additional information for sys can be downloaded at
https://github.com/lefred/mysql_gr_routing_check/blob/master/addition_to_sys.sql
On the primary node:
[mysql3 ~]# mysql < /tmp/gr_addition_to_sys.sql
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
177 / 192
Sys Schema
Is this node part of PRIMARY Partition:
mysql3> SELECT sys.gr_member_in_primary_partition();
+------------------------------------+
| sys.gr_node_in_primary_partition() |
+------------------------------------+
| YES |
+------------------------------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
178 / 192
Sys Schema
Is this node part of PRIMARY Partition:
mysql3> SELECT sys.gr_member_in_primary_partition();
+------------------------------------+
| sys.gr_node_in_primary_partition() |
+------------------------------------+
| YES |
+------------------------------------+
To use as healthcheck:
mysql3> SELECT * FROM sys.gr_member_routing_candidate_status;
+------------------+-----------+---------------------+----------------------+
| viable_candidate | read_only | transactions_behind | transactions_to_cert |
+------------------+-----------+---------------------+----------------------+
| YES | YES | 0 | 0 |
+------------------+-----------+---------------------+----------------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
179 / 192
Sys Schema - Heath Check
On one of the non Primary nodes, run the following command:
mysql-sql> ush tables with read lock;
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
180 / 192
Sys Schema - Heath Check
On one of the non Primary nodes, run the following command:
mysql-sql> ush tables with read lock;
Nowyou can verify what the healthcheck exposes to you:
mysql-sql> SELECT * FROM sys.gr_member_routing_candidate_status;
+------------------+-----------+---------------------+----------------------+
| viable_candidate | read_only | transactions_behind | transactions_to_cert |
+------------------+-----------+---------------------+----------------------+
| YES | YES | 950 | 0 |
+------------------+-----------+---------------------+----------------------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
181 / 192
Sys Schema - Heath Check
On one of the non Primary nodes, run the following command:
mysql-sql> ush tables with read lock;
Nowyou can verify what the healthcheck exposes to you:
mysql-sql> SELECT * FROM sys.gr_member_routing_candidate_status;
+------------------+-----------+---------------------+----------------------+
| viable_candidate | read_only | transactions_behind | transactions_to_cert |
+------------------+-----------+---------------------+----------------------+
| YES | YES | 950 | 0 |
+------------------+-----------+---------------------+----------------------+
mysql-sql> UNLOCK tables;
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
182 / 192
application interaction
MySQL Router
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
183 / 192
MySQL Router
We will nowuse mysqlrouter between our application and the cluster.
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
184 / 192
MySQL Router (2)
Configure MySQL Router (bootstrap it using an instance):
[mysql2 ~]# mysqlrouter --bootstrap mysql2:3306
Please enter the administrative MASTER key for the MySQL InnoDB cluster:
MySQL Router has now been con gured for the InnoDB cluster 'plam'.
The following connection information can be used to connect to the cluster.
Classic MySQL protocol connections to cluster 'plam':
- Read/Write Connections: localhost:6446
- Read/Only Connections: localhost:6447
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
185 / 192
MySQL Router (3)
Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to
port 3306:
[mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
186 / 192
MySQL Router (3)
Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to
port 3306:
[mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/
[routing:default_rw]
-bind_port=6446
+bind_port=3306
+bind_address=mysql1
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
187 / 192
MySQL Router (3)
Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to
port 3306:
[mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/
[routing:default_rw]
-bind_port=6446
+bind_port=3306
+bind_address=mysql1
We can stop mysqld on mysql1 and start mysqlrouter into a screen session:
[mysql1 ~]# systemctl stop mysqld
[mysql1 ~]# mysqlrouter
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
188 / 192
MySQL Router (4)
Nowwe can point the application to the router:
[mysql1 ~]# run_app.sh mysql1
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
189 / 192
MySQL Router (4)
Nowwe can point the application to the router:
[mysql1 ~]# run_app.sh mysql1
Check app and kill mysqld on mysql3 (the Primary Master R/Wnode) !
[mysql3 ~]# kill -9 $(pidof mysqld)
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
190 / 192
MySQL Router (4)
Nowwe can point the application to the router:
[mysql1 ~]# run_app.sh mysql1
Check app and kill mysqld on mysql3 (the Primary Master R/Wnode) !
[mysql3 ~]# kill -9 $(pidof mysqld)
mysql> select member_host as "primary" from performance_schema.global_status
join performance_schema.replication_group_members
where variable_name = 'group_replication_primary_member'
and member_id=variable_value;
+---------+
| primary |
+---------+
| mysql4 |
+---------+
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
191 / 192
Thank you !
Questions ?
Copyright @ 2016 Oracle and/or its affiliates. All rights reserved.
192 / 192

More Related Content

What's hot

Fine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceFine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceVitor Oliveira
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10Kenny Gryp
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017Frederic Descamps
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesKenny Gryp
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationFrederic Descamps
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureKenny Gryp
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMatt Lord
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreSujatha Sivakumar
 
OSS4B: Installing & Managing MySQL like a real devops
OSS4B: Installing & Managing MySQL like a real devopsOSS4B: Installing & Managing MySQL like a real devops
OSS4B: Installing & Managing MySQL like a real devopsFrederic Descamps
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterContinuent
 
MySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVMySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVKenny Gryp
 
Oracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cOracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cTrivadis
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialKenny Gryp
 
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsPedro Gomes
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Yury Velikanov
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterKenny Gryp
 
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)Olivier DASINI
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationKenny Gryp
 
MySQL Replication Performance in the Cloud
MySQL Replication Performance in the CloudMySQL Replication Performance in the Cloud
MySQL Replication Performance in the CloudVitor Oliveira
 

What's hot (20)

Fine-tuning Group Replication for Performance
Fine-tuning Group Replication for PerformanceFine-tuning Group Replication for Performance
Fine-tuning Group Replication for Performance
 
MySQL Database Architectures - 2020-10
MySQL Database Architectures -  2020-10MySQL Database Architectures -  2020-10
MySQL Database Architectures - 2020-10
 
Boston meetup : MySQL Innodb Cluster - May 1st 2017
Boston meetup : MySQL Innodb Cluster - May 1st  2017Boston meetup : MySQL Innodb Cluster - May 1st  2017
Boston meetup : MySQL Innodb Cluster - May 1st 2017
 
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best PracticesMySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
MySQL InnoDB Cluster - New Features in 8.0 Releases - Best Practices
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 BangaloreMySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
MySQL InnoDB Cluster and Group Replication - OSI 2017 Bangalore
 
OSS4B: Installing & Managing MySQL like a real devops
OSS4B: Installing & Managing MySQL like a real devopsOSS4B: Installing & Managing MySQL like a real devops
OSS4B: Installing & Managing MySQL like a real devops
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
 
MySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRVMySQL Connectors 8.0.19 & DNS SRV
MySQL Connectors 8.0.19 & DNS SRV
 
Oracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cOracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12c
 
MySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - TutorialMySQL InnoDB Cluster / ReplicaSet - Tutorial
MySQL InnoDB Cluster / ReplicaSet - Tutorial
 
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
 
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & ClusterMySQL Database Architectures - InnoDB ReplicaSet & Cluster
MySQL Database Architectures - InnoDB ReplicaSet & Cluster
 
MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)MySQL 5.7 InnoDB Cluster (Jan 2018)
MySQL 5.7 InnoDB Cluster (Jan 2018)
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
MySQL Replication Performance in the Cloud
MySQL Replication Performance in the CloudMySQL Replication Performance in the Cloud
MySQL Replication Performance in the Cloud
 

Viewers also liked

Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Frederic Descamps
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMatt Lord
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMario Beck
 
Haute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationHaute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationFrederic Descamps
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationUlf Wendel
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...Frederic Descamps
 
devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016Frederic Descamps
 
Webinar manage MySQL like a devops sysadmin
Webinar manage MySQL like a devops sysadminWebinar manage MySQL like a devops sysadmin
Webinar manage MySQL like a devops sysadminFrederic Descamps
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)Seungmin Yu
 
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeurs
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeursMySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeurs
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeursFrederic Descamps
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreAlfranio Júnior
 
Jeudis du Libre - MySQL InnoDB Cluster
Jeudis du Libre - MySQL InnoDB ClusterJeudis du Libre - MySQL InnoDB Cluster
Jeudis du Libre - MySQL InnoDB ClusterFrederic Descamps
 
Jeudis du Libre - MySQL comme Document Store
Jeudis du Libre - MySQL comme Document StoreJeudis du Libre - MySQL comme Document Store
Jeudis du Libre - MySQL comme Document StoreFrederic Descamps
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesShivji Kumar Jha
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group ReplicationBogdan Kecman
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationShivji Kumar Jha
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniquesGiuseppe Maxia
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminFrederic Descamps
 
Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016Frederic Descamps
 
Percon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshellPercon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshellFrederic Descamps
 

Viewers also liked (20)

Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
Inexpensive Datamasking for MySQL with ProxySQL - data anonymization for deve...
 
MySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB ClustersMySQL High Availability -- InnoDB Clusters
MySQL High Availability -- InnoDB Clusters
 
MySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB ClusterMySQL InnoDB Cluster and NDB Cluster
MySQL InnoDB Cluster and NDB Cluster
 
Haute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplicationHaute disponibilité my sql avec group réplication
Haute disponibilité my sql avec group réplication
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
 
devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016devops Days Belgium Ghent 2016
devops Days Belgium Ghent 2016
 
Webinar manage MySQL like a devops sysadmin
Webinar manage MySQL like a devops sysadminWebinar manage MySQL like a devops sysadmin
Webinar manage MySQL like a devops sysadmin
 
MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)MySQL InnoDB Cluster 미리보기 (remote cluster test)
MySQL InnoDB Cluster 미리보기 (remote cluster test)
 
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeurs
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeursMySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeurs
MySQL 5.7 & JSON - Nouvelles opportunités pour les dévelopeurs
 
Group Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication CoreGroup Replication: A Journey to the Group Communication Core
Group Replication: A Journey to the Group Communication Core
 
Jeudis du Libre - MySQL InnoDB Cluster
Jeudis du Libre - MySQL InnoDB ClusterJeudis du Libre - MySQL InnoDB Cluster
Jeudis du Libre - MySQL InnoDB Cluster
 
Jeudis du Libre - MySQL comme Document Store
Jeudis du Libre - MySQL comme Document StoreJeudis du Libre - MySQL comme Document Store
Jeudis du Libre - MySQL comme Document Store
 
MySQL High Availability with Replication New Features
MySQL High Availability with Replication New FeaturesMySQL High Availability with Replication New Features
MySQL High Availability with Replication New Features
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
FOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group ReplicationFOSSASIA 2015: MySQL Group Replication
FOSSASIA 2015: MySQL Group Replication
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
 
Pluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadminPluk2011 deploy-mysql-like-a-devops-sysadmin
Pluk2011 deploy-mysql-like-a-devops-sysadmin
 
Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016Advanced percona xtra db cluster in a nutshell... la suite plsc2016
Advanced percona xtra db cluster in a nutshell... la suite plsc2016
 
Percon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshellPercon XtraDB Cluster in a nutshell
Percon XtraDB Cluster in a nutshell
 

Similar to MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster

MySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a NutshellMySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a NutshellFrederic Descamps
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...Frederic Descamps
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorialFrederic Descamps
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on LabMySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on LabFrederic Descamps
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...Frederic Descamps
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterFrederic Descamps
 
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
Oracle Open World 2018 / Code One  : MySQL 8.0 High Availability with MySQL I...Oracle Open World 2018 / Code One  : MySQL 8.0 High Availability with MySQL I...
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...Frederic Descamps
 
DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !Frederic Descamps
 
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialMySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialFrederic Descamps
 
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!Frederic Descamps
 
Swedish MySQL User Group - MySQL InnoDB Cluster
Swedish MySQL User Group - MySQL InnoDB ClusterSwedish MySQL User Group - MySQL InnoDB Cluster
Swedish MySQL User Group - MySQL InnoDB ClusterFrederic Descamps
 
Helsinki MySQL User Group - MySQL InnoDB Cluster
Helsinki MySQL User Group - MySQL InnoDB ClusterHelsinki MySQL User Group - MySQL InnoDB Cluster
Helsinki MySQL User Group - MySQL InnoDB ClusterFrederic Descamps
 
How to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL ShellHow to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL ShellFrederic Descamps
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsFrederic Descamps
 
Mysql repos testing.odp
Mysql repos testing.odpMysql repos testing.odp
Mysql repos testing.odpRamana Yeruva
 
MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08Kenny Gryp
 
MySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMiguel Araújo
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1Ivan Ma
 

Similar to MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster (20)

MySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a NutshellMySQL InnoDB Cluster and Group Replication in a Nutshell
MySQL InnoDB Cluster and Group Replication in a Nutshell
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial ...
 
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorialMySQL InnoDB Cluster and Group Replication in a nutshell  hands-on tutorial
MySQL InnoDB Cluster and Group Replication in a nutshell hands-on tutorial
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on LabMySQL InnoDB Cluster in a Nutshell - Hands-on Lab
MySQL InnoDB Cluster in a Nutshell - Hands-on Lab
 
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...DataOpsbarcelona 2019:  Deep dive into MySQL Group Replication... the magic e...
DataOpsbarcelona 2019: Deep dive into MySQL Group Replication... the magic e...
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
Oracle Open World 2018 / Code One  : MySQL 8.0 High Availability with MySQL I...Oracle Open World 2018 / Code One  : MySQL 8.0 High Availability with MySQL I...
Oracle Open World 2018 / Code One : MySQL 8.0 High Availability with MySQL I...
 
DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !DataOps Barcelona - MySQL HA so easy... that's insane !
DataOps Barcelona - MySQL HA so easy... that's insane !
 
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest TutorialMySQL 8.0 InnoDB Cluster - Easiest Tutorial
MySQL 8.0 InnoDB Cluster - Easiest Tutorial
 
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!MySQL Innovation Day Chicago  - MySQL HA So Easy : That's insane !!
MySQL Innovation Day Chicago - MySQL HA So Easy : That's insane !!
 
Swedish MySQL User Group - MySQL InnoDB Cluster
Swedish MySQL User Group - MySQL InnoDB ClusterSwedish MySQL User Group - MySQL InnoDB Cluster
Swedish MySQL User Group - MySQL InnoDB Cluster
 
Helsinki MySQL User Group - MySQL InnoDB Cluster
Helsinki MySQL User Group - MySQL InnoDB ClusterHelsinki MySQL User Group - MySQL InnoDB Cluster
Helsinki MySQL User Group - MySQL InnoDB Cluster
 
How to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL ShellHow to operate MySQL InnoDB Cluster with MySQL Shell
How to operate MySQL InnoDB Cluster with MySQL Shell
 
MySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & OperationsMySQL InnoDB Cluster - Advanced Configuration & Operations
MySQL InnoDB Cluster - Advanced Configuration & Operations
 
Mysql repos testing.odp
Mysql repos testing.odpMysql repos testing.odp
Mysql repos testing.odp
 
MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08MySQL Database Architectures - 2022-08
MySQL Database Architectures - 2022-08
 
MySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB ClustersMySQL 8 High Availability with InnoDB Clusters
MySQL 8 High Availability with InnoDB Clusters
 
20191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv120191001 bkk-secret-of inno-db_clusterv1
20191001 bkk-secret-of inno-db_clusterv1
 

More from Frederic Descamps

MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...Frederic Descamps
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionFrederic Descamps
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsFrederic Descamps
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfFrederic Descamps
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8Frederic Descamps
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022Frederic Descamps
 
Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodeFrederic Descamps
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesFrederic Descamps
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemFrederic Descamps
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsFrederic Descamps
 
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Pi Day 2022 -  from IoT to MySQL HeatWave Database ServicePi Day 2022 -  from IoT to MySQL HeatWave Database Service
Pi Day 2022 - from IoT to MySQL HeatWave Database ServiceFrederic Descamps
 
Confoo 2022 - le cycle d'une instance MySQL
Confoo 2022  - le cycle d'une instance MySQLConfoo 2022  - le cycle d'une instance MySQL
Confoo 2022 - le cycle d'une instance MySQLFrederic Descamps
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...Frederic Descamps
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Frederic Descamps
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Frederic Descamps
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021Frederic Descamps
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDSFrederic Descamps
 

More from Frederic Descamps (20)

MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
MySQL Innovation & Cloud Day - Document Store avec MySQL HeatWave Database Se...
 
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code ExtensionMySQL Day Roma - MySQL Shell and Visual Studio Code Extension
MySQL Day Roma - MySQL Shell and Visual Studio Code Extension
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
 
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdfRivieraJUG - MySQL 8.0 - What's new for developers.pdf
RivieraJUG - MySQL 8.0 - What's new for developers.pdf
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
 
Percona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio CodePercona Live 2022 - MySQL Shell for Visual Studio Code
Percona Live 2022 - MySQL Shell for Visual Studio Code
 
Percona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database SystemPercona Live 2022 - The Evolution of a MySQL Database System
Percona Live 2022 - The Evolution of a MySQL Database System
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
 
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database SystemLinuxFest Northwest 2022 - The Evolution of a MySQL Database System
LinuxFest Northwest 2022 - The Evolution of a MySQL Database System
 
Open Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and HistogramsOpen Source 101 2022 - MySQL Indexes and Histograms
Open Source 101 2022 - MySQL Indexes and Histograms
 
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
Pi Day 2022 -  from IoT to MySQL HeatWave Database ServicePi Day 2022 -  from IoT to MySQL HeatWave Database Service
Pi Day 2022 - from IoT to MySQL HeatWave Database Service
 
Confoo 2022 - le cycle d'une instance MySQL
Confoo 2022  - le cycle d'une instance MySQLConfoo 2022  - le cycle d'une instance MySQL
Confoo 2022 - le cycle d'une instance MySQL
 
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...FOSDEM 2022 MySQL Devroom:  MySQL 8.0 - Logical Backups, Snapshots and Point-...
FOSDEM 2022 MySQL Devroom: MySQL 8.0 - Logical Backups, Snapshots and Point-...
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0Les nouveautés de MySQL 8.0
Les nouveautés de MySQL 8.0
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
 

Recently uploaded

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 

Recently uploaded (20)

Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 

MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster

  • 2. MySQL Group Replication in a nutshell MySQL InnoDB Cluster: hands-on tutorial   Percona Live Amsterdam- October 2016   Frédéric Descamps - MySQL Community Manager - Oracle Kenny Gryp - MySQL Practice Manager - Percona 2 / 192
  • 3.   Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purpose only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. The development, release and timing of any features or functionality described for Oracle's product remains at the sole discretion of Oracle. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 3 / 192
  • 4. about.me/lefred Who are we ? Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 4 / 192
  • 6. Frédéric Descamps @lefred MySQL Evangelist Managing MySQL since 3.23 devops believer Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 6 / 192
  • 7. Kenny Gryp @gryp MySQL Practice Manager Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 7 / 192
  • 8. get more at the conference MySQL Group Replication Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 8 / 192
  • 9. Other session MySQL Replication: Latest Developments LuìsSoares Tuesday 4 October 2016 3:10pmto 4:00pm- Zürich 1 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 9 / 192
  • 11. Agenda Prepare your workstation Group Replication concepts Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 11 / 192
  • 12. Agenda Prepare your workstation Group Replication concepts Migration fromMaster-Slave to GR Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 12 / 192
  • 13. Agenda Prepare your workstation Group Replication concepts Migration fromMaster-Slave to GR Howto monitor ? Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 13 / 192
  • 14. Agenda Prepare your workstation Group Replication concepts Migration fromMaster-Slave to GR Howto monitor ? Application interaction Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 14 / 192
  • 16. Setup your workstation Install VirtualBox 5 On the USB key, there is a file called PLAM16_GR.ova, please copy it on your laptop and doubleclick on it Start all virtual machines (mysql1, mysql2, mysql3 &mysql4) Install putty if you are using Windows Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 16 / 192
  • 17. Setup your workstation Install VirtualBox 5 On the USB key, there is a file called PLAM16_GR.ova, please copy it on your laptop and doubleclick on it Start all virtual machines (mysql1, mysql2, mysql3 &mysql4) Install putty if you are using Windows Try to connect to all VM's fromyour terminal or putty (rootpasswordisX): ssh -p 8821 root@127.0.0.1 to mysql1 ssh -p 8822 root@127.0.0.1 to mysql2 ssh -p 8823 root@127.0.0.1 to mysql3 ssh -p 8824 root@127.0.0.1 to mysql4 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 17 / 192
  • 19. launch run_app.sh on mysql1 into a screen session verify that mysql2 is a running slave LAB1: Current situation Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 19 / 192
  • 20. Summary   +--------+----------+--------------+-----------------+ | | ROLE | SSH PORT | INTERNAL IP | +--------+----------+--------------+-----------------+ | | | | | | mysql1 | master | 8821 | 192.168.56.11 | | | | | | | mysql2 | slave | 8822 | 192.168.56.12 | | | | | | | mysql3 | n/a | 8823 | 192.168.56.13 | | | | | | | mysql4 | n/a | 8824 | 192.168.56.14 | | | | | | +--------+----------+--------------+-----------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 20 / 192
  • 21. the magic explained Group Replication Concept Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 21 / 192
  • 22. Group Replication : what is it ? Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 22 / 192
  • 23. Group Replication : what is it ? MySQL Group Replication is one of the major components of MySQL InnoDB Cluster Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 23 / 192
  • 24. Group Replication : what is it ? MySQL Group Replication is one of the major components of MySQL InnoDB Cluster   Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 24 / 192
  • 27. Group replication is a plugin ! Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 27 / 192
  • 28. 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. 28 / 192
  • 29. Group replication is a plugin ! GR is a plugin for MySQL, made by MySQL and packaged with MySQL GR is an implementation of Replicated Database State Machine theory MySQL Group Communication System(GCS) is based on Paxos Mencius Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 29 / 192
  • 30. Group replication is a plugin ! GR is a plugin for MySQL, made by MySQL and packaged with MySQL GR is an implementation of Replicated Database State Machine theory MySQL Group Communication System(GCS) is based on Paxos Mencius Provides virtually synchronous replication for MySQL 5.7+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 30 / 192
  • 31. Group replication is a plugin ! GR is a plugin for MySQL, made by MySQL and packaged with MySQL GR is an implementation of Replicated Database State Machine theory MySQL Group Communication System(GCS) is based on Paxos Mencius Provides 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. 31 / 192
  • 33. Group Replication : how does it work ? Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 33 / 192
  • 34. Group Replication : how does it work ? A node (member of the group) sends the changes (binlog events) made by a transaction to the group through the GCS. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 34 / 192
  • 35. Group Replication : how does it work ? A node (member of the group) sends the changes (binlog events) made by a transaction to the group through the GCS. All members consume the writeset and certify it, no need to wait for all members, ack by the majority is enough. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 35 / 192
  • 36. Group Replication : how does it work ? A node (member of the group) sends the changes (binlog events) made by a transaction to the group through the GCS. All members consume the writeset and certify it, no need to wait for all members, ack by the majority is enough. If passed it is applied, if failed, transaction is rolled back on originating server and discarded at other servers. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 36 / 192
  • 37. OK... but how does it work ?! Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 37 / 192
  • 38. OK... but how does it work ?! It's just magic ! Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 38 / 192
  • 39. OK... but how does it work ?! It's just magic ! ... no, the writeset replication is synchronous and then certification and applying of the changes happen locally on each node and is asynchronous. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 39 / 192
  • 40. OK... but how does it work ?! It's just magic ! ... no, the writeset replication is synchronous and then certification and applying of the changes happen locally on each node and is asynchronous. not that easy to understand... right ? Let's illustrate this... Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 40 / 192
  • 41. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 41 / 192
  • 42. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 42 / 192
  • 43. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 43 / 192
  • 44. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 44 / 192
  • 45. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 45 / 192
  • 46. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 46 / 192
  • 47. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 47 / 192
  • 48. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 48 / 192
  • 49. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 49 / 192
  • 50. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 50 / 192
  • 51. MySQL Group Replication (autocommit) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 51 / 192
  • 52. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 52 / 192
  • 53. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 53 / 192
  • 54. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 54 / 192
  • 55. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 55 / 192
  • 56. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 56 / 192
  • 57. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 57 / 192
  • 58. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 58 / 192
  • 59. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 59 / 192
  • 60. MySQL Group Replication (full transaction) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 60 / 192
  • 61. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 61 / 192
  • 62. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 62 / 192
  • 63. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 63 / 192
  • 64. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 64 / 192
  • 65. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 65 / 192
  • 66. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 66 / 192
  • 67. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 67 / 192
  • 68. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 68 / 192
  • 69. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 69 / 192
  • 70. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 70 / 192
  • 71. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 71 / 192
  • 72. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 72 / 192
  • 73. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 73 / 192
  • 74. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 74 / 192
  • 75. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 75 / 192
  • 76. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 76 / 192
  • 77. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 77 / 192
  • 78. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 78 / 192
  • 79. Group Replication : Total Order Delivery - GTID Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 79 / 192
  • 80. Group Replication : Optimistic Locking Group Replication uses optimistic locking during a transaction, local (InnoDB) locking happens optimistically assumes there will be no conflicts across nodes (no communication between nodes necessary) cluster-wide conflict resolution happens only at COMMIT, during certification Let's first have a look at the traditional locking to compare. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 80 / 192
  • 93. Optimistic Locking The systemreturns error 149 as certification failed: ERROR 1180 (HY000): Got error 149 during COMMIT Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 93 / 192
  • 94. Group Replication : requirements exclusively works with InnoDB tables only Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 94 / 192
  • 95. Group Replication : requirements exclusively works with InnoDB tables only every tables must have a PK defined Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 95 / 192
  • 96. Group Replication : requirements exclusively works with InnoDB tables only every tables must have a PK defined only IPV4 is supported Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 96 / 192
  • 97. Group Replication : requirements exclusively works with InnoDB tables only every tables must have a PK defined only IPV4 is supported a good network with lowlatency is important Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 97 / 192
  • 98. Group Replication : requirements exclusively works with InnoDB tables only every tables must have a PK defined only IPV4 is supported a good network with lowlatency is important maximumof 9 members per group Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 98 / 192
  • 99. Group Replication : requirements exclusively works with InnoDB tables only every tables must have a PK defined only IPV4 is supported a good network with lowlatency is important maximumof 9 members per group log-bin must be enabled and only ROWformat is supported Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 99 / 192
  • 100. Group Replication : requirements (2) enable GTIDs Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 100 / 192
  • 101. Group Replication : requirements (2) enable GTIDs replication meta-data must be stored on systemtables --master-info-repository=TABLE --relay-log-info-repository=TABLE Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 101 / 192
  • 102. Group Replication : requirements (2) enable GTIDs replication meta-data must be stored on systemtables --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. 102 / 192
  • 103. Group Replication : requirements (2) enable GTIDs replication meta-data must be stored on systemtables --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. 103 / 192
  • 104. Group Replication : limitations There are also some technical limitations: Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 104 / 192
  • 105. Group Replication : limitations There are also some technical limitations: binlog checksumis not supported --binlog-checksum=NONE Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 105 / 192
  • 106. Group Replication : limitations There are also some technical limitations: binlog checksumis not supported --binlog-checksum=NONE Savepoints are not supported Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 106 / 192
  • 107. Group Replication : limitations There are also some technical limitations: binlog checksumis not supported --binlog-checksum=NONE Savepoints are not supported SERIALIZABLEis not supported as transaction isolation level Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 107 / 192
  • 108. Group Replication : limitations There are also some technical limitations: binlog checksumis not supported --binlog-checksum=NONE Savepoints are not supported SERIALIZABLEis not supported as transaction isolation level an object cannot be changed concurrently at different servers by two operations, where one of themis a DDL and the other is either a DML or DDL. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 108 / 192
  • 109. Is my workload ready for Group Replication ? As the writesets (transactions) are replicated to all available nodes on commit, and as they are certified on every node, a very large writeset could increase the amount of certification errors. Additionally, changing the same record on all the nodes (hotspot) concurrently will also cause problems. And finally, the certification uses the primary key of the tables, a table without PK is also a problem. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 109 / 192
  • 110. Is my workload ready for Group Replication ? Therefore, when using Group Replication, we should pay attention to these points: PK is mandatory (and a good one is better) avoid large transactions avoid hotspot Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 110 / 192
  • 111. ready ? Migration from Master-Slave to GR Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 111 / 192
  • 113. 1) We install and setup MySQL InnoDB Cluster on one of the newservers The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 113 / 192
  • 114. 2) We restore a backup 3) setup asynchronous replication on the new server. The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 114 / 192
  • 115. 4) We add a new instance to our group The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 115 / 192
  • 116. 5) We point the application to one of our newnodes. 6) We wait and check that asynchronous replication is caught up 7) we stop those asynchronous slaves The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 116 / 192
  • 117. 8) We attach the mysql2 slave to the group The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 117 / 192
  • 118. 9) Use MySQL Router for directing traffic The plan Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 118 / 192
  • 119. MySQL InnoDB Cluster fromLabs is already installed on mysql3. Let's take a backup on mysql1: [mysql1 ~]# xtrabackup --backup --target-dir=/tmp/backup --user=root --password=X --host=127.0.0.1 [mysql1 ~]# xtrabackup --prepare --target-dir=/tmp/backup LAB2: Prepare mysql3 Asynchronousslave 119 / 192
  • 120. LAB2: Prepare mysql3 (2) Asynchronousslave Copy the backup frommysql1 to mysql3: [mysql1 ~]# scp -r /tmp/backup mysql3:/tmp And restore it: [mysql3 ~]# xtrabackup --copy-back --target-dir=/tmp/backup [mysql3 ~]# chown -R mysql. /var/lib/mysql 120 / 192
  • 121. LAB3: mysql3 as asynchronous slave (2) Asynchronousslave Configure /etc/my.cnf: [mysqld] ... server_id=3 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 121 / 192
  • 122. LAB2: Prepare mysql3 (3) Asynchronousslave Let's start MySQL on mysql3: [mysql3 ~]# systemctl start mysqld Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 122 / 192
  • 123. find the GTIDs purged change MASTER set the purged GTIDs start replication LAB3: mysql3 as asynchronous slave (1)   Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 123 / 192
  • 124. LAB3: mysql3 as asynchronous slave (2) Find the latest purged GTIDs: [mysql3 ~]# cat /tmp/backup/xtrabackup_binlog_info mysql-bin.000002 167646328 b346474c-8601-11e6-9b39-08002718d305:1-771 Connect to mysql3 and setup replication: mysql> CHANGE MASTER TO MASTER_HOST="mysql1", MASTER_USER="repl_async", MASTER_PASSWORD='Xslave', MASTER_AUTO_POSITION=1; mysql> RESET MASTER; mysql> SET global gtid_purged="VALUE FOUND PREVIOUSLY"; mysql> START SLAVE; Check that you receive the application's traffic 124 / 192
  • 125. Disclamer ! The following commands to manage and use MySQL InnoDB Cluster are compatible with MySQL InnoDB Cluster 5.7.15 Previewfromlabs. Functions may change in future releases. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 125 / 192
  • 126. LAB4: MySQL InnoDB Cluster Createasingleinstancecluster Time to use the newMySQL Shell ! [mysql3 ~]# mysqlsh Let's verify if our server is ready to become a member of a newcluster: mysql-js> dba.validateInstance('root@mysql3:3306') Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 126 / 192
  • 127. LAB4: configuration settings (2) mysql3's my.cnf Configure /etc/my.cnf: [mysqld] ... server_id=3 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates binlog_checksum = none master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 127 / 192
  • 128. LAB4: configuration settings (2) mysql3's my.cnf Configure /etc/my.cnf: [mysqld] ... server_id=3 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates binlog_checksum = none master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 [mysql3 ~]# systemctl restart mysqld Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 128 / 192
  • 129. LAB4: MySQL InnoDB Cluster (3) Createasingleinstancecluster [mysql3 ~]# mysqlsh Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 129 / 192
  • 130. LAB4: MySQL InnoDB Cluster (3) Createasingleinstancecluster [mysql3 ~]# mysqlsh mysql-js> dba.validateInstance('root@mysql3:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.createCluster('plam') The KEY is the only credential we need to remember to manage our cluster. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 130 / 192
  • 131. LAB4: MySQL InnoDB Cluster (3) Createasingleinstancecluster [mysql3 ~]# mysqlsh mysql-js> dba.validateInstance('root@mysql3:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.createCluster('plam') The KEY is the only credential we need to remember to manage our cluster. mysql-js> cluster.status() Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 131 / 192
  • 132. Cluster Status mysql-js> cluster.status() { "clusterName": "plam", "defaultReplicaSet": { "status": "Cluster is NOT tolerant to any failures.", "topology": { "mysql3:3306": { "address": "mysql3:3306", "status": "ONLINE", "role": "HA", "mode": "R/W", "leaves": {} } } } } Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 132 / 192
  • 133. Add mysql4 to the Group: restore the backup set the purged GTIDs use MySQL shell LAB5: add mysql4 to the cluster (1)   Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 133 / 192
  • 134. LAB5: add mysql4 to the cluster (2) Copy the backup frommysql1 to mysql4: [mysql1 ~]# scp -r /tmp/backup mysql4:/tmp And restore it: [mysql4 ~]# xtrabackup --copy-back --target-dir=/tmp/backup [mysql4 ~]# chown -R mysql. /var/lib/mysql Start MySQL on mysql4: [mysql4 ~]# systemctl start mysqld 134 / 192
  • 135. LAB5: MySQL shell to add an instance (3) [mysql4 ~]# mysqlsh Let's verify the config: mysql-js> dba.validateInstance('root@mysql4:3306') Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 135 / 192
  • 136. LAB5: MySQL shell to add an instance (4) Configure /etc/my.cnf: [mysqld] ... server_id=4 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates binlog_checksum = none master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 136 / 192
  • 137. LAB5: MySQL shell to add an instance (4) Configure /etc/my.cnf: [mysqld] ... server_id=4 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates binlog_checksum = none master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 [mysql4 ~]# systemctl restart mysqld Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 137 / 192
  • 138. LAB5: MySQL InnoDB Cluster (4) Groupof2instances Find the latest purged GTIDs: [mysql4 ~]# cat /tmp/backup/xtrabackup_binlog_info mysql-bin.000002 167646328 b346474c-8601-11e6-9b39-08002718d305:1-77177 Connect to mysql4 and set GTID_PURGED [mysql4 ~]# mysqlsh mysql-js> c root@mysql4:3306 mysql-js> sql mysql-sql> RESET MASTER; mysql-sql> SET global gtid_purged="VALUE FOUND PREVIOUSLY"; 138 / 192
  • 139. LAB5: MySQL InnoDB Cluster (5) mysql-sql> js mysql-js> dba.validateInstance('root@mysql4:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.getCluster('plam') mysql-js> cluster.addInstance("root@mysql4:3306") mysql-js> cluster.status() Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 139 / 192
  • 140. Cluster Status mysql-js> cluster.status() { "clusterName": "plam", "defaultReplicaSet": { "status": "Cluster is NOT tolerant to any failures.", "topology": { "mysql3:3306": { "address": "mysql3:3306", "status": "ONLINE", "role": "HA", "mode": "R/W", "leaves": { "mysql4:3306": { "address": "mysql4:3306", "status": "RECOVERING", "role": "HA", "mode": "R/O", "leaves": {} } } } } } } Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 140 / 192
  • 141. Recovering progress On standard MySQL, monitor the group_replication_recovery channel to see the progress: mysql> show slave status for channel 'group_replication_recovery'G *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: mysql3 Master_User: mysql_innodb_cluster_rpl_user ... Slave_IO_Running: Yes Slave_SQL_Running: Yes ... Retrieved_Gtid_Set: 6e7d7848-860f-11e6-92e4-08002718d305:1-6, 7c1f0c2d-860d-11e6-9df7-08002718d305:1-15, b346474c-8601-11e6-9b39-08002718d305:1964-77177, e8c524df-860d-11e6-9df7-08002718d305:1-2 Executed_Gtid_Set: 7c1f0c2d-860d-11e6-9df7-08002718d305:1-7, b346474c-8601-11e6-9b39-08002718d305:1-45408, e8c524df-860d-11e6-9df7-08002718d305:1-2 ... Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 141 / 192
  • 142. point the application to the cluster Migrate the application Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 142 / 192
  • 143. LAB6: Migrate the application Nowwe need to point the application to mysql3, this is the only downtime ! ... [ 21257s] threads: 4, tps: 12.00, reads: 167.94, writes: 47.98, response time: 18 [ 21258s] threads: 4, tps: 6.00, reads: 83.96, writes: 23.99, response time: 14 [ 21259s] threads: 4, tps: 7.00, reads: 98.05, writes: 28.01, response time: 16 [ 31250s] threads: 4, tps: 8.00, reads: 111.95, writes: 31.99, response time: 30 [ 31251s] threads: 4, tps: 11.00, reads: 154.01, writes: 44.00, response time: 13 [ 31252s] threads: 4, tps: 11.00, reads: 153.94, writes: 43.98, response time: 12 [ 31253s] threads: 4, tps: 10.01, reads: 140.07, writes: 40.02, response time: 17 ^C [mysql1 ~]# run_app.sh mysql3 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 143 / 192
  • 144. LAB6: Migrate the application Make sure replication is running properly on mysql2 and mysql3. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 144 / 192
  • 145. LAB6: Migrate the application Make sure replication is running properly on mysql2 and mysql3. ************************** 1. row *************************** ... Master_Host: mysql1 Slave_IO_Running: Yes Slave_SQL_Running: No ... Last_SQL_Errno: 3100 Last_SQL_Error: Error in Xid_log_event: Commit could not be completed, 'Error on observer while running replication hook 'before_commit'.' Replicate_Ignore_Server_Ids: Master_Server_Id: 1 Master_UUID: 8fbcd944-8760-11e6-9b4e-08002718d305 ... Last_SQL_Error_Timestamp: 160930 23:04:07 Retrieved_Gtid_Set: 8fbcd944-8760-11e6-9b4e-08002718d305:360-3704 Executed_Gtid_Set: 0b31b4f3-8762-11e6-bb35-08002718d305:1-7, 30212757-8762-11e6-ad73-08002718d305:1-2, 8fbcd944-8760-11e6-9b4e-08002718d305:1-2652 Auto_Position: 1 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 145 / 192
  • 146. LAB6: Migrate the application Fix replication if necessary: mysql3> start slave; mysql3> show slave status; Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 146 / 192
  • 147. LAB6: Migrate the application Fix replication if necessary: mysql3> start slave; mysql3> show slave status; Stop asynchronous replication on mysql2 and mysql3: mysql2> stop slave; mysql3> stop slave; Make sure gtid_executed range on mysql2 is lower or equal than on mysql3 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 147 / 192
  • 148. LAB6: Migrate the application Fix replication if necessary: mysql3> start slave; mysql3> show slave status; Stop asynchronous replication on mysql2 and mysql3: mysql2> stop slave; mysql3> stop slave; Make sure gtid_executed range on mysql2 is lower or equal than on mysql3 mysql2> set global super_read_only=off;# http://bugs.mysql.com/bug.php?id=83234 mysql2> reset slave all; mysql3> reset slave all; Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 148 / 192
  • 149. previous slave (mysql2) can now be part of the cluster Add a third instance Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 149 / 192
  • 150. LAB7: Add mysql2 to the group We first validate the instance using MySQL shell and we modify the configuration. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 150 / 192
  • 151. LAB7: Add mysql2 to the group We first validate the instance using MySQL shell and we modify the configuration. [mysqld] ... super_read_only=0 server_id=2 binlog_checksum = none enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 151 / 192
  • 152. LAB7: Add mysql2 to the group We first validate the instance using MySQL shell and we modify the configuration. [mysqld] ... super_read_only=0 server_id=2 binlog_checksum = none enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates master_info_repository = TABLE relay_log_info_repository = TABLE transaction_write_set_extraction = XXHASH64 [mysql2 ~]# systemctl restart mysqld Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 152 / 192
  • 153. LAB7: Add mysql2 to the group (2) Back in MySQL shell we add the newinstance: [mysql2 ~]# mysqlsh Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 153 / 192
  • 154. LAB7: Add mysql2 to the group (2) Back in MySQL shell we add the newinstance: [mysql2 ~]# mysqlsh mysql-js> dba.validateInstance('root@mysql2:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.getCluster('plam') mysql-js> cluster.addInstance("root@mysql2:3306") mysql-js> cluster.status() Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 154 / 192
  • 155. LAB7: Add mysql2 to the group (3) { "clusterName": "plam", "defaultReplicaSet": { "status": "Cluster tolerant to up to ONE failure.", "topology": { "mysql3:3306": { "address": "mysql3:3306", "status": "ONLINE", "role": "HA", "mode": "R/W", "leaves": { "mysql4:3306": { "address": "mysql4:3306", "status": "ONLINE", "role": "HA", "mode": "R/O", "leaves": {} }, "mysql2:3306": { "address": "mysql2:3306", "status": "ONLINE", "role": "HA", "mode": "R/O", "leaves": {} } } Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 155 / 192
  • 157. writing to a single server Single Primary Mode Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 157 / 192
  • 158. Default = Single Primary Mode By default, MySQL InnoDB Cluster enables Single Primary Mode. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 158 / 192
  • 159. Default = Single Primary Mode By default, MySQL InnoDB Cluster enables Single Primary Mode. mysql> show global variables like 'group_replication_single_primary_mode'; +---------------------------------------+-------+ | Variable_name | Value | +---------------------------------------+-------+ | group_replication_single_primary_mode | ON | +---------------------------------------+-------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 159 / 192
  • 160. Default = Single Primary Mode By default, MySQL InnoDB Cluster enables Single Primary Mode. mysql> show global variables like 'group_replication_single_primary_mode'; +---------------------------------------+-------+ | Variable_name | Value | +---------------------------------------+-------+ | group_replication_single_primary_mode | ON | +---------------------------------------+-------+ In Single Primary Mode, a single member acts as the writable master (PRIMARY) and the rest of the members act as hot-standbys (SECONDARY). The group itself coordinates and configures itself automatically to determine which member will act as the PRIMARY, through a leader election mechanism. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 160 / 192
  • 161. Who's the Primary Master ? As the Primary Master is elected, all nodes part of the group knows which one was elected. This value is exposed in status variables: Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 161 / 192
  • 162. Who's the Primary Master ? As the Primary Master is elected, all nodes part of the group knows which one was elected. This value is exposed in status variables: mysql> show status like 'group_replication_primary_member'; +----------------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------------+--------------------------------------+ | group_replication_primary_member | 28a4e51f-860e-11e6-bdc4-08002718d305 | +----------------------------------+--------------------------------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 162 / 192
  • 163. Who's the Primary Master ? As the Primary Master is elected, all nodes part of the group knows which one was elected. This value is exposed in status variables: mysql> show status like 'group_replication_primary_member'; +----------------------------------+--------------------------------------+ | Variable_name | Value | +----------------------------------+--------------------------------------+ | group_replication_primary_member | 28a4e51f-860e-11e6-bdc4-08002718d305 | +----------------------------------+--------------------------------------+ mysql> select member_host as "primary master" from performance_schema.global_status join performance_schema.replication_group_members where variable_name = 'group_replication_primary_member' and member_id=variable_value; +---------------+ | primary master| +---------------+ | mysql3 | +---------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 163 / 192
  • 165. Performance Schema Group Replication uses Performance_Schema to expose status mysql3> SELECT * FROM performance_schema.replication_group_membersG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b MEMBER_HOST: mysql3.localdomain MEMBER_PORT: 3306 MEMBER_STATE: ONLINE Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 165 / 192
  • 166. Performance Schema Group Replication uses Performance_Schema to expose status mysql3> SELECT * FROM performance_schema.replication_group_membersG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b MEMBER_HOST: mysql3.localdomain MEMBER_PORT: 3306 MEMBER_STATE: ONLINE mysql3> SELECT * FROM performance_schema.replication_connection_statusG *************************** 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-2 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 166 / 192
  • 167. Member State These are the different possible state for a node member: ONLINE OFFLINE RECOVERING ERROR: when a node is leaving but the plugin was not instructed to stop UNREACHABLE Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 167 / 192
  • 168. Status information & metrics Members mysql> SELECT * FROM performance_schema.replication_group_membersG Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 168 / 192
  • 169. Status information & metrics Members mysql> SELECT * FROM performance_schema.replication_group_membersG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier MEMBER_ID: 00db47c7-3e23-11e6-afd4-08002774c31b MEMBER_HOST: mysql3.localdomain MEMBER_PORT: 3306 MEMBER_STATE: ONLINE *************************** 2. row *************************** CHANNEL_NAME: group_replication_applier MEMBER_ID: e1544c9d-4451-11e6-9f5a-08002774c31b MEMBER_HOST: mysql4.localdomain.localdomain MEMBER_PORT: 3306 MEMBER_STATE: ONLINE Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 169 / 192
  • 170. Status information & metrics Connections mysql> SELECT * FROM performance_schema.replication_connection_statusG Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 170 / 192
  • 171. Status information & metrics Connections mysql> SELECT * FROM performance_schema.replication_connection_statusG *************************** 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: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089, afb80f36-2bff-11e6-84e0-0800277dd3bf:1-2834 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00 *************************** 2. row *************************** CHANNEL_NAME: group_replication_recovery GROUP_NAME: SOURCE_UUID: THREAD_ID: NULL SERVICE_STATE: OFF Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 171 / 192
  • 172. Status information & metrics Local node status mysql> select * from performance_schema.replication_group_member_statsG Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 172 / 192
  • 173. Status information & metrics Local node status mysql> select * from performance_schema.replication_group_member_statsG *************************** 1. row *************************** CHANNEL_NAME: group_replication_applier VIEW_ID: 14679667214442885:4 MEMBER_ID: e1544c9d-4451-11e6-9f5a-08002774c31b COUNT_TRANSACTIONS_IN_QUEUE: 0 COUNT_TRANSACTIONS_CHECKED: 5961 COUNT_CONFLICTS_DETECTED: 0 COUNT_TRANSACTIONS_ROWS_VALIDATING: 0 TRANSACTIONS_COMMITTED_ALL_MEMBERS: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089, afb80f36-2bff-11e6-84e0-0800277dd3bf:1-5718 LAST_CONFLICT_FREE_TRANSACTION: afb80f36-2bff-11e6-84e0-0800277dd3bf:5718 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 173 / 192
  • 174. Performance_Schema You can find GR information in the following Performance_Schema tables: replication_applier_con guration replication_applier_status replication_applier_status_by_worker replication_connection_con guration replication_connection_status replication_group_member_stats replication_group_members Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 174 / 192
  • 175. Status during recovery mysql> SHOW SLAVE STATUS FOR CHANNEL 'group_replication_recovery'G Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 175 / 192
  • 176. Status during recovery mysql> SHOW SLAVE STATUS FOR CHANNEL 'group_replication_recovery'G *************************** 1. row *************************** Slave_IO_State: Master_Host: <NULL> Master_User: gr_repl Master_Port: 0 ... Relay_Log_File: mysql4-relay-bin-group_replication_recovery.000001 ... Slave_IO_Running: No Slave_SQL_Running: No ... Executed_Gtid_Set: 5de4400b-3dd7-11e6-8a71-08002774c31b:1-814089, afb80f36-2bff-11e6-84e0-0800277dd3bf:1-5718 ... Channel_Name: group_replication_recovery Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 176 / 192
  • 177. Sys Schema The easiest way to detect if a node is a member of the primary component (when there are partitioning of your nodes due to network issues for example) and therefore a valid candidate for routing queries to it, is to use the sys table. Additional information for sys can be downloaded at https://github.com/lefred/mysql_gr_routing_check/blob/master/addition_to_sys.sql On the primary node: [mysql3 ~]# mysql < /tmp/gr_addition_to_sys.sql Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 177 / 192
  • 178. Sys Schema Is this node part of PRIMARY Partition: mysql3> SELECT sys.gr_member_in_primary_partition(); +------------------------------------+ | sys.gr_node_in_primary_partition() | +------------------------------------+ | YES | +------------------------------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 178 / 192
  • 179. Sys Schema Is this node part of PRIMARY Partition: mysql3> SELECT sys.gr_member_in_primary_partition(); +------------------------------------+ | sys.gr_node_in_primary_partition() | +------------------------------------+ | YES | +------------------------------------+ To use as healthcheck: mysql3> SELECT * FROM sys.gr_member_routing_candidate_status; +------------------+-----------+---------------------+----------------------+ | viable_candidate | read_only | transactions_behind | transactions_to_cert | +------------------+-----------+---------------------+----------------------+ | YES | YES | 0 | 0 | +------------------+-----------+---------------------+----------------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 179 / 192
  • 180. Sys Schema - Heath Check On one of the non Primary nodes, run the following command: mysql-sql> ush tables with read lock; Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 180 / 192
  • 181. Sys Schema - Heath Check On one of the non Primary nodes, run the following command: mysql-sql> ush tables with read lock; Nowyou can verify what the healthcheck exposes to you: mysql-sql> SELECT * FROM sys.gr_member_routing_candidate_status; +------------------+-----------+---------------------+----------------------+ | viable_candidate | read_only | transactions_behind | transactions_to_cert | +------------------+-----------+---------------------+----------------------+ | YES | YES | 950 | 0 | +------------------+-----------+---------------------+----------------------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 181 / 192
  • 182. Sys Schema - Heath Check On one of the non Primary nodes, run the following command: mysql-sql> ush tables with read lock; Nowyou can verify what the healthcheck exposes to you: mysql-sql> SELECT * FROM sys.gr_member_routing_candidate_status; +------------------+-----------+---------------------+----------------------+ | viable_candidate | read_only | transactions_behind | transactions_to_cert | +------------------+-----------+---------------------+----------------------+ | YES | YES | 950 | 0 | +------------------+-----------+---------------------+----------------------+ mysql-sql> UNLOCK tables; Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 182 / 192
  • 184. MySQL Router We will nowuse mysqlrouter between our application and the cluster. Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 184 / 192
  • 185. MySQL Router (2) Configure MySQL Router (bootstrap it using an instance): [mysql2 ~]# mysqlrouter --bootstrap mysql2:3306 Please enter the administrative MASTER key for the MySQL InnoDB cluster: MySQL Router has now been con gured for the InnoDB cluster 'plam'. The following connection information can be used to connect to the cluster. Classic MySQL protocol connections to cluster 'plam': - Read/Write Connections: localhost:6446 - Read/Only Connections: localhost:6447 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 185 / 192
  • 186. MySQL Router (3) Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to port 3306: [mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 186 / 192
  • 187. MySQL Router (3) Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to port 3306: [mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/ [routing:default_rw] -bind_port=6446 +bind_port=3306 +bind_address=mysql1 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 187 / 192
  • 188. MySQL Router (3) Nowlet's copy the configuration to mysql1 (our app server) and modify it to listen to port 3306: [mysql2 ~]# scp /etc/mysqlrouter/mysqlrouter.conf mysql1:/etc/mysqlrouter/ [routing:default_rw] -bind_port=6446 +bind_port=3306 +bind_address=mysql1 We can stop mysqld on mysql1 and start mysqlrouter into a screen session: [mysql1 ~]# systemctl stop mysqld [mysql1 ~]# mysqlrouter Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 188 / 192
  • 189. MySQL Router (4) Nowwe can point the application to the router: [mysql1 ~]# run_app.sh mysql1 Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 189 / 192
  • 190. MySQL Router (4) Nowwe can point the application to the router: [mysql1 ~]# run_app.sh mysql1 Check app and kill mysqld on mysql3 (the Primary Master R/Wnode) ! [mysql3 ~]# kill -9 $(pidof mysqld) Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 190 / 192
  • 191. MySQL Router (4) Nowwe can point the application to the router: [mysql1 ~]# run_app.sh mysql1 Check app and kill mysqld on mysql3 (the Primary Master R/Wnode) ! [mysql3 ~]# kill -9 $(pidof mysqld) mysql> select member_host as "primary" from performance_schema.global_status join performance_schema.replication_group_members where variable_name = 'group_replication_primary_member' and member_id=variable_value; +---------+ | primary | +---------+ | mysql4 | +---------+ Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 191 / 192
  • 192. Thank you ! Questions ? Copyright @ 2016 Oracle and/or its affiliates. All rights reserved. 192 / 192