Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
1 / 168
2 / 168
 
Safe Harbor Statement
The following is intended to outline our generalproduct direction. It isintended for
information purpose only, and may not be incorporated into any contract. It isnot a
commitment to deliver any material, code, or functionality, and should not be relied up in
making purchasing decisions. Thedevelopment, release and timing of any features or
functionality described for Oracle´s product remains at thesole discretion of Oracle.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
3 / 168
Who I am ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
4 / 168
Frédéric Descamps
@lefred
MySQLEvangelist
ManagingMySQLsince 3.23
devops believer
http://about.me/lefred
 
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
5 / 168
get more online
MySQL Group Replication
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
6 / 168
Blogs
http://lefred.be/
http://mysqlhighavailability.com/
https://thesubtlepath.com/blog/mysql/
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
7 / 168
Agenda
MySQLInnoDB Cluster & Group Replication concepts
Migration from Master-Slave to GR
How to monitor ?
Application interaction
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
8 / 168
LAB1: Current situation
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
9 / 168
launch
run_app.sh
onmysql1 into
a screen
session
verify that
mysql2 is a
running slave
LAB1: Current situation
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
10 / 168
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
11 / 168
Easy High Availability
MySQL InnoDB Cluster
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
12 / 168
InnoDB
cluster
Ease-of-Use
ExtremeScale-Out
Out-of-BoxSolution
Built-inHA
HighP erformance
EverythingIntegr ated
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
13 / 168
Our vision in 4 steps
MySQLDocumentStore
Relational&DocumentModels
MySQLHA
Out-Of-BoxHA
ReadScale-Out
AsyncReplication+A utoFailover
WriteScale-Out
Sharding
E1 E3
E2 E4
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
14 / 168
Step 2´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
InnoDB
cluster
Application
MySQLConnector
MySQLRouter
Mp
M
M
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
15 / 168
Step 3´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
InnoDB
cluster
Application
MySQLConnector
MySQLRouter
Mp
M
M
S1 S2 S3 S4 S...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
16 / 168
Step 4´s Architecture
Application
MySQLConnector
MySQLRouter
MySQLShell
Application
MySQLConnector
MySQLRouter
InnoDB
cluster
Mp
M
M
S2 S3 S4 S...S1
InnoDB
cluster
Mp
M
M
S1 S2 S3 S4 S...
InnoDB
cluster
Mp
M
M
S1 S2 S3 S4 S...
Application
MySQLConnector
MySQLRouter
Application
MySQLConnector
MySQLRouter
Application
MySQLConnector
MySQLRouter
replicaset1
replicaset2
replicaset3
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
17 / 168
the magic explained
Group Replication Concept
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
18 / 168
Group Replication: heart of MySQL InnoDB
Cluster
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
19 / 168
Group Replication: heart of MySQL InnoDB
Cluster
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
20 / 168
MySQL Group Replication
but what is it ?!?
GR is a plugin forMySQL, made byMySQLand packaged withMySQL
GR is an implementation of Replicated Database State Machine theory
GR allows to write on all Group Members (cluster nodes) simultaneously while
retaining consistency
GR implements conflict detection and resolution
GR allows automatic distributed recovery
Supported onallMySQLplatforms!!
Linux, Windows, Solaris, OSX,FreeBSD
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
21 / 168
MySQL Group Communication System (GCS)
MySQLXcom protocol
Replicated Database State Machine
Paxos based protocol (similarto Mencius)
Its task: Deliver messages accross thedistributed system:
Atomically
in Total Order
MySQLGroup Replication receives theOrdered 'tickets' from thisGCS subsystem.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
22 / 168
And for users ?
not longer necessary to handle server fail-over manually or with a complicated script
GR provides fault tolerance
GR enables update-everywhere setups
GR handles crashes, failures, re-connects automatically
Allows an easy setup of a highly available MySQLservice!
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
23 / 168
OK, but how does it work ?
it´s just ...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
24 / 168
OK, but how does it work ?
it´s just ...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
25 / 168
OK, but how does it work ?
it´s just ...
... no, in fact the writeset replication issynchronousand then certification and apply of
the changes are local to each nodes and happen asynchronous.
not that easy to understand... right ? As a picture isworth a 1000words, let´s illustrate
this...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
26 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
27 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
28 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
29 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
30 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
31 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
32 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
33 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
34 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
35 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
36 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
37 / 168
MySQLGroup Replication (autocommit)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
38 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
39 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
40 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
41 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
42 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
43 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
44 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
45 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
46 / 168
MySQLGroup Replication (full transaction)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
47 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
48 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
49 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
50 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
51 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
52 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
53 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
54 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
55 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
56 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
57 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
58 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
59 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
60 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
61 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
62 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
63 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
64 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
65 / 168
Group Replication : Total Order Delivery - GTID
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
66 / 168
Group Replication: return commit
Asynchronous Replication:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
67 / 168
Group Replication: return from commit (2)
Semi-Sync Replication:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
68 / 168
Group Replication: return from commit (3)
Group Replication:
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
69 / 168
Group Replication : Optimistic Locking
Group Replication uses optimistic locking
during a transaction,local (InnoDB) lockinghappens
optimistically assumesthere will be no conflicts across nodes
(no communication between nodes necessary)
cluster-wide conflict resolution happens only at COMMIT, duringcertification
Let´s first have a look at the traditional locking to compare.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
70 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
71 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
72 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
73 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
74 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
75 / 168
Traditional locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
76 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
77 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
78 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
79 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
80 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
81 / 168
Optimistic Locking
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
82 / 168
Optimistic Locking
The system returns error 149 ascertification failed:
ERROR 1180 (HY000): Got error 149 during COMMIT
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
83 / 168
Certification
Certification is the process that only needs to answer thefollowing unique question:
can the write (transaction) beapplied?
based on unapplied earlier transactions
such conflicts must come forother members/nodes
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
84 / 168
Certification (2)
certification is a deterministic operation
certification individually happens on every member/node
communication with other members isnot needed for certification
pass: enter in the apply queue
fail: drop the transaction
serialized by the total order in GCS/Xcom + GTID
first committer wins rule
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
85 / 168
Drawbacks of optimistic locking
having a first-committer-wins system means conflicts will more likely happen with:
large transactions
long running transactions
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
86 / 168
GTID
GTIDs are the same as those used by asynchronous replication.
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: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57,
f037578b-46b1-11e6-8005-08002774c31b:1-48937
LAST_ERROR_NUMBER: 0
LAST_ERROR_MESSAGE:
LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
87 / 168
GTID
but transactions use the Group´s GTID
mysql> show master statusG
************************** 1. row ***************************
File: mysql4-bin.000001
Position: 1501
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57,
f037578b-46b1-11e6-8005-08002774c31b:1-48937
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
88 / 168
Requirements
exclusively works with InnoDBtables
every table must have a PK defined
only IPV4 is supported
a good network with low latency isimportant
maximum of 9 members per group
log-bin must be enabled and onlybinlog_format=ROW is supported
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
89 / 168
Requirements (2)
enable GTIDs
replication meta-data must bestored insystem tables
--master-info-repository=TABLE
--relay-log-info-repository=TABLE
writesets extraction must be enabled TODO: I need to check on 5.7.19 and 8.0.1
--transaction-write-set-extraction=XXHASH64
log-slave-updates must alsobe enabled
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
90 / 168
Limitations
binlog checksum is not supported
--binlog-checksum=NONE
savepointswere not supported before 5.7.19& 8.0.1
SERIALIZABLEis not supported as transaction isolation level
http://lefred.be/content/mysql-group-replication-limitations-savepoints/
http://lefred.be/content/mysql-group-replication-and-table-design/
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
91 / 168
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 theamount of
certification errors.
Additionally, changing the samerecord on all thenodes (hotspot) concurrently will also
cause problems.
And finally, the certification uses theprimarykey of thetables, a table without PK isalso
a problem.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
92 / 168
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 isbetter)
avoid large transactions
avoid hotspot
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
93 / 168
ready ?
Migration from Master-Slave to GR
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
94 / 168
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
95 / 168
1) We install and
setupMySQLInnoDB
Clusteron one of the
new servers
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
96 / 168
2) We restore a
backup
3) setup
asynchronous
replication on the new
server.
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
97 / 168
4) We add a new
instance to our group
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
98 / 168
5) We point the
application to one of
our new nodes.
6) We wait and check
that asynchronous
replication is caught
up
7) we stop those
asynchronous slaves
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
99 / 168
8) We attach the
mysql2 slave to the
group
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
100 / 168
9) Use MySQL Router
for directing traffic
The plan
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
101 / 168
LatestMySQL5.7is already installed on
mysql3.
Let´s take a backup onmysql1 usingmeb:
[mysql1 ~]# mysqlbackup 
--host=127.0.0.1 
--backup-dir=/tmp/backup 
--user=root --password=X 
backup-and-apply-log
LAB2: Prepare mysql3
Asynchronous slave
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
102 / 168
LAB2: Prepare mysql3 (2)
Asynchronous slave
Copy the backup frommysql1 to mysql3:
[mysql1 ~]# scp -r /tmp/backup mysql3:/tmp
And restore it:
[mysql3 ~]# mysqlbackup --backup-dir=/tmp/backup --force copy-back
[mysql3 ~]# rm /var/lib/mysql/mysql*-bin* # just some cleanup
[mysql3 ~]# chown -R mysql. /var/lib/mysql
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
103 / 168
LAB3: mysql3 as asynchronous slave (2)
Asynchronous slave
Configure /etc/my.cnf with the minimal requirements:
[mysqld]
...
server_id=3
enforce_gtid_consistency = on
gtid_mode = on
log_bin
log_slave_updates
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
104 / 168
LAB2: Prepare mysql3 (3)
Asynchronous slave
Let´s startMySQLonmysql3:
[mysql3 ~]# systemctl start mysqld
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
105 / 168
find the GTIDs purged
change MASTER
set the purged GTIDs
start replication
LAB3: mysql3 as asynchronous slave (1)
 
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
106 / 168
LAB3: mysql3 as asynchronous slave (2)
Find the latest purged GTIDs:
[mysql3 ~]# cat /tmp/backup/meta/backup_gtid_executed.sql
SET @@GLOBAL.GTID_PURGED='33351000-3fe8-11e7-80b3-08002718d305:1-1002';
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
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
107 / 168
Administration made easy and more...
MySQL-Shell
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
108 / 168
MySQL Shell
TheMySQLShell is an interactive Javascript, Python, or SQLinterface supporting
development and administration for theMySQLServer and is acomponent of theMySQL
Server. You can use theMySQLShell to perform data queriesand updates aswell as
various administration operations.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
109 / 168
MySQL Shell (2)
TheMySQLShell provides:
Both Interactive and Batch operations
Document and Relational Models
CRUD Document and Relational APIs via scripting
Traditional Table, JSON, Tab Separated output results formats
MySQLStandard and X Protocols
and more...
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
110 / 168
LAB4: MySQL InnoDB Cluster
Create a single instance cluster
Time to use the newMySQLShell !
[mysql3 ~]# mysqlsh
Let´s verify if our server is ready to becomea member of a newcluster:
mysql-js> dba.checkInstanceCon guration('root@mysql3:3306')
Change the configuration !
mysql-js> dba.con gureLocalInstance()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
111 / 168
LAB4: MySQL InnoDB Cluster (2)
Restart mysqld to use the new configuration:
[mysql3 ~]# systemctl restart mysqld
Create a single instance cluster
[mysql3 ~]# mysqlsh
mysql-js> dba.checkInstanceCon guration('root@mysql3:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.createCluster('MyInnoDBCluster')
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
112 / 168
LAB4: Cluster Status
mysql-js> cluster.status()
{
"clusterName": "MyInnoDBCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql3:3306",
"status": "OK_NO_TOLERANCE",
"statusText": "Cluster is NOT tolerant to any failures.",
"topology": {
"mysql3:3306": {
"address": "mysql3:3306",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
}
}
}
}
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
113 / 168
Addmysql4 to the Group:
restore the backup
set the purged GTIDs
useMySQLshell
LAB5: add mysql4 to the cluster (1)
 
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
114 / 168
LAB5: add mysql4 to the cluster (2)
Copy the backup frommysql1 to mysql4:
[mysql1 ~]# scp -r /tmp/backup mysql4:/tmp
And restore it:
[mysql4 ~]# mysqlbackup --backup-dir=/tmp/backup --force copy-back
[mysql4 ~]# rm /var/lib/mysql/mysql*-bin* # just some cleanup
[mysql4 ~]# chown -R mysql. /var/lib/mysql
StartMySQLonmysql4:
[mysql4 ~]# systemctl start mysqld
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
115 / 168
LAB5: MySQL shell to add an instance (3)
[mysql4 ~]# mysqlsh
Let´s verify the config:
mysql-js> dba.checkInstanceCon guration('root@mysql4:3306')
And change the configuration:
mysql-js> dba.con gureLocalInstance()
Restart the service to enablethechanges:
[mysql4 ~]# systemctl restart mysqld
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
116 / 168
LAB5: MySQL InnoDB Cluster (4)
Group of 2 instances
Find the latest purged GTIDs:
[mysql4 ~]# cat /tmp/backup/meta/backup_gtid_executed.sql
SET @@GLOBAL.GTID_PURGED='33351000-3fe8-11e7-80b3-08002718d305:1-1002';
...
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";
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
117 / 168
LAB5: MySQL InnoDB Cluster (5)
mysql-sql> js
mysql-js> dba.checkInstanceCon guration('root@mysql4:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.getCluster()
mysql-js> cluster.checkInstanceState('root@mysql4:3306')
mysql-js> cluster.addInstance("root@mysql4:3306")
mysql-js> cluster.status()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
118 / 168
Cluster Status
mysql-js> cluster.status()
{
"clusterName": "MyInnoDBCluster",
"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 @ 2017 Oracle and/or its affiliates. All rights reserved.
119 / 168
Recovering progress
On standard MySQL, monitor thegroup_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 @ 2017 Oracle and/or its affiliates. All rights reserved.
120 / 168
point the application
to the cluster
Migrate the application
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
121 / 168
LAB6: Migrate the application
Now we 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 @ 2017 Oracle and/or its affiliates. All rights reserved.
122 / 168
LAB6: Migrate the application
Stop asynchronous replicationon mysql2 andmysql3:
mysql2> stop slave;
mysql3> stop slave;
Make sure gtid_executed range onmysql2 is lower or equal than onmysql3
mysql[2-3]> show global variables like 'gtid_executed'G
mysql[2-3]> reset slave all;
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
123 / 168
previous slave
(mysql2) can now
be part of the cluster
Add a third instance
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
124 / 168
LAB7: Add mysql2 to the group
We first validate the instance using MySQLShell and we configure it.
[mysql2 ~]# mysqlsh
mysql-js> dba.checkInstanceCon guration('root@mysql2:3306')
mysql-js> dba.con gureLocalInstance()
We also need to remove super_read_onlyfrommy.cnf to be able to use the shell to add
the node to the cluster.
[mysql2 ~]# systemctl restart mysqld
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
125 / 168
LAB7: Add mysql2 to the group (2)
Back inMySQLshell we add the new instance:
[mysql2 ~]# mysqlsh
mysql-js> dba.checkInstanceCon guration('root@mysql2:3306')
mysql-js> c root@mysql3:3306
mysql-js> cluster = dba.getCluster()
mysql-js> cluster.addInstance("root@mysql2:3306")
mysql-js> cluster.status()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
126 / 168
LAB7: Add mysql2 to the group (3)
{
"clusterName": "MyInnoDBCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql3:3306",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"mysql2:3306": {
"address": "mysql2:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"mysql3:3306": {
"address": "mysql3:3306",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE"
},
"mysql4:3306": {
"address": "mysql4:3306",
"mode": "R/O",
"readReplicas": {},Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
127 / 168
writing to a single server
Single Primary Mode
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
128 / 168
Default = Single Primary Mode
By default, MySQLInnoDBClusterenablesSingle Primary Mode.
mysql> show global variables like 'group_replication_single_primary_mode';
+---------------------------------------+-------+
| Variable_name | Value |
+---------------------------------------+-------+
| group_replication_single_primary_mode | ON |
+---------------------------------------+-------+
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
129 / 168
Default = Single Primary Mode
By default, MySQLInnoDBClusterenablesSingle 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 asthewritable 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 thePRIMARY, through a leader election mechanism.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
130 / 168
Who´s the Primary Master ?
As the Primary Master is elected, all nodes partof thegroup knows which one was
elected. This value is exposed instatus 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 @ 2017 Oracle and/or its affiliates. All rights reserved.
131 / 168
Create a Multi-Primary Cluster:
It´s also possible to create a Multi-PrimaryCluster using theShell:
mysql-js> cluster=dba.createCluster('perconalive',{multiMaster: true})
A new InnoDB cluster will be created on instance 'root@mysql3:3306'.
The MySQL InnoDB cluster is going to be setup in advanced Multi-Master Mode.
Before continuing you have to con rm that you understand the requirements and
limitations of Multi-Master Mode. Please read the manual before proceeding.
I have read the MySQL InnoDB cluster manual and I understand the requirements
and limitations of advanced Multi-Master Mode.
Con rm [y|N]:
Or you can force it to avoid interaction (for automation) :
js> cluster=dba.createCluster('perconalive',{multiMaster: true, force: true})
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
132 / 168
get more info
Monitoring
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
133 / 168
Performance Schema
Group Replication usesPerformance_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:00
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
134 / 168
Member State
These are the different possible state for a node member:
ONLINE
OFFLINE
RECOVERING
ERROR: when a node is leaving but the plugin wasnot instructed to stop
UNREACHABLE
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
135 / 168
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
136 / 168
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
COUNT_RECEIVED_HEARTBEATS: 0Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
137 / 168
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
138 / 168
Performance_Schema
You can find GR information in thefollowing Performance_Schematables:
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
139 / 168
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
140 / 168
Sys Schema
The easiest way to detect if anode isa member of theprimarycomponent (when there
are partitioning of your nodes due to network issues for example) and therefore a valid
candidate for routing queriesto it, isto use thesys table.
Additional information forsys can be downloaded at
https://github.com/lefred/mysql_gr_routing_check/blob/master/addition_to_sys.sql
On the primary node:
[mysql? ~]# mysql < /tmp/addition_to_sys.sql
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
141 / 168
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 @ 2017 Oracle and/or its affiliates. All rights reserved.
142 / 168
LAB8: Sys Schema - Health Check
On one of the non Primary nodes, run thefollowing command:
mysql-sql> ush tables with read lock;
Now you 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 @ 2017 Oracle and/or its affiliates. All rights reserved.
143 / 168
application interaction
MySQL Router
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
144 / 168
MySQL Router
MySQLRouter is lightweight middleware that provides transparent routing between your
application and backendMySQLServers. It can be used for awide variety of use cases,
such as providing high availability and scalability by effectively routing database trafficto
appropriate backendMySQLServers.
MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically
(bootstrap) usingMySQLInnoDB Cluster´s metadata.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
145 / 168
LAB9: MySQL Router
We will now usemysqlrouter between our application and thecluster.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
146 / 168
LAB9: MySQL Router (2)
Configure MySQLRouter that will run on the app server (mysql1).We bootstrap it using
thePrimary-Master:
[root@mysql1 ~]# mysqlrouter --bootstrap mysql3:3306 --user mysqlrouter
Please enter MySQL password for root:
WARNING: The MySQL server does not have SSL con gured and metadata used by
the router may be transmitted unencrypted.
Bootstrapping system MySQL Router instance...
MySQL Router has now been con gured for the InnoDB cluster 'MyInnoDBCluster'.
The following connection information can be used to connect to the cluster.
Classic MySQL protocol connections to cluster 'MyInnoDBCluster':
- Read/Write Connections: localhost:6446
- Read/Only Connections: localhost:6447
X protocol connections to cluster 'MyInnoDBCluster':
- Read/Write Connections: localhost:64460
- Read/Only Connections: localhost:64470
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
147 / 168
LAB9: MySQL Router (3)
Now let´s modify the configuration file to listen on port 3306:
in/etc/mysqlrouter/mysqlrouter.conf:
[routing:MyInnoDBCluster_default_rw]
-bind_port=6446
+bind_port=3306
We can stopmysqld onmysql1 and startmysqlrouter into ascreensession:
[mysql1 ~]# systemctl stop mysqld
[mysql1 ~]# systemctl start mysqlrouter
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
148 / 168
LAB9: MySQL Router (4)
Before killing a member we will change systemd´s default behavior that restarts
mysqld immediately:
in/usr/lib/systemd/system/mysqld.service add the following under
[Service]
RestartSec=30
[mysql3 ~]# systemctl daemon-reload
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
149 / 168
LAB9: MySQL Router (5)
Now we can point the application to therouter (back to mysql1):
[mysql1 ~]# run_app.sh
Check app and killmysqld onmysql3(the Primary Master R/W node) !
[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 @ 2017 Oracle and/or its affiliates. All rights reserved.
150 / 168
ProxySQL / HA Proxy / F5 / ...
3rd party router/proxy
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
151 / 168
ProxySQLalso has native support for Group
Replication which makes it maybe thebest
choice for advanced users.
3rd party router/proxy
MySQLInnoDB Clustercan also work withthird party router / proxy.
If you need some specific features that are not yet available inMySQLRouter, like
transparent R/W splitting, then you canuse your software of choice.
The important part of such implementation isto use a good health check to verify if the
MySQLserver you plan to route the traffic isina valid state.
MySQLRouterimplements that natively, andit´s very easy to deploy.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
152 / 168
operational tasks
Recovering Node
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
153 / 168
Recovering Nodes/Members
The old master (mysql3) got killed.
MySQLgot restarted automatically by systemd
Let´s addmysql3 back to the clsuter
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
154 / 168
LAB10: Recovering Nodes/Members
[mysql3 ~]# mysqlsh
mysql-js> c root@mysql4:3306 # The current master
mysql-js> cluster = dba.getCluster()
mysql-js> cluster.status()
mysql-js> cluster.rejoinInstance("root@mysql3:3306")
Rejoining the instance to the InnoDB cluster. Depending on the original
problem that made the instance unavailable, the rejoin operation might not be
successful and further manual steps will be needed to x the underlying
problem.
Please monitor the output of the rejoin operation and take necessary action if
the instance cannot rejoin.
Please provide the password for 'root@mysql3:3306':
Rejoining instance to the cluster ...
The instance 'root@mysql3:3306' was successfully rejoined on the cluster.
The instance 'mysql3:3306' was successfully added to the MySQL Cluster.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
155 / 168
mysql-js> cluster.status()
{ "clusterName": "MyInnoDBCluster",
"defaultReplicaSet": {
"name": "default",
"primary": "mysql4:3306",
"status": "OK",
"statusText": "Cluster is ONLINE and can tolerate up to ONE failure.",
"topology": {
"mysql2:3306": {
"address": "mysql2:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE" },
"mysql3:3306": {
"address": "mysql3:3306",
"mode": "R/O",
"readReplicas": {},
"role": "HA",
"status": "ONLINE" },
"mysql4:3306": {
"address": "mysql4:3306",
"mode": "R/W",
"readReplicas": {},
"role": "HA",
"status": "ONLINE" }
}
}
}
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
156 / 168
Recovering Nodes/Members (automatically)
This time before killing a member of thegroup, we will persistthe configuration ondisk in
my.cnf.
We will use again the sameMySQLcommand as previously
dba.con gureLocalInstance() but this time when all nodes are already
part of the Group.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
157 / 168
LAB10: Recovering Nodes/Members (2)
Verify that all nodes are ONLINE.
...
mysql-js> cluster.status()
Then on all nodes run:
mysql-js> dba.con gureLocalInstance()
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
158 / 168
LAB10: Recovering Nodes/Members (3)
Kill one node again:
[mysql3 ~]# kill -9 $(pidof mysqld)
systemd will restartmysqld and verify if the node joined.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
159 / 168
understanding
Flow Control
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
160 / 168
Flow Control
When usingMySQLGroup Replication, it´s possible that somemembers are lagging behind
the group. Due to load, hardware limitation, etc... Thislagcan becomeproblematicto keep
good certification performance and keep the possible certification failures aslow as
possible.
More problems can occur in multi-primary/write clusters when theapplying queue grows,
the risk to have conflicts with those not yet applied transactions increases.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
161 / 168
Flow Control (2)
WithinMySQLGroup Replication´s FC implementation :
the Group is never totally stalled
the node having issues doesn´t send flow control messages to therest of thegroup
asking to slow down
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
162 / 168
Flow Control (3)
Every member of the Group send somestatistics about its queues (applier queue and
certification queue) to the other members.
Then every node decide to slow down or not if they realize that one node reached the
threshold for one of the queue:
group_replication_ ow_control_applier_threshold (default
is 25000)
group_replication_ ow_control_certi er_threshold
(default is 25000)
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
163 / 168
Flow Control (4)
So whengroup_replication_ ow_control_mode is set to QUOTA on the
node seeing that one of the other members of thecluster is lagging behind (threshold
reached), it will throttle the write operations to thetheminimumquota.
This quota is calculated basedon thenumber of transactions applied inthelast second,
and then it is reduced below that by subtracting the"over the quota"messages from the
last period.
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
164 / 168
LAB10: Flow Control
During this last lab, we will reduce theflow control threshold on the Primary Master:
mysql> show global variables like '% ow%';
+----------------------------------------------------+-------+
| Variable_name | Value |
+----------------------------------------------------+-------+
| group_replication_ ow_control_applier_threshold | 25000 |
| group_replication_ ow_control_certi er_threshold | 25000 |
| group_replication_ ow_control_mode | QUOTA |
+----------------------------------------------------+-------+
3 rows in set (0.08 sec)
mysql> set global group_replication_ ow_control_applier_threshold=100;
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
165 / 168
LAB10: Flow Control (1)
And now we block all writes onone of theSecondary-Masters:
mysql> ush tables with read lock;
And we check how the queueis growing:
mysql> SELECT * FROM sys.gr_member_routing_candidate_status;
+------------------+-----------+---------------------+----------------------+
| viable_candidate | read_only | transactions_behind | transactions_to_cert |
+------------------+-----------+---------------------+----------------------+
| YES | NO | 487 | 0 |
+------------------+-----------+---------------------+----------------------+
Did you notice something on theapplication when thethreshold was reached ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
166 / 168
LAB10: Flow Control (2)
If nothing happened, please increase thetrx rate:
[root@mysql1 ~]# run_app.sh mysql1 --tx-rate=500
When the application's writesare low, you canjust remove thelock and see thequeue and
the effect on theapplication:
mysql> UNLOCK TABLES;
Create flow control again and when you see theapplication writing just a few
transactions, on the Primary-Master, disable theflow control mode:
mysql> set global group_replication_ ow_control_mode='DISABLED';
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
167 / 168
Thank you !
Any Questions ?
Copyright @ 2017 Oracle and/or its affiliates. All rights reserved.
168 / 168

More Related Content

What's hot

Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
Introduction to MySQL Document Store
Introduction to MySQL Document StoreIntroduction to MySQL Document Store
Introduction to MySQL Document Store
Frederic Descamps
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
Frederic Descamps
 
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
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 Cluster
Frederic Descamps
 
MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!
Frederic 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 Cluster
Frederic Descamps
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
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
 
Why MySQL High Availability Matters
Why MySQL High Availability MattersWhy MySQL High Availability Matters
Why MySQL High Availability Matters
Matt Lord
 
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
Frederic Descamps
 
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
Frederic 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 Cluster
Continuent
 
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
Frederic Descamps
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
Ivan Ma
 
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
 
InnoDB Tablespace Encryption
InnoDB Tablespace Encryption InnoDB Tablespace Encryption
InnoDB Tablespace Encryption
Satya Bodapati
 
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
Frederic Descamps
 
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
Frederic Descamps
 

What's hot (20)

Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Introduction to MySQL Document Store
Introduction to MySQL Document StoreIntroduction to MySQL Document Store
Introduction to MySQL Document Store
 
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
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
 
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
 
MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!MySQL Document Store - when SQL & NoSQL live together... in peace!
MySQL Document Store - when SQL & NoSQL live together... in peace!
 
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
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
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...
 
Why MySQL High Availability Matters
Why MySQL High Availability MattersWhy MySQL High Availability Matters
Why MySQL High Availability Matters
 
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
 
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
MySQL Document Store - How to replace a NoSQL database by MySQL without effor...
 
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 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
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
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)
 
InnoDB Tablespace Encryption
InnoDB Tablespace Encryption InnoDB Tablespace Encryption
InnoDB Tablespace Encryption
 
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
DataOps barcelona - MySQL 8.0 document store: NoSQL with all the benefits of ...
 
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...FOSDEM MySQL & Friends Devroom, February 2018  MySQL Point-in-Time Recovery l...
FOSDEM MySQL & Friends Devroom, February 2018 MySQL Point-in-Time Recovery l...
 

Viewers also liked

Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
Sveta Smirnova
 
淘宝数据库架构演进历程
淘宝数据库架构演进历程淘宝数据库架构演进历程
淘宝数据库架构演进历程
zhaolinjnu
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
Mario Beck
 
MySQL Server Defaults
MySQL Server DefaultsMySQL Server Defaults
MySQL Server Defaults
Morgan Tocker
 
Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
Ronald Bradford
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
Kenny Gryp
 
MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirks
Colin Charles
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
Nuno Carvalho
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it Back
Sveta Smirnova
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
Kenny Gryp
 
High Availability Using MySQL Group Replication
High Availability Using MySQL Group ReplicationHigh Availability Using MySQL Group Replication
High Availability Using MySQL Group Replication
OSSCube
 
2010丹臣的思考
2010丹臣的思考2010丹臣的思考
2010丹臣的思考
zhaolinjnu
 
Load Data Fast!
Load Data Fast!Load Data Fast!
10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study
Ronald Bradford
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
Giuseppe Maxia
 
Эффективная отладка репликации MySQL
Эффективная отладка репликации MySQLЭффективная отладка репликации MySQL
Эффективная отладка репликации MySQL
Sveta Smirnova
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
Vitor Oliveira
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
Olivier DASINI
 
Redis介绍
Redis介绍Redis介绍
Redis介绍
zhaolinjnu
 
Mysql参数-GDB
Mysql参数-GDBMysql参数-GDB
Mysql参数-GDB
zhaolinjnu
 

Viewers also liked (20)

Lessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting ReplicationLessons Learned: Troubleshooting Replication
Lessons Learned: Troubleshooting Replication
 
淘宝数据库架构演进历程
淘宝数据库架构演进历程淘宝数据库架构演进历程
淘宝数据库架构演进历程
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
MySQL Server Defaults
MySQL Server DefaultsMySQL Server Defaults
MySQL Server Defaults
 
Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
MHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirksMHA (MySQL High Availability): Getting started & moving past quirks
MHA (MySQL High Availability): Getting started & moving past quirks
 
MySQL High Availability with Group Replication
MySQL High Availability with Group ReplicationMySQL High Availability with Group Replication
MySQL High Availability with Group Replication
 
Why MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it BackWhy MySQL Replication Fails, and How to Get it Back
Why MySQL Replication Fails, and How to Get it Back
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 
High Availability Using MySQL Group Replication
High Availability Using MySQL Group ReplicationHigh Availability Using MySQL Group Replication
High Availability Using MySQL Group Replication
 
2010丹臣的思考
2010丹臣的思考2010丹臣的思考
2010丹臣的思考
 
Load Data Fast!
Load Data Fast!Load Data Fast!
Load Data Fast!
 
10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study10x Performance Improvements - A Case Study
10x Performance Improvements - A Case Study
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
 
Эффективная отладка репликации MySQL
Эффективная отладка репликации MySQLЭффективная отладка репликации MySQL
Эффективная отладка репликации MySQL
 
MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!MySQL Replication Performance Tuning for Fun and Profit!
MySQL Replication Performance Tuning for Fun and Profit!
 
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQLMySQL InnoDB Cluster - A complete High Availability solution for MySQL
MySQL InnoDB Cluster - A complete High Availability solution for MySQL
 
Redis介绍
Redis介绍Redis介绍
Redis介绍
 
Mysql参数-GDB
Mysql参数-GDBMysql参数-GDB
Mysql参数-GDB
 

Similar to MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial with MySQL Enterprise Backup

MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
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 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
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
Oracle Developers
 
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
 
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
 
20190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev220190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev2
Ivan Ma
 
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaSOverpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
J On The Beach
 
Robust easy affordable disaster recovery for MySQL Data
Robust easy affordable disaster recovery for MySQL DataRobust easy affordable disaster recovery for MySQL Data
Robust easy affordable disaster recovery for MySQL Data
OracleMySQL
 
MySQL Innovation from 5.7 to 8.0
MySQL Innovation from 5.7 to 8.0MySQL Innovation from 5.7 to 8.0
MySQL Innovation from 5.7 to 8.0
Frederic Descamps
 
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
Miguel Araújo
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
 
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
Ivan Ma
 
MySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the CommunityMySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the Community
Frederic Descamps
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
Morgan Tocker
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
Matt Lord
 
MySQL 8
MySQL 8MySQL 8
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
Olivier DASINI
 
Move your Castle to the Cloud
Move your Castle to the CloudMove your Castle to the Cloud
Move your Castle to the Cloud
Blaine Carter
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
Connor McDonald
 

Similar to MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial with MySQL Enterprise Backup (20)

MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio  in a nutshell - MySQL InnoDB ClusterMySQL Group Replicatio  in a nutshell - MySQL InnoDB Cluster
MySQL Group Replicatio in a nutshell - MySQL InnoDB Cluster
 
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 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 !!
 
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish AbramsGraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
GraphPipe - Blazingly Fast Machine Learning Inference by Vish Abrams
 
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...
 
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...
 
20190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev220190615 hkos-mysql-troubleshootingandperformancev2
20190615 hkos-mysql-troubleshootingandperformancev2
 
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaSOverpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
Overpowered Kubernetes: CI/CD for K8s on Enterprise IaaS
 
Robust easy affordable disaster recovery for MySQL Data
Robust easy affordable disaster recovery for MySQL DataRobust easy affordable disaster recovery for MySQL Data
Robust easy affordable disaster recovery for MySQL Data
 
MySQL Innovation from 5.7 to 8.0
MySQL Innovation from 5.7 to 8.0MySQL Innovation from 5.7 to 8.0
MySQL Innovation from 5.7 to 8.0
 
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
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
 
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
 
MySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the CommunityMySQL Community Meetup in China : Innovation driven by the Community
MySQL Community Meetup in China : Innovation driven by the Community
 
MySQL NoSQL APIs
MySQL NoSQL APIsMySQL NoSQL APIs
MySQL NoSQL APIs
 
MySQL Group Replication - an Overview
MySQL Group Replication - an OverviewMySQL Group Replication - an Overview
MySQL Group Replication - an Overview
 
MySQL 8
MySQL 8MySQL 8
MySQL 8
 
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
MySQL Day Paris 2018 - Upgrade from MySQL 5.7 to MySQL 8.0
 
Move your Castle to the Cloud
Move your Castle to the CloudMove your Castle to the Cloud
Move your Castle to the Cloud
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
 

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 Extension
Frederic Descamps
 
RivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and HistogramsRivieraJUG - MySQL Indexes and Histograms
RivieraJUG - MySQL Indexes and Histograms
Frederic 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.pdf
Frederic Descamps
 
MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8MySQL User Group NL - MySQL 8
MySQL User Group NL - MySQL 8
Frederic Descamps
 
State of the Dolphin - May 2022
State of the Dolphin - May 2022State of the Dolphin - May 2022
State of the Dolphin - May 2022
Frederic 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 Code
Frederic 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 System
Frederic Descamps
 
Percona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL ArchitecturesPercona Live 2022 - MySQL Architectures
Percona Live 2022 - MySQL Architectures
Frederic 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 System
Frederic 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 Histograms
Frederic 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 Service
Frederic 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 MySQL
Frederic 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.0
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.0
Frederic Descamps
 
State of The Dolphin - May 2021
State of The Dolphin - May 2021State of The Dolphin - May 2021
State of The Dolphin - May 2021
Frederic Descamps
 
MySQL Shell for DBAs
MySQL Shell for DBAsMySQL Shell for DBAs
MySQL Shell for DBAs
Frederic Descamps
 
Deploying Magento on OCI with MDS
Deploying Magento on OCI with MDSDeploying Magento on OCI with MDS
Deploying Magento on OCI with MDS
Frederic Descamps
 
MySQL Router REST API
MySQL Router REST APIMySQL Router REST API
MySQL Router REST API
Frederic 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

@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
kantakumariji156
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Earley Information Science
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
5G bootcamp Sep 2020 (NPI initiative).pptx
5G bootcamp Sep 2020 (NPI initiative).pptx5G bootcamp Sep 2020 (NPI initiative).pptx
5G bootcamp Sep 2020 (NPI initiative).pptx
SATYENDRA100
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
Edge AI and Vision Alliance
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
Kief Morris
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
Stephanie Beckett
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
UiPathCommunity
 
Performance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy EvertsPerformance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy Everts
ScyllaDB
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
BookNet Canada
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsMYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
Linda Zhang
 

Recently uploaded (20)

@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...@Call @Girls Thiruvananthapuram  🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
@Call @Girls Thiruvananthapuram 🚒 XXXXXXXXXX 🚒 Priya Sharma Beautiful And Cu...
 
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design ApproachesKnowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
Knowledge and Prompt Engineering Part 2 Focus on Prompt Design Approaches
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
5G bootcamp Sep 2020 (NPI initiative).pptx
5G bootcamp Sep 2020 (NPI initiative).pptx5G bootcamp Sep 2020 (NPI initiative).pptx
5G bootcamp Sep 2020 (NPI initiative).pptx
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
“Intel’s Approach to Operationalizing AI in the Manufacturing Sector,” a Pres...
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
[Talk] Moving Beyond Spaghetti Infrastructure [AOTB] 2024-07-04.pdf
 
What's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptxWhat's New in Copilot for Microsoft365 May 2024.pptx
What's New in Copilot for Microsoft365 May 2024.pptx
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
UiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs ConferenceUiPath Community Day Kraków: Devs4Devs Conference
UiPath Community Day Kraków: Devs4Devs Conference
 
Performance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy EvertsPerformance Budgets for the Real World by Tammy Everts
Performance Budgets for the Real World by Tammy Everts
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024Details of description part II: Describing images in practice - Tech Forum 2024
Details of description part II: Describing images in practice - Tech Forum 2024
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & SolutionsMYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
MYIR Product Brochure - A Global Provider of Embedded SOMs & Solutions
 

MySQL innodb cluster and Group Replication in a nutshell - hands-on tutorial with MySQL Enterprise Backup

  • 3.   Safe Harbor Statement The following is intended to outline our generalproduct direction. It isintended for information purpose only, and may not be incorporated into any contract. It isnot a commitment to deliver any material, code, or functionality, and should not be relied up in making purchasing decisions. Thedevelopment, release and timing of any features or functionality described for Oracle´s product remains at thesole discretion of Oracle. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 3 / 168
  • 4. Who I am ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 4 / 168
  • 5. Frédéric Descamps @lefred MySQLEvangelist ManagingMySQLsince 3.23 devops believer http://about.me/lefred   Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 5 / 168
  • 6. get more online MySQL Group Replication Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 6 / 168
  • 8. Agenda MySQLInnoDB Cluster & Group Replication concepts Migration from Master-Slave to GR How to monitor ? Application interaction Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 8 / 168
  • 9. LAB1: Current situation Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 9 / 168
  • 10. launch run_app.sh onmysql1 into a screen session verify that mysql2 is a running slave LAB1: Current situation Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 10 / 168
  • 11. 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 11 / 168
  • 12. Easy High Availability MySQL InnoDB Cluster Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 12 / 168
  • 14. Our vision in 4 steps MySQLDocumentStore Relational&DocumentModels MySQLHA Out-Of-BoxHA ReadScale-Out AsyncReplication+A utoFailover WriteScale-Out Sharding E1 E3 E2 E4 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 14 / 168
  • 16. Step 3´s Architecture Application MySQLConnector MySQLRouter MySQLShell InnoDB cluster Application MySQLConnector MySQLRouter Mp M M S1 S2 S3 S4 S... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 16 / 168
  • 17. Step 4´s Architecture Application MySQLConnector MySQLRouter MySQLShell Application MySQLConnector MySQLRouter InnoDB cluster Mp M M S2 S3 S4 S...S1 InnoDB cluster Mp M M S1 S2 S3 S4 S... InnoDB cluster Mp M M S1 S2 S3 S4 S... Application MySQLConnector MySQLRouter Application MySQLConnector MySQLRouter Application MySQLConnector MySQLRouter replicaset1 replicaset2 replicaset3 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 17 / 168
  • 18. the magic explained Group Replication Concept Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 18 / 168
  • 19. Group Replication: heart of MySQL InnoDB Cluster Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 19 / 168
  • 20. Group Replication: heart of MySQL InnoDB Cluster Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 20 / 168
  • 21. MySQL Group Replication but what is it ?!? GR is a plugin forMySQL, made byMySQLand packaged withMySQL GR is an implementation of Replicated Database State Machine theory GR allows to write on all Group Members (cluster nodes) simultaneously while retaining consistency GR implements conflict detection and resolution GR allows automatic distributed recovery Supported onallMySQLplatforms!! Linux, Windows, Solaris, OSX,FreeBSD Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 21 / 168
  • 22. MySQL Group Communication System (GCS) MySQLXcom protocol Replicated Database State Machine Paxos based protocol (similarto Mencius) Its task: Deliver messages accross thedistributed system: Atomically in Total Order MySQLGroup Replication receives theOrdered 'tickets' from thisGCS subsystem. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 22 / 168
  • 23. And for users ? not longer necessary to handle server fail-over manually or with a complicated script GR provides fault tolerance GR enables update-everywhere setups GR handles crashes, failures, re-connects automatically Allows an easy setup of a highly available MySQLservice! Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 23 / 168
  • 24. OK, but how does it work ? it´s just ... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 24 / 168
  • 25. OK, but how does it work ? it´s just ... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 25 / 168
  • 26. OK, but how does it work ? it´s just ... ... no, in fact the writeset replication issynchronousand then certification and apply of the changes are local to each nodes and happen asynchronous. not that easy to understand... right ? As a picture isworth a 1000words, let´s illustrate this... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 26 / 168
  • 27. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 27 / 168
  • 28. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 28 / 168
  • 29. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 29 / 168
  • 30. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 30 / 168
  • 31. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 31 / 168
  • 32. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 32 / 168
  • 33. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 33 / 168
  • 34. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 34 / 168
  • 35. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 35 / 168
  • 36. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 36 / 168
  • 37. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 37 / 168
  • 38. MySQLGroup Replication (autocommit) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 38 / 168
  • 39. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 39 / 168
  • 40. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 40 / 168
  • 41. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 41 / 168
  • 42. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 42 / 168
  • 43. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 43 / 168
  • 44. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 44 / 168
  • 45. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 45 / 168
  • 46. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 46 / 168
  • 47. MySQLGroup Replication (full transaction) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 47 / 168
  • 48. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 48 / 168
  • 49. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 49 / 168
  • 50. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 50 / 168
  • 51. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 51 / 168
  • 52. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 52 / 168
  • 53. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 53 / 168
  • 54. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 54 / 168
  • 55. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 55 / 168
  • 56. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 56 / 168
  • 57. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 57 / 168
  • 58. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 58 / 168
  • 59. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 59 / 168
  • 60. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 60 / 168
  • 61. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 61 / 168
  • 62. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 62 / 168
  • 63. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 63 / 168
  • 64. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 64 / 168
  • 65. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 65 / 168
  • 66. Group Replication : Total Order Delivery - GTID Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 66 / 168
  • 67. Group Replication: return commit Asynchronous Replication: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 67 / 168
  • 68. Group Replication: return from commit (2) Semi-Sync Replication: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 68 / 168
  • 69. Group Replication: return from commit (3) Group Replication: Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 69 / 168
  • 70. Group Replication : Optimistic Locking Group Replication uses optimistic locking during a transaction,local (InnoDB) lockinghappens optimistically assumesthere will be no conflicts across nodes (no communication between nodes necessary) cluster-wide conflict resolution happens only at COMMIT, duringcertification Let´s first have a look at the traditional locking to compare. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 70 / 168
  • 71. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 71 / 168
  • 72. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 72 / 168
  • 73. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 73 / 168
  • 74. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 74 / 168
  • 75. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 75 / 168
  • 76. Traditional locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 76 / 168
  • 77. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 77 / 168
  • 78. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 78 / 168
  • 79. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 79 / 168
  • 80. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 80 / 168
  • 81. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 81 / 168
  • 82. Optimistic Locking Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 82 / 168
  • 83. Optimistic Locking The system returns error 149 ascertification failed: ERROR 1180 (HY000): Got error 149 during COMMIT Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 83 / 168
  • 84. Certification Certification is the process that only needs to answer thefollowing unique question: can the write (transaction) beapplied? based on unapplied earlier transactions such conflicts must come forother members/nodes Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 84 / 168
  • 85. Certification (2) certification is a deterministic operation certification individually happens on every member/node communication with other members isnot needed for certification pass: enter in the apply queue fail: drop the transaction serialized by the total order in GCS/Xcom + GTID first committer wins rule Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 85 / 168
  • 86. Drawbacks of optimistic locking having a first-committer-wins system means conflicts will more likely happen with: large transactions long running transactions Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 86 / 168
  • 87. GTID GTIDs are the same as those used by asynchronous replication. 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: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937 LAST_ERROR_NUMBER: 0 LAST_ERROR_MESSAGE: LAST_ERROR_TIMESTAMP: 0000-00-00 00:00:00 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 87 / 168
  • 88. GTID but transactions use the Group´s GTID mysql> show master statusG ************************** 1. row *************************** File: mysql4-bin.000001 Position: 1501 Binlog_Do_DB: Binlog_Ignore_DB: Executed_Gtid_Set: afb80f36-2bff-11e6-84e0-0800277dd3bf:1-57, f037578b-46b1-11e6-8005-08002774c31b:1-48937 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 88 / 168
  • 89. Requirements exclusively works with InnoDBtables every table must have a PK defined only IPV4 is supported a good network with low latency isimportant maximum of 9 members per group log-bin must be enabled and onlybinlog_format=ROW is supported Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 89 / 168
  • 90. Requirements (2) enable GTIDs replication meta-data must bestored insystem tables --master-info-repository=TABLE --relay-log-info-repository=TABLE writesets extraction must be enabled TODO: I need to check on 5.7.19 and 8.0.1 --transaction-write-set-extraction=XXHASH64 log-slave-updates must alsobe enabled Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 90 / 168
  • 91. Limitations binlog checksum is not supported --binlog-checksum=NONE savepointswere not supported before 5.7.19& 8.0.1 SERIALIZABLEis not supported as transaction isolation level http://lefred.be/content/mysql-group-replication-limitations-savepoints/ http://lefred.be/content/mysql-group-replication-and-table-design/ Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 91 / 168
  • 92. 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 theamount of certification errors. Additionally, changing the samerecord on all thenodes (hotspot) concurrently will also cause problems. And finally, the certification uses theprimarykey of thetables, a table without PK isalso a problem. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 92 / 168
  • 93. 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 isbetter) avoid large transactions avoid hotspot Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 93 / 168
  • 94. ready ? Migration from Master-Slave to GR Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 94 / 168
  • 95. The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 95 / 168
  • 96. 1) We install and setupMySQLInnoDB Clusteron one of the new servers The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 96 / 168
  • 97. 2) We restore a backup 3) setup asynchronous replication on the new server. The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 97 / 168
  • 98. 4) We add a new instance to our group The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 98 / 168
  • 99. 5) We point the application to one of our new nodes. 6) We wait and check that asynchronous replication is caught up 7) we stop those asynchronous slaves The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 99 / 168
  • 100. 8) We attach the mysql2 slave to the group The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 100 / 168
  • 101. 9) Use MySQL Router for directing traffic The plan Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 101 / 168
  • 102. LatestMySQL5.7is already installed on mysql3. Let´s take a backup onmysql1 usingmeb: [mysql1 ~]# mysqlbackup --host=127.0.0.1 --backup-dir=/tmp/backup --user=root --password=X backup-and-apply-log LAB2: Prepare mysql3 Asynchronous slave Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 102 / 168
  • 103. LAB2: Prepare mysql3 (2) Asynchronous slave Copy the backup frommysql1 to mysql3: [mysql1 ~]# scp -r /tmp/backup mysql3:/tmp And restore it: [mysql3 ~]# mysqlbackup --backup-dir=/tmp/backup --force copy-back [mysql3 ~]# rm /var/lib/mysql/mysql*-bin* # just some cleanup [mysql3 ~]# chown -R mysql. /var/lib/mysql Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 103 / 168
  • 104. LAB3: mysql3 as asynchronous slave (2) Asynchronous slave Configure /etc/my.cnf with the minimal requirements: [mysqld] ... server_id=3 enforce_gtid_consistency = on gtid_mode = on log_bin log_slave_updates Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 104 / 168
  • 105. LAB2: Prepare mysql3 (3) Asynchronous slave Let´s startMySQLonmysql3: [mysql3 ~]# systemctl start mysqld Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 105 / 168
  • 106. find the GTIDs purged change MASTER set the purged GTIDs start replication LAB3: mysql3 as asynchronous slave (1)   Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 106 / 168
  • 107. LAB3: mysql3 as asynchronous slave (2) Find the latest purged GTIDs: [mysql3 ~]# cat /tmp/backup/meta/backup_gtid_executed.sql SET @@GLOBAL.GTID_PURGED='33351000-3fe8-11e7-80b3-08002718d305:1-1002'; 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 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 107 / 168
  • 108. Administration made easy and more... MySQL-Shell Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 108 / 168
  • 109. MySQL Shell TheMySQLShell is an interactive Javascript, Python, or SQLinterface supporting development and administration for theMySQLServer and is acomponent of theMySQL Server. You can use theMySQLShell to perform data queriesand updates aswell as various administration operations. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 109 / 168
  • 110. MySQL Shell (2) TheMySQLShell provides: Both Interactive and Batch operations Document and Relational Models CRUD Document and Relational APIs via scripting Traditional Table, JSON, Tab Separated output results formats MySQLStandard and X Protocols and more... Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 110 / 168
  • 111. LAB4: MySQL InnoDB Cluster Create a single instance cluster Time to use the newMySQLShell ! [mysql3 ~]# mysqlsh Let´s verify if our server is ready to becomea member of a newcluster: mysql-js> dba.checkInstanceCon guration('root@mysql3:3306') Change the configuration ! mysql-js> dba.con gureLocalInstance() Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 111 / 168
  • 112. LAB4: MySQL InnoDB Cluster (2) Restart mysqld to use the new configuration: [mysql3 ~]# systemctl restart mysqld Create a single instance cluster [mysql3 ~]# mysqlsh mysql-js> dba.checkInstanceCon guration('root@mysql3:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.createCluster('MyInnoDBCluster') Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 112 / 168
  • 113. LAB4: Cluster Status mysql-js> cluster.status() { "clusterName": "MyInnoDBCluster", "defaultReplicaSet": { "name": "default", "primary": "mysql3:3306", "status": "OK_NO_TOLERANCE", "statusText": "Cluster is NOT tolerant to any failures.", "topology": { "mysql3:3306": { "address": "mysql3:3306", "mode": "R/W", "readReplicas": {}, "role": "HA", "status": "ONLINE" } } } } Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 113 / 168
  • 114. Addmysql4 to the Group: restore the backup set the purged GTIDs useMySQLshell LAB5: add mysql4 to the cluster (1)   Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 114 / 168
  • 115. LAB5: add mysql4 to the cluster (2) Copy the backup frommysql1 to mysql4: [mysql1 ~]# scp -r /tmp/backup mysql4:/tmp And restore it: [mysql4 ~]# mysqlbackup --backup-dir=/tmp/backup --force copy-back [mysql4 ~]# rm /var/lib/mysql/mysql*-bin* # just some cleanup [mysql4 ~]# chown -R mysql. /var/lib/mysql StartMySQLonmysql4: [mysql4 ~]# systemctl start mysqld Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 115 / 168
  • 116. LAB5: MySQL shell to add an instance (3) [mysql4 ~]# mysqlsh Let´s verify the config: mysql-js> dba.checkInstanceCon guration('root@mysql4:3306') And change the configuration: mysql-js> dba.con gureLocalInstance() Restart the service to enablethechanges: [mysql4 ~]# systemctl restart mysqld Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 116 / 168
  • 117. LAB5: MySQL InnoDB Cluster (4) Group of 2 instances Find the latest purged GTIDs: [mysql4 ~]# cat /tmp/backup/meta/backup_gtid_executed.sql SET @@GLOBAL.GTID_PURGED='33351000-3fe8-11e7-80b3-08002718d305:1-1002'; ... 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"; Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 117 / 168
  • 118. LAB5: MySQL InnoDB Cluster (5) mysql-sql> js mysql-js> dba.checkInstanceCon guration('root@mysql4:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.getCluster() mysql-js> cluster.checkInstanceState('root@mysql4:3306') mysql-js> cluster.addInstance("root@mysql4:3306") mysql-js> cluster.status() Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 118 / 168
  • 119. Cluster Status mysql-js> cluster.status() { "clusterName": "MyInnoDBCluster", "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 @ 2017 Oracle and/or its affiliates. All rights reserved. 119 / 168
  • 120. Recovering progress On standard MySQL, monitor thegroup_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 @ 2017 Oracle and/or its affiliates. All rights reserved. 120 / 168
  • 121. point the application to the cluster Migrate the application Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 121 / 168
  • 122. LAB6: Migrate the application Now we 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 122 / 168
  • 123. LAB6: Migrate the application Stop asynchronous replicationon mysql2 andmysql3: mysql2> stop slave; mysql3> stop slave; Make sure gtid_executed range onmysql2 is lower or equal than onmysql3 mysql[2-3]> show global variables like 'gtid_executed'G mysql[2-3]> reset slave all; Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 123 / 168
  • 124. previous slave (mysql2) can now be part of the cluster Add a third instance Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 124 / 168
  • 125. LAB7: Add mysql2 to the group We first validate the instance using MySQLShell and we configure it. [mysql2 ~]# mysqlsh mysql-js> dba.checkInstanceCon guration('root@mysql2:3306') mysql-js> dba.con gureLocalInstance() We also need to remove super_read_onlyfrommy.cnf to be able to use the shell to add the node to the cluster. [mysql2 ~]# systemctl restart mysqld Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 125 / 168
  • 126. LAB7: Add mysql2 to the group (2) Back inMySQLshell we add the new instance: [mysql2 ~]# mysqlsh mysql-js> dba.checkInstanceCon guration('root@mysql2:3306') mysql-js> c root@mysql3:3306 mysql-js> cluster = dba.getCluster() mysql-js> cluster.addInstance("root@mysql2:3306") mysql-js> cluster.status() Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 126 / 168
  • 127. LAB7: Add mysql2 to the group (3) { "clusterName": "MyInnoDBCluster", "defaultReplicaSet": { "name": "default", "primary": "mysql3:3306", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": { "mysql2:3306": { "address": "mysql2:3306", "mode": "R/O", "readReplicas": {}, "role": "HA", "status": "ONLINE" }, "mysql3:3306": { "address": "mysql3:3306", "mode": "R/W", "readReplicas": {}, "role": "HA", "status": "ONLINE" }, "mysql4:3306": { "address": "mysql4:3306", "mode": "R/O", "readReplicas": {},Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 127 / 168
  • 128. writing to a single server Single Primary Mode Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 128 / 168
  • 129. Default = Single Primary Mode By default, MySQLInnoDBClusterenablesSingle Primary Mode. mysql> show global variables like 'group_replication_single_primary_mode'; +---------------------------------------+-------+ | Variable_name | Value | +---------------------------------------+-------+ | group_replication_single_primary_mode | ON | +---------------------------------------+-------+ Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 129 / 168
  • 130. Default = Single Primary Mode By default, MySQLInnoDBClusterenablesSingle 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 asthewritable 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 thePRIMARY, through a leader election mechanism. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 130 / 168
  • 131. Who´s the Primary Master ? As the Primary Master is elected, all nodes partof thegroup knows which one was elected. This value is exposed instatus 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 131 / 168
  • 132. Create a Multi-Primary Cluster: It´s also possible to create a Multi-PrimaryCluster using theShell: mysql-js> cluster=dba.createCluster('perconalive',{multiMaster: true}) A new InnoDB cluster will be created on instance 'root@mysql3:3306'. The MySQL InnoDB cluster is going to be setup in advanced Multi-Master Mode. Before continuing you have to con rm that you understand the requirements and limitations of Multi-Master Mode. Please read the manual before proceeding. I have read the MySQL InnoDB cluster manual and I understand the requirements and limitations of advanced Multi-Master Mode. Con rm [y|N]: Or you can force it to avoid interaction (for automation) : js> cluster=dba.createCluster('perconalive',{multiMaster: true, force: true}) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 132 / 168
  • 133. get more info Monitoring Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 133 / 168
  • 134. Performance Schema Group Replication usesPerformance_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:00 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 134 / 168
  • 135. Member State These are the different possible state for a node member: ONLINE OFFLINE RECOVERING ERROR: when a node is leaving but the plugin wasnot instructed to stop UNREACHABLE Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 135 / 168
  • 136. 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 136 / 168
  • 137. 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 COUNT_RECEIVED_HEARTBEATS: 0Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 137 / 168
  • 138. 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 138 / 168
  • 139. Performance_Schema You can find GR information in thefollowing Performance_Schematables: 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 139 / 168
  • 140. 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 140 / 168
  • 141. Sys Schema The easiest way to detect if anode isa member of theprimarycomponent (when there are partitioning of your nodes due to network issues for example) and therefore a valid candidate for routing queriesto it, isto use thesys table. Additional information forsys can be downloaded at https://github.com/lefred/mysql_gr_routing_check/blob/master/addition_to_sys.sql On the primary node: [mysql? ~]# mysql < /tmp/addition_to_sys.sql Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 141 / 168
  • 142. 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 142 / 168
  • 143. LAB8: Sys Schema - Health Check On one of the non Primary nodes, run thefollowing command: mysql-sql> ush tables with read lock; Now you 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 @ 2017 Oracle and/or its affiliates. All rights reserved. 143 / 168
  • 144. application interaction MySQL Router Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 144 / 168
  • 145. MySQL Router MySQLRouter is lightweight middleware that provides transparent routing between your application and backendMySQLServers. It can be used for awide variety of use cases, such as providing high availability and scalability by effectively routing database trafficto appropriate backendMySQLServers. MySQLRouter doesn´t require any specific configuration. Itconfigures itself automatically (bootstrap) usingMySQLInnoDB Cluster´s metadata. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 145 / 168
  • 146. LAB9: MySQL Router We will now usemysqlrouter between our application and thecluster. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 146 / 168
  • 147. LAB9: MySQL Router (2) Configure MySQLRouter that will run on the app server (mysql1).We bootstrap it using thePrimary-Master: [root@mysql1 ~]# mysqlrouter --bootstrap mysql3:3306 --user mysqlrouter Please enter MySQL password for root: WARNING: The MySQL server does not have SSL con gured and metadata used by the router may be transmitted unencrypted. Bootstrapping system MySQL Router instance... MySQL Router has now been con gured for the InnoDB cluster 'MyInnoDBCluster'. The following connection information can be used to connect to the cluster. Classic MySQL protocol connections to cluster 'MyInnoDBCluster': - Read/Write Connections: localhost:6446 - Read/Only Connections: localhost:6447 X protocol connections to cluster 'MyInnoDBCluster': - Read/Write Connections: localhost:64460 - Read/Only Connections: localhost:64470 Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 147 / 168
  • 148. LAB9: MySQL Router (3) Now let´s modify the configuration file to listen on port 3306: in/etc/mysqlrouter/mysqlrouter.conf: [routing:MyInnoDBCluster_default_rw] -bind_port=6446 +bind_port=3306 We can stopmysqld onmysql1 and startmysqlrouter into ascreensession: [mysql1 ~]# systemctl stop mysqld [mysql1 ~]# systemctl start mysqlrouter Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 148 / 168
  • 149. LAB9: MySQL Router (4) Before killing a member we will change systemd´s default behavior that restarts mysqld immediately: in/usr/lib/systemd/system/mysqld.service add the following under [Service] RestartSec=30 [mysql3 ~]# systemctl daemon-reload Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 149 / 168
  • 150. LAB9: MySQL Router (5) Now we can point the application to therouter (back to mysql1): [mysql1 ~]# run_app.sh Check app and killmysqld onmysql3(the Primary Master R/W node) ! [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 @ 2017 Oracle and/or its affiliates. All rights reserved. 150 / 168
  • 151. ProxySQL / HA Proxy / F5 / ... 3rd party router/proxy Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 151 / 168
  • 152. ProxySQLalso has native support for Group Replication which makes it maybe thebest choice for advanced users. 3rd party router/proxy MySQLInnoDB Clustercan also work withthird party router / proxy. If you need some specific features that are not yet available inMySQLRouter, like transparent R/W splitting, then you canuse your software of choice. The important part of such implementation isto use a good health check to verify if the MySQLserver you plan to route the traffic isina valid state. MySQLRouterimplements that natively, andit´s very easy to deploy. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 152 / 168
  • 153. operational tasks Recovering Node Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 153 / 168
  • 154. Recovering Nodes/Members The old master (mysql3) got killed. MySQLgot restarted automatically by systemd Let´s addmysql3 back to the clsuter Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 154 / 168
  • 155. LAB10: Recovering Nodes/Members [mysql3 ~]# mysqlsh mysql-js> c root@mysql4:3306 # The current master mysql-js> cluster = dba.getCluster() mysql-js> cluster.status() mysql-js> cluster.rejoinInstance("root@mysql3:3306") Rejoining the instance to the InnoDB cluster. Depending on the original problem that made the instance unavailable, the rejoin operation might not be successful and further manual steps will be needed to x the underlying problem. Please monitor the output of the rejoin operation and take necessary action if the instance cannot rejoin. Please provide the password for 'root@mysql3:3306': Rejoining instance to the cluster ... The instance 'root@mysql3:3306' was successfully rejoined on the cluster. The instance 'mysql3:3306' was successfully added to the MySQL Cluster. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 155 / 168
  • 156. mysql-js> cluster.status() { "clusterName": "MyInnoDBCluster", "defaultReplicaSet": { "name": "default", "primary": "mysql4:3306", "status": "OK", "statusText": "Cluster is ONLINE and can tolerate up to ONE failure.", "topology": { "mysql2:3306": { "address": "mysql2:3306", "mode": "R/O", "readReplicas": {}, "role": "HA", "status": "ONLINE" }, "mysql3:3306": { "address": "mysql3:3306", "mode": "R/O", "readReplicas": {}, "role": "HA", "status": "ONLINE" }, "mysql4:3306": { "address": "mysql4:3306", "mode": "R/W", "readReplicas": {}, "role": "HA", "status": "ONLINE" } } } } Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 156 / 168
  • 157. Recovering Nodes/Members (automatically) This time before killing a member of thegroup, we will persistthe configuration ondisk in my.cnf. We will use again the sameMySQLcommand as previously dba.con gureLocalInstance() but this time when all nodes are already part of the Group. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 157 / 168
  • 158. LAB10: Recovering Nodes/Members (2) Verify that all nodes are ONLINE. ... mysql-js> cluster.status() Then on all nodes run: mysql-js> dba.con gureLocalInstance() Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 158 / 168
  • 159. LAB10: Recovering Nodes/Members (3) Kill one node again: [mysql3 ~]# kill -9 $(pidof mysqld) systemd will restartmysqld and verify if the node joined. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 159 / 168
  • 160. understanding Flow Control Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 160 / 168
  • 161. Flow Control When usingMySQLGroup Replication, it´s possible that somemembers are lagging behind the group. Due to load, hardware limitation, etc... Thislagcan becomeproblematicto keep good certification performance and keep the possible certification failures aslow as possible. More problems can occur in multi-primary/write clusters when theapplying queue grows, the risk to have conflicts with those not yet applied transactions increases. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 161 / 168
  • 162. Flow Control (2) WithinMySQLGroup Replication´s FC implementation : the Group is never totally stalled the node having issues doesn´t send flow control messages to therest of thegroup asking to slow down Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 162 / 168
  • 163. Flow Control (3) Every member of the Group send somestatistics about its queues (applier queue and certification queue) to the other members. Then every node decide to slow down or not if they realize that one node reached the threshold for one of the queue: group_replication_ ow_control_applier_threshold (default is 25000) group_replication_ ow_control_certi er_threshold (default is 25000) Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 163 / 168
  • 164. Flow Control (4) So whengroup_replication_ ow_control_mode is set to QUOTA on the node seeing that one of the other members of thecluster is lagging behind (threshold reached), it will throttle the write operations to thetheminimumquota. This quota is calculated basedon thenumber of transactions applied inthelast second, and then it is reduced below that by subtracting the"over the quota"messages from the last period. Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 164 / 168
  • 165. LAB10: Flow Control During this last lab, we will reduce theflow control threshold on the Primary Master: mysql> show global variables like '% ow%'; +----------------------------------------------------+-------+ | Variable_name | Value | +----------------------------------------------------+-------+ | group_replication_ ow_control_applier_threshold | 25000 | | group_replication_ ow_control_certi er_threshold | 25000 | | group_replication_ ow_control_mode | QUOTA | +----------------------------------------------------+-------+ 3 rows in set (0.08 sec) mysql> set global group_replication_ ow_control_applier_threshold=100; Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 165 / 168
  • 166. LAB10: Flow Control (1) And now we block all writes onone of theSecondary-Masters: mysql> ush tables with read lock; And we check how the queueis growing: mysql> SELECT * FROM sys.gr_member_routing_candidate_status; +------------------+-----------+---------------------+----------------------+ | viable_candidate | read_only | transactions_behind | transactions_to_cert | +------------------+-----------+---------------------+----------------------+ | YES | NO | 487 | 0 | +------------------+-----------+---------------------+----------------------+ Did you notice something on theapplication when thethreshold was reached ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 166 / 168
  • 167. LAB10: Flow Control (2) If nothing happened, please increase thetrx rate: [root@mysql1 ~]# run_app.sh mysql1 --tx-rate=500 When the application's writesare low, you canjust remove thelock and see thequeue and the effect on theapplication: mysql> UNLOCK TABLES; Create flow control again and when you see theapplication writing just a few transactions, on the Primary-Master, disable theflow control mode: mysql> set global group_replication_ ow_control_mode='DISABLED'; Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 167 / 168
  • 168. Thank you ! Any Questions ? Copyright @ 2017 Oracle and/or its affiliates. All rights reserved. 168 / 168