SlideShare a Scribd company logo
partita iva e codice fiscale: 12938200156
c.c.i.a.a. milano n.1599095
registro imprese 12938200156
capitale sociale € 2.418.433,00 i.v.
direzione e sede legale
via campanini 6
20124 milano
tel: +39 02/66.732.1 – fax: +39 02/66.732.300
unità operativa
p.zza san benedetto da norcia 33
00071 pomezia (rm)
tel: +39 06/9826.9600 – fax: +39 06/9826.9680
Mirko Conte, Senior Architect
Oracle MySQL Day Roma, 11 Maggio 2017
Workshop tecnico:
MySQL Group Replication in action
2
Agenda
Dall'istanza singola al cluster: esplorazione di alcune tecniche di HA con
le repliche, standard e GR a confronto.
●
Ambiente: MySQL + applicazione demo
●
Creiamo istanze slave con repliche standard e gestiamo il failover
●
Trasformiamo le repliche in Group Replication
●
Introduciamo InnoDB Cluster
3
Software: MySQL + applicazione
●
MySQL 5.7.18
●
MySQL Router 2.1.3
●
MySQL Shell 1.0.9
●
MySQL Enterprise Backup 4.1.0
●
MySQL Utilities 1.6.5
●
Apache 2.4.6 + PHP 5.4.16 (Oracle Linux 7.3)
●
Wordpress 4.7.4
4
Configurazioni: MySQL + applicazione
Configurazioni
●
/etc/my.cnf
●
/var/www/html/wp-config.php
5
Architettura repliche standard
M S
S
R
mgr1 mgr2
mgr3
R
M
S
X
App + Router
DB mgr1 mgr2
mgr3
mgr4 mgr4
6
Creiamo istanze slave con repliche standard (1/2)
●
my.cnf
report-host=host
report-port=port
server-id=id
log-bin
binlog-format=ROW
enforce-gtid-consistency=ON
gtid-mode=ON
master-info-repository=TABLE
relay-log-info-repository=TABLE
log-slave-updates=ON
7
Creiamo istanze slave con repliche standard (2/2)
●
Provisioning dati con MEB:
mysqlbackup --skip-binlog --backup-dir=path backup-and-apply-log
mysqlbackup --backup-dir=path -–force copy-back
(implicito --login-path=client)
meta/backup_gtid_executed.sql
●
Read-only
●
Configurazione replica:
mysqlreplicate --master=conn-info --slave=conn-info --rpl-user=user:pwd
8
Configuriamo router e mysqlfailover
●
Configurazione router: /etc/mysqlrouter/mysqlrouter.conf
[routing:failover]
bind_address = 127.0.0.1:6446
destinations = host1:port,host2:port
mode = read-write
●
mysqlfailover
mysqlfailover --master=conn-info --slaves=conn-info,conn-info,...
--candidates=conn-info,... --daemon=start --failover-mode=elect
--log=/var/log/mysqlfailover.log --pidfile=/var/run/mysqlfailover --exec-
post-failover=script
9
Failover
●
Monitoraggio failover:
/var/log/mysqlfailover.log
/var/log/mysqlrouter/mysqlrouter.log
10
Post failover: ricostruire la replica
●
Stop mysqlfailover:
pkill -9 mysqlfailover
rm -f /var/run/mysqlfailover
SET sql_log_bin=0; DROP TABLE IF EXISTS mysql.failover_console;
●
Tentiamo il riallineamento del nodo principale tramite replica dal master:
mysqlreplicate --master=conn-info --slave=conn-info –rpl-user=user:pwd
●
Invertiamo i ruoli con mysqlrpladmin, in caso di “errant transactions” il
nodo dovrà essere allineato con backup e restore:
mysqlrpladmin --master=conn-info –slaves=conn-info,conn-info,... --new-
master=conn-info --demote-master switchover
11
Architettura Group Replication
R R
App + Router
DB
Xmgr1 mgr2 mgr3
mgr4
mgr1 mgr2 mgr3
mgr4
12
Requisiti della Group Replication
Requisiti e limitazioni:
●
Richiesto storage engine InnoDB
●
Richieste primary keys esplicite
●
Network Performance e Ipv4
●
Binary log formato ROW (non supportato checksum)
●
Transaction savepoints non supportati
●
Non adatto a very large transactions
●
Con multi-primary: gap locks, table locks, named locks, DDL + DML
concorrenti, foreign keys con cascading constraints, possibilità di abort al
commit per optimistic execution
13
Convertiamo in Group Replication (1/2)
●
my.cnf
binlog_checksum=NONE
transaction_write_set_extraction=XXHASH64
disabled_storage_engines=MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE
loose-group_replication_group_name="uuid"
loose-group_replication_start_on_boot=OFF
loose-group_replication_local_address="host:port"
loose-group_replication_group_seeds="host:port,host:port,host:port"
loose-group_replication_bootstrap_group=OFF
loose-group_replication_single_primary_mode=OFF
●
Nota: opzione disabled_storage_engines unica non dinamica, non
necessaria
14
Convertiamo in Group Replication (2/2)
●
Configuriamo i nodi:
INSTALL PLUGIN group_replication SONAME 'group_replication.so';
CREATE USER user IDENTIFIED BY 'password';
GRANT REPLICATION SLAVE ON *.* TO user;
CHANGE MASTER TO MASTER_USER='user', MASTER_PASSWORD='password'
FOR CHANNEL 'group_replication_recovery';
●
Attiviamo la GR sul primo nodo:
SET GLOBAL group_replication_bootstrap_group=ON;
START GROUP_REPLICATION;
SET GLOBAL group_replication_bootstrap_group=OFF;
●
Altri nodi: START GROUP_REPLICATION;
15
Configuriamo router
●
/etc/mysqlrouter/mysqlrouter.conf
[routing:failover]
bind_address = 127.0.0.1:6446
destinations = mgr1,mgr2,mgr3
mode = read-write
16
Convertiamo in InnoDB Cluster
●
Convertiamo GR a InnoDB Cluster:
mysqlsh --uri root:password@host
var cluster = dba.createCluster('clustername', {adoptFromGR: true})
mysqlrouter --bootstrap root:password@host --user=mysqlrouter –-force
●
Passiamo da replica standard a InnoDB Cluster:
dba.configureLocalInstance('root@localhost:3306', {password:'password',
mycnfPath:'/etc/my.cnf'})
var cluster=dba.createCluster('clustername')
cluster.addInstance('root:password@host')
mysqlrouter --bootstrap root:password@host --user=mysqlrouter –-force
direzione e sede legale
via campanini 6
20124 milano
tel: +39 02/66.732.1 – fax: +39 02/66.732.300
unità operativa
p.zza san benedetto da norcia 33
00071 pomezia (rm)
tel: +39 06/9826.9600 – fax: +39 06/9826.9680
Grazie per l’attenzione!

More Related Content

Similar to MySQL Day Roma 2017 - MySQL Group Replication in action

High Availability Architecture for Legacy Stuff - a 10.000 feet overview
High Availability Architecture for Legacy Stuff - a 10.000 feet overviewHigh Availability Architecture for Legacy Stuff - a 10.000 feet overview
High Availability Architecture for Legacy Stuff - a 10.000 feet overview
Marco Amado
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterSeveralnines
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
FromDual GmbH
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptx
Vinicius M Grippa
 
Hochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDBHochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDB
MariaDB plc
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB plc
 
New bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around CollinsNew bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around Collins
leboncoin engineering
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) final
Valeriy Kravchuk
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
vanphp
 
More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)
Valeriy Kravchuk
 
MHA and MMM in DP
MHA and MMM in DPMHA and MMM in DP
MHA and MMM in DPJunyi Lu
 
Lrz kurs: big data analysis
Lrz kurs: big data analysisLrz kurs: big data analysis
Lrz kurs: big data analysis
Ferdinand Jamitzky
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
Jean-François Gagné
 
Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Sergey Petrunya
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance Dilemmas
ScyllaDB
 
介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup
YUCHENG HU
 
MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931Baruch Osoveskiy
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
Marcelo Altmann
 
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.xEMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
Aruba, a Hewlett Packard Enterprise company
 

Similar to MySQL Day Roma 2017 - MySQL Group Replication in action (20)

High Availability Architecture for Legacy Stuff - a 10.000 feet overview
High Availability Architecture for Legacy Stuff - a 10.000 feet overviewHigh Availability Architecture for Legacy Stuff - a 10.000 feet overview
High Availability Architecture for Legacy Stuff - a 10.000 feet overview
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
PL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptxPL22 - Backup and Restore Performance.pptx
PL22 - Backup and Restore Performance.pptx
 
Hochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDBHochverfügbarkeitslösungen mit MariaDB
Hochverfügbarkeitslösungen mit MariaDB
 
MariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance OptimizationMariaDB Paris Workshop 2023 - Performance Optimization
MariaDB Paris Workshop 2023 - Performance Optimization
 
New bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around CollinsNew bare-metal provisioning setup built around Collins
New bare-metal provisioning setup built around Collins
 
Gdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) finalGdb basics for my sql db as (openfest 2017) final
Gdb basics for my sql db as (openfest 2017) final
 
NoSQL with MySQL
NoSQL with MySQLNoSQL with MySQL
NoSQL with MySQL
 
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling StoryPHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
PHP At 5000 Requests Per Second: Hootsuite’s Scaling Story
 
More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)More on gdb for my sql db as (fosdem 2016)
More on gdb for my sql db as (fosdem 2016)
 
MHA and MMM in DP
MHA and MMM in DPMHA and MMM in DP
MHA and MMM in DP
 
Lrz kurs: big data analysis
Lrz kurs: big data analysisLrz kurs: big data analysis
Lrz kurs: big data analysis
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2Fosdem2012 mariadb-5.3-query-optimizer-r2
Fosdem2012 mariadb-5.3-query-optimizer-r2
 
Dissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance DilemmasDissecting Real-World Database Performance Dilemmas
Dissecting Real-World Database Performance Dilemmas
 
介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup介绍 Percona 服务器 XtraDB 和 Xtrabackup
介绍 Percona 服务器 XtraDB 和 Xtrabackup
 
MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931MySQL replication best practices 105-232-931
MySQL replication best practices 105-232-931
 
Troubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer PerspectiveTroubleshooting MySQL from a MySQL Developer Perspective
Troubleshooting MySQL from a MySQL Developer Perspective
 
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.xEMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
EMEA Airheads- Layer-3 Redundancy for Mobility Master - ArubaOS 8.x
 

More from Par-Tec S.p.A.

RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
Par-Tec S.p.A.
 
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
Par-Tec S.p.A.
 
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
Par-Tec S.p.A.
 
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
Par-Tec S.p.A.
 
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
Par-Tec S.p.A.
 
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo modernoWebinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
Par-Tec S.p.A.
 
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQLMySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
Par-Tec S.p.A.
 
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPAWebinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
Par-Tec S.p.A.
 
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
Par-Tec S.p.A.
 
MySQL Day Milano 2019 - Il backup non ammette ignoranza
MySQL Day Milano 2019 - Il backup non ammette ignoranzaMySQL Day Milano 2019 - Il backup non ammette ignoranza
MySQL Day Milano 2019 - Il backup non ammette ignoranza
Par-Tec S.p.A.
 
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
Par-Tec S.p.A.
 
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
Par-Tec S.p.A.
 
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
Par-Tec S.p.A.
 
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
Par-Tec S.p.A.
 
C&CNR2019 - Containers Landscape Review
C&CNR2019 - Containers Landscape ReviewC&CNR2019 - Containers Landscape Review
C&CNR2019 - Containers Landscape Review
Par-Tec S.p.A.
 
C&CNR2019 - Cloud-Native Landscape Review
C&CNR2019 - Cloud-Native Landscape ReviewC&CNR2019 - Cloud-Native Landscape Review
C&CNR2019 - Cloud-Native Landscape Review
Par-Tec S.p.A.
 
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAE
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAEOpen Source Day 2018 - OpenShift accelera la digital transformation di SIAE
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAE
Par-Tec S.p.A.
 
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
Par-Tec S.p.A.
 
MySQL Day Milano 2018 - MySQL e le architetture a microservizi
MySQL Day Milano 2018 - MySQL e le architetture a microserviziMySQL Day Milano 2018 - MySQL e le architetture a microservizi
MySQL Day Milano 2018 - MySQL e le architetture a microservizi
Par-Tec S.p.A.
 
MySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microserviziMySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microservizi
Par-Tec S.p.A.
 

More from Par-Tec S.p.A. (20)

RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
RHACS: creare, distribuire ed eseguire applicazioni cloud native in modo più ...
 
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
MySQL Day Roma 2022 - MySQL: dall'alta disponibilità al disaster recovery in ...
 
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
Webinar 23 giugno 2022 - Advanced Cluster Security: come si mette davvero al ...
 
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
Webinar 18 novembre 2021 - Dall’endpoint protection al servizio gestito: come...
 
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
MySQL Day 2021 Digital Edition - Da Percona e MariaDB a MySQL: vantaggi e str...
 
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo modernoWebinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
Webinar 2 marzo 2021 - DevSecOps: la cybersecurity sposa lo sviluppo moderno
 
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQLMySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
MySQL Day 2020 Digital Edition - Come proteggere al meglio un database MySQL
 
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPAWebinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
Webinar 6 ottobre 2020 - Sicurezza e Compliance a misura di RPA
 
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Milano 2019 - Da MySQL 5.7 a MySQL 8.0
 
MySQL Day Milano 2019 - Il backup non ammette ignoranza
MySQL Day Milano 2019 - Il backup non ammette ignoranzaMySQL Day Milano 2019 - Il backup non ammette ignoranza
MySQL Day Milano 2019 - Il backup non ammette ignoranza
 
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
Open Source Day 2019 - Cosa puoi fare con Ansible in 1200 secondi?
 
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
Forum ICT Security 2019 - L’Identity Governance come difesa dagli insider thr...
 
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
MySQL Day Roma 2019 - Da MySQL 5.7 a MySQL 8.0
 
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQLMySQL Day Roma 2019 - Le architetture a microservizi e MySQL
MySQL Day Roma 2019 - Le architetture a microservizi e MySQL
 
C&CNR2019 - Containers Landscape Review
C&CNR2019 - Containers Landscape ReviewC&CNR2019 - Containers Landscape Review
C&CNR2019 - Containers Landscape Review
 
C&CNR2019 - Cloud-Native Landscape Review
C&CNR2019 - Cloud-Native Landscape ReviewC&CNR2019 - Cloud-Native Landscape Review
C&CNR2019 - Cloud-Native Landscape Review
 
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAE
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAEOpen Source Day 2018 - OpenShift accelera la digital transformation di SIAE
Open Source Day 2018 - OpenShift accelera la digital transformation di SIAE
 
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
Open Source Day 2018 - Caso Cliente INAIL: Soluzioni e competenze che abilita...
 
MySQL Day Milano 2018 - MySQL e le architetture a microservizi
MySQL Day Milano 2018 - MySQL e le architetture a microserviziMySQL Day Milano 2018 - MySQL e le architetture a microservizi
MySQL Day Milano 2018 - MySQL e le architetture a microservizi
 
MySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microserviziMySQL Day Milano 2018 - Le architetture a microservizi
MySQL Day Milano 2018 - Le architetture a microservizi
 

Recently uploaded

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 

Recently uploaded (20)

PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 

MySQL Day Roma 2017 - MySQL Group Replication in action

  • 1. partita iva e codice fiscale: 12938200156 c.c.i.a.a. milano n.1599095 registro imprese 12938200156 capitale sociale € 2.418.433,00 i.v. direzione e sede legale via campanini 6 20124 milano tel: +39 02/66.732.1 – fax: +39 02/66.732.300 unità operativa p.zza san benedetto da norcia 33 00071 pomezia (rm) tel: +39 06/9826.9600 – fax: +39 06/9826.9680 Mirko Conte, Senior Architect Oracle MySQL Day Roma, 11 Maggio 2017 Workshop tecnico: MySQL Group Replication in action
  • 2. 2 Agenda Dall'istanza singola al cluster: esplorazione di alcune tecniche di HA con le repliche, standard e GR a confronto. ● Ambiente: MySQL + applicazione demo ● Creiamo istanze slave con repliche standard e gestiamo il failover ● Trasformiamo le repliche in Group Replication ● Introduciamo InnoDB Cluster
  • 3. 3 Software: MySQL + applicazione ● MySQL 5.7.18 ● MySQL Router 2.1.3 ● MySQL Shell 1.0.9 ● MySQL Enterprise Backup 4.1.0 ● MySQL Utilities 1.6.5 ● Apache 2.4.6 + PHP 5.4.16 (Oracle Linux 7.3) ● Wordpress 4.7.4
  • 4. 4 Configurazioni: MySQL + applicazione Configurazioni ● /etc/my.cnf ● /var/www/html/wp-config.php
  • 5. 5 Architettura repliche standard M S S R mgr1 mgr2 mgr3 R M S X App + Router DB mgr1 mgr2 mgr3 mgr4 mgr4
  • 6. 6 Creiamo istanze slave con repliche standard (1/2) ● my.cnf report-host=host report-port=port server-id=id log-bin binlog-format=ROW enforce-gtid-consistency=ON gtid-mode=ON master-info-repository=TABLE relay-log-info-repository=TABLE log-slave-updates=ON
  • 7. 7 Creiamo istanze slave con repliche standard (2/2) ● Provisioning dati con MEB: mysqlbackup --skip-binlog --backup-dir=path backup-and-apply-log mysqlbackup --backup-dir=path -–force copy-back (implicito --login-path=client) meta/backup_gtid_executed.sql ● Read-only ● Configurazione replica: mysqlreplicate --master=conn-info --slave=conn-info --rpl-user=user:pwd
  • 8. 8 Configuriamo router e mysqlfailover ● Configurazione router: /etc/mysqlrouter/mysqlrouter.conf [routing:failover] bind_address = 127.0.0.1:6446 destinations = host1:port,host2:port mode = read-write ● mysqlfailover mysqlfailover --master=conn-info --slaves=conn-info,conn-info,... --candidates=conn-info,... --daemon=start --failover-mode=elect --log=/var/log/mysqlfailover.log --pidfile=/var/run/mysqlfailover --exec- post-failover=script
  • 10. 10 Post failover: ricostruire la replica ● Stop mysqlfailover: pkill -9 mysqlfailover rm -f /var/run/mysqlfailover SET sql_log_bin=0; DROP TABLE IF EXISTS mysql.failover_console; ● Tentiamo il riallineamento del nodo principale tramite replica dal master: mysqlreplicate --master=conn-info --slave=conn-info –rpl-user=user:pwd ● Invertiamo i ruoli con mysqlrpladmin, in caso di “errant transactions” il nodo dovrà essere allineato con backup e restore: mysqlrpladmin --master=conn-info –slaves=conn-info,conn-info,... --new- master=conn-info --demote-master switchover
  • 11. 11 Architettura Group Replication R R App + Router DB Xmgr1 mgr2 mgr3 mgr4 mgr1 mgr2 mgr3 mgr4
  • 12. 12 Requisiti della Group Replication Requisiti e limitazioni: ● Richiesto storage engine InnoDB ● Richieste primary keys esplicite ● Network Performance e Ipv4 ● Binary log formato ROW (non supportato checksum) ● Transaction savepoints non supportati ● Non adatto a very large transactions ● Con multi-primary: gap locks, table locks, named locks, DDL + DML concorrenti, foreign keys con cascading constraints, possibilità di abort al commit per optimistic execution
  • 13. 13 Convertiamo in Group Replication (1/2) ● my.cnf binlog_checksum=NONE transaction_write_set_extraction=XXHASH64 disabled_storage_engines=MyISAM,BLACKHOLE,FEDERATED,CSV,ARCHIVE loose-group_replication_group_name="uuid" loose-group_replication_start_on_boot=OFF loose-group_replication_local_address="host:port" loose-group_replication_group_seeds="host:port,host:port,host:port" loose-group_replication_bootstrap_group=OFF loose-group_replication_single_primary_mode=OFF ● Nota: opzione disabled_storage_engines unica non dinamica, non necessaria
  • 14. 14 Convertiamo in Group Replication (2/2) ● Configuriamo i nodi: INSTALL PLUGIN group_replication SONAME 'group_replication.so'; CREATE USER user IDENTIFIED BY 'password'; GRANT REPLICATION SLAVE ON *.* TO user; CHANGE MASTER TO MASTER_USER='user', MASTER_PASSWORD='password' FOR CHANNEL 'group_replication_recovery'; ● Attiviamo la GR sul primo nodo: SET GLOBAL group_replication_bootstrap_group=ON; START GROUP_REPLICATION; SET GLOBAL group_replication_bootstrap_group=OFF; ● Altri nodi: START GROUP_REPLICATION;
  • 15. 15 Configuriamo router ● /etc/mysqlrouter/mysqlrouter.conf [routing:failover] bind_address = 127.0.0.1:6446 destinations = mgr1,mgr2,mgr3 mode = read-write
  • 16. 16 Convertiamo in InnoDB Cluster ● Convertiamo GR a InnoDB Cluster: mysqlsh --uri root:password@host var cluster = dba.createCluster('clustername', {adoptFromGR: true}) mysqlrouter --bootstrap root:password@host --user=mysqlrouter –-force ● Passiamo da replica standard a InnoDB Cluster: dba.configureLocalInstance('root@localhost:3306', {password:'password', mycnfPath:'/etc/my.cnf'}) var cluster=dba.createCluster('clustername') cluster.addInstance('root:password@host') mysqlrouter --bootstrap root:password@host --user=mysqlrouter –-force
  • 17. direzione e sede legale via campanini 6 20124 milano tel: +39 02/66.732.1 – fax: +39 02/66.732.300 unità operativa p.zza san benedetto da norcia 33 00071 pomezia (rm) tel: +39 06/9826.9600 – fax: +39 06/9826.9680 Grazie per l’attenzione!