SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
www.fromdual.com
1 / 22
High-availability with
Galera Cluster
for MySQL
LinuxTag 2014
10. Mai 2014, Berlin
by oli.sennhauser@fromdual.com
www.fromdual.com
www.fromdual.com
2 / 22
About FromDual GmbH
● FromDual provides neutral and independent:
● Consulting for MySQL, Galera Cluster, MariaDB and
Percona Server
● Support for all MySQL and Galera Cluster
● Remote-DBA Services for all MySQL
● MySQL Training
● Open Source Business Alliance (OSBA)
● Member of SOUG, DOAG, /ch/open
www.fromdual.com
www.fromdual.com
3 / 22
High-Availability :-(
● Its also about maintenance...
● Who loves night-shifts?
● Who loves weekend-work?
● Who does regular upgrade (DB, kernel, etc.)?
● Who does regular reboots (after kernel
upgrade)?
● Why are you not doing it in your office hours?
www.fromdual.com
4 / 22
The Galera Cluster for MySQL
www.fromdual.com
5 / 22
Maintenance time...
App
Load balancing (LB)
Node 2Node 1
wsrep
Galera replication
wsrep
Node 3
wsrep
Upgrade
RAM/HW
O/S
DB?
www.fromdual.com
6 / 22
Advantages / Disadvantages
Based on InnoDB SE
Synchronous replication → No lost transaction
Active-active multi-master Cluster
→ Read and write to any cluster node (no r/w split any more!)
Read scalability and higher write throughput (Flash-Cache?)
Automatic node membership control
Rolling Restart (Upgrade of Hardware, O/S, DB release, etc.)
True parallel replication, on row level
→ No slave lag
A bit more complicated than normal MySQL, but similar complexity
as M/S Replication!
No original MySQL binaries → Codership MySQL binaries
Be aware of Hot Spots on rows: Higher probability of deadlocks
www.fromdual.com
7 / 22
Quorum and split-brain
● What is the problem?
● Split-brain → bad!
● Galera is a pessimistic Cluster → good!
● Quorum: FLOOR(n/2+1)
→ more than half! → 3-node Cluster (or 2+1)
?
www.fromdual.com
8 / 22
Quorum
www.fromdual.com
9 / 22
Installation and Configuration
www.fromdual.com
10 / 22
Installation
● Galera Cluster consists of:
● A patched Codership MySQL (mysqld)
● Or MariaDB Galera Cluster
● Or Percona XtraDB Cluster
● The Galera Plugin (libgalera_smm.so)
● Ways of installation
● Packets (RPM, DEB)
● Binary tar-ball
● Patch MySQL source and compile both
● Download http://galeracluster.com/downloads/
www.fromdual.com
11 / 22
MySQL Configuration
my.cnf
[mysqld]
default_storage_engine         = InnoDB
binlog_format                  = row
innodb_autoinc_lock_mode       = 2   # parallel applying
innodb_flush_log_at_trx_commit = 0   # performance only!
query_cache_size               = 0   # Galera 3   experimental→
query_cache_type               = 0   # Mutex! Consistency!
www.fromdual.com
12 / 22
Galera Configuration
my.cnf (conf.d/wsrep.cnf)
[mysqld]
# wsrep_provider = none
wsrep_provider = …/lib/plugin/libgalera_smm.so
# wsrep_cluster_address = "gcomm://"
wsrep_cluster_address = "gcomm://ip_node2,ip_node3"
wsrep_cluster_name = 'Galera Cluster'
wsrep_node_name = 'Node A'
wsrep_sst_method = mysqldump
wsrep_sst_auth = sst:secret
www.fromdual.com
13 / 22
Operations
www.fromdual.com
14 / 22
Initial Cluster start
● Start very 1st node with:
wsrep_cluster_address = "gcomm://"
or
mysqld_safe ­­wsrep­cluster­address="gcomm://"
● → this tells the node to be the first one!
● All other nodes normal:
service mysqld start
www.fromdual.com
15 / 22
Rolling Restart
● Scenario:
● Hardware-, O/S-, DB- and Galera-Upgrade
● MySQL configuration change
● During full operation!!! (99.999% HA, 5x9 HA)
● → Rolling Restart
● Start one node after the other in a cycle
● New features or settings are used after Rolling
Restart is completed
www.fromdual.com
16 / 22
Load Balancing
● Connectors
● Connector/J
● PHP: MySQLnd replication and load balancing
plug-in
● SW Load Balancer
● GLB, LVS/IPVS/Ldirector, HAProxy
● HW Load Balancer
www.fromdual.com
17 / 22
Location of Load Balancing
www.fromdual.com
18 / 22
Demo?
www.fromdual.com
19 / 22
Online Schema Upgrade (OSU)
● Schema Upgrade = DDL run against the DB
● Change DB structure
● Non transactional
● 2 Methods:
● Total Order Isolation (TOI) (default)
● Rolling Schema Upgrade (RSU)
● wsrep_osu_method = {TOI|RSU}
www.fromdual.com
20 / 22
Online Schema Upgrade
● Total Order Isolation (TOI) (default)
● Part of the database is locked for the duration of the DDL.
● + Simple, predictable and guaranteed data consistency.
● - Locking operation
● Good for fast DDL operations
● Rolling Schema Upgrade (RSU)
● DDL will be only processed locally at the node.
● Node is desynchronized for the duration of the DDL processing.
● After DDL completion, delayed write sets are applied (similar to IST).
● DDL should be manually executed at each node.
● + only blocking one node at a time
● - potentially unsafe and may fail if new and old schema are
incompatible
● Good for slow DDL operations
www.fromdual.com
21 / 22
Wir suchen noch:
● Datenbank Enthusiast/in für
Support / remote-DBA / Beratung
www.fromdual.com
22 / 22
Q & A
Questions ?
Discussion?
We have time for some face-to-face talks...
● FromDual provides neutral and independent:
● Consulting
● Remote-DBA
● Support for MySQL, Galera, Percona Server and MariaDB
● Training
www.fromdual.com

Más contenido relacionado

La actualidad más candente

The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialJean-François Gagné
 
MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)Cédric P
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshotRajesh Joseph
 
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebula Project
 
Tuning Linux for Databases.
Tuning Linux for Databases.Tuning Linux for Databases.
Tuning Linux for Databases.Alexey Lesovsky
 
FOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAsFOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAsValerii Kravchuk
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Valerii Kravchuk
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comJean-François Gagné
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7Olivier DASINI
 
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Valerii Kravchuk
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Valerii Kravchuk
 
Optimization_of_Virtual_Machines_for_High_Performance
Optimization_of_Virtual_Machines_for_High_PerformanceOptimization_of_Virtual_Machines_for_High_Performance
Optimization_of_Virtual_Machines_for_High_PerformanceStorPool Storage
 
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS -  FOSDEM 2022 MariaDB DevroomMariaDB Server on macOS -  FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS - FOSDEM 2022 MariaDB DevroomValeriy Kravchuk
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
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
 
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) finalValeriy Kravchuk
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreMariaDB Corporation
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 

La actualidad más candente (20)

The Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication TutorialThe Full MySQL and MariaDB Parallel Replication Tutorial
The Full MySQL and MariaDB Parallel Replication Tutorial
 
MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)MYSQLDUMP & ZRM COMMUNITY (EN)
MYSQLDUMP & ZRM COMMUNITY (EN)
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshot
 
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto GarcíaOpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
OpenNebulaConf2015 2.02 Backing up your VM’s with Bacula - Alberto García
 
Tuning Linux for Databases.
Tuning Linux for Databases.Tuning Linux for Databases.
Tuning Linux for Databases.
 
FOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAsFOSDEM 2015: gdb tips and tricks for MySQL DBAs
FOSDEM 2015: gdb tips and tricks for MySQL DBAs
 
Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1Tracing and profiling my sql (percona live europe 2019) draft_1
Tracing and profiling my sql (percona live europe 2019) draft_1
 
MySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.comMySQL Parallel Replication by Booking.com
MySQL Parallel Replication by Booking.com
 
Kvm optimizations
Kvm optimizationsKvm optimizations
Kvm optimizations
 
What's New in MySQL 5.7
What's New in MySQL 5.7What's New in MySQL 5.7
What's New in MySQL 5.7
 
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
Instant add column for inno db in mariadb 10.3+ (fosdem 2018, second draft)
 
Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)Gdb basics for my sql db as (percona live europe 2019)
Gdb basics for my sql db as (percona live europe 2019)
 
Optimization_of_Virtual_Machines_for_High_Performance
Optimization_of_Virtual_Machines_for_High_PerformanceOptimization_of_Virtual_Machines_for_High_Performance
Optimization_of_Virtual_Machines_for_High_Performance
 
How to Monitor MySQL
How to Monitor MySQLHow to Monitor MySQL
How to Monitor MySQL
 
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS -  FOSDEM 2022 MariaDB DevroomMariaDB Server on macOS -  FOSDEM 2022 MariaDB Devroom
MariaDB Server on macOS - FOSDEM 2022 MariaDB Devroom
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 
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)
 
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
 
The New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and moreThe New MariaDB Offering - MariaDB 10, MaxScale and more
The New MariaDB Offering - MariaDB 10, MaxScale and more
 
MySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitationsMySQL Parallel Replication: inventory, use-case and limitations
MySQL Parallel Replication: inventory, use-case and limitations
 

Similar a HA with Galera

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...FromDual GmbH
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsMariaDB plc
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningFromDual GmbH
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLOSInet
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Louis liu
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsLenz Grimmer
 
Pg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyPg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyFederico Campoli
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?FromDual GmbH
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017Severalnines
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning VariablesFromDual GmbH
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaMariaDB plc
 
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 PerspectiveMarcelo Altmann
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster RecoveryMarkTaylorIBM
 
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsMySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsJean-François Gagné
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeOlivier DASINI
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerkuchinskaya
 

Similar a HA with Galera (20)

MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...MariaDB/MySQL pitfalls - And how to come out again...
MariaDB/MySQL pitfalls - And how to come out again...
 
M|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change MethodsM|18 Battle of the Online Schema Change Methods
M|18 Battle of the Online Schema Change Methods
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
 
Scaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQLScaling up and accelerating Drupal 8 with NoSQL
Scaling up and accelerating Drupal 8 with NoSQL
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MySQL and MariaDB Backups
MySQL and MariaDB BackupsMySQL and MariaDB Backups
MySQL and MariaDB Backups
 
Pg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easyPg chameleon, mysql to postgresql replica made easy
Pg chameleon, mysql to postgresql replica made easy
 
MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?MariaDB / MySQL tripping hazard and how to get out again?
MariaDB / MySQL tripping hazard and how to get out again?
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017MySQL Cluster (NDB) - Best Practices Percona Live 2017
MySQL Cluster (NDB) - Best Practices Percona Live 2017
 
MySQL Performance Tuning Variables
MySQL Performance Tuning VariablesMySQL Performance Tuning Variables
MySQL Performance Tuning Variables
 
M|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at NokiaM|18 Creating a Reference Architecture for High Availability at Nokia
M|18 Creating a Reference Architecture for High Availability at Nokia
 
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
 
IBM MQ Disaster Recovery
IBM MQ Disaster RecoveryIBM MQ Disaster Recovery
IBM MQ Disaster Recovery
 
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitationsMySQL/MariaDB Parallel Replication: inventory, use-case and limitations
MySQL/MariaDB Parallel Replication: inventory, use-case and limitations
 
Mashing the data
Mashing the dataMashing the data
Mashing the data
 
Upgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtimeUpgrade to MySQL 5.6 without downtime
Upgrade to MySQL 5.6 without downtime
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
 

Más de FromDual GmbH

PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopFromDual GmbH
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesFromDual GmbH
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New FeaturesFromDual GmbH
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New FeaturesFromDual GmbH
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA'sFromDual GmbH
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/RecoveryFromDual GmbH
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?FromDual GmbH
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterFromDual GmbH
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?FromDual GmbH
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationFromDual GmbH
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sFromDual GmbH
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015FromDual GmbH
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerFromDual GmbH
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?FromDual GmbH
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprintsFromDual GmbH
 
MySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLMySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLFromDual GmbH
 
Need for Speed: Mysql indexing
Need for Speed: Mysql indexingNeed for Speed: Mysql indexing
Need for Speed: Mysql indexingFromDual GmbH
 
MySQL HA and Security
MySQL HA and SecurityMySQL HA and Security
MySQL HA and SecurityFromDual GmbH
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability SolutionsFromDual GmbH
 

Más de FromDual GmbH (20)

PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration WorkshopPXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
PXC 5.5 to MariaDB 10.4 Galera Cluster Migration Workshop
 
IT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New FeaturesIT Tage 2019 MariaDB 10.4 New Features
IT Tage 2019 MariaDB 10.4 New Features
 
MariaDB 10.4 New Features
MariaDB 10.4 New FeaturesMariaDB 10.4 New Features
MariaDB 10.4 New Features
 
MariaDB 10.2 New Features
MariaDB 10.2 New FeaturesMariaDB 10.2 New Features
MariaDB 10.2 New Features
 
MySQL für Oracle DBA's
MySQL für Oracle DBA'sMySQL für Oracle DBA's
MySQL für Oracle DBA's
 
MySQL Backup/Recovery
MySQL Backup/RecoveryMySQL Backup/Recovery
MySQL Backup/Recovery
 
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
MySQL Beispiele aus der Praxis - Wie setzen Kunden MySQL ein?
 
MySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und ClusterMySQL-Server im Teamwork - Replikation und Cluster
MySQL-Server im Teamwork - Replikation und Cluster
 
Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?Der Datenbank-Backup ist gemacht - was nun?
Der Datenbank-Backup ist gemacht - was nun?
 
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-ReplikationWeltweite Produktionsdatenverwaltung mit MySQL-Replikation
Weltweite Produktionsdatenverwaltung mit MySQL-Replikation
 
MySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA'sMySQL Performance Tuning für Oracle-DBA's
MySQL Performance Tuning für Oracle-DBA's
 
MySQL Security SLAC 2015
MySQL Security SLAC 2015MySQL Security SLAC 2015
MySQL Security SLAC 2015
 
MySQL Performance Tuning für Entwickler
MySQL Performance Tuning für EntwicklerMySQL Performance Tuning für Entwickler
MySQL Performance Tuning für Entwickler
 
MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?MySQL Replikation - Die Eier legende Wollmilchsau?
MySQL Replikation - Die Eier legende Wollmilchsau?
 
Reading MySQL fingerprints
Reading MySQL fingerprintsReading MySQL fingerprints
Reading MySQL fingerprints
 
MySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQLMySQL Cluster with Galera Cluster for MySQL
MySQL Cluster with Galera Cluster for MySQL
 
MySQL Backup
MySQL BackupMySQL Backup
MySQL Backup
 
Need for Speed: Mysql indexing
Need for Speed: Mysql indexingNeed for Speed: Mysql indexing
Need for Speed: Mysql indexing
 
MySQL HA and Security
MySQL HA and SecurityMySQL HA and Security
MySQL HA and Security
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 

Último

Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesLumiverse Solutions Pvt Ltd
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predieusebiomeyer
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxmibuzondetrabajo
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书rnrncn29
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119APNIC
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxAndrieCagasanAkio
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxNIMMANAGANTI RAMAKRISHNA
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书rnrncn29
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxMario
 

Último (9)

Cybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best PracticesCybersecurity Threats and Cybersecurity Best Practices
Cybersecurity Threats and Cybersecurity Best Practices
 
SCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is prediSCM Symposium PPT Format Customer loyalty is predi
SCM Symposium PPT Format Customer loyalty is predi
 
Unidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptxUnidad 4 – Redes de ordenadores (en inglés).pptx
Unidad 4 – Redes de ordenadores (en inglés).pptx
 
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
『澳洲文凭』买詹姆士库克大学毕业证书成绩单办理澳洲JCU文凭学位证书
 
IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119IP addressing and IPv6, presented by Paul Wilson at IETF 119
IP addressing and IPv6, presented by Paul Wilson at IETF 119
 
TRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptxTRENDS Enabling and inhibiting dimensions.pptx
TRENDS Enabling and inhibiting dimensions.pptx
 
ETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptxETHICAL HACKING dddddddddddddddfnandni.pptx
ETHICAL HACKING dddddddddddddddfnandni.pptx
 
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
『澳洲文凭』买拉筹伯大学毕业证书成绩单办理澳洲LTU文凭学位证书
 
Company Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptxCompany Snapshot Theme for Business by Slidesgo.pptx
Company Snapshot Theme for Business by Slidesgo.pptx
 

HA with Galera

  • 1. www.fromdual.com 1 / 22 High-availability with Galera Cluster for MySQL LinuxTag 2014 10. Mai 2014, Berlin by oli.sennhauser@fromdual.com www.fromdual.com
  • 2. www.fromdual.com 2 / 22 About FromDual GmbH ● FromDual provides neutral and independent: ● Consulting for MySQL, Galera Cluster, MariaDB and Percona Server ● Support for all MySQL and Galera Cluster ● Remote-DBA Services for all MySQL ● MySQL Training ● Open Source Business Alliance (OSBA) ● Member of SOUG, DOAG, /ch/open www.fromdual.com
  • 3. www.fromdual.com 3 / 22 High-Availability :-( ● Its also about maintenance... ● Who loves night-shifts? ● Who loves weekend-work? ● Who does regular upgrade (DB, kernel, etc.)? ● Who does regular reboots (after kernel upgrade)? ● Why are you not doing it in your office hours?
  • 4. www.fromdual.com 4 / 22 The Galera Cluster for MySQL
  • 5. www.fromdual.com 5 / 22 Maintenance time... App Load balancing (LB) Node 2Node 1 wsrep Galera replication wsrep Node 3 wsrep Upgrade RAM/HW O/S DB?
  • 6. www.fromdual.com 6 / 22 Advantages / Disadvantages Based on InnoDB SE Synchronous replication → No lost transaction Active-active multi-master Cluster → Read and write to any cluster node (no r/w split any more!) Read scalability and higher write throughput (Flash-Cache?) Automatic node membership control Rolling Restart (Upgrade of Hardware, O/S, DB release, etc.) True parallel replication, on row level → No slave lag A bit more complicated than normal MySQL, but similar complexity as M/S Replication! No original MySQL binaries → Codership MySQL binaries Be aware of Hot Spots on rows: Higher probability of deadlocks
  • 7. www.fromdual.com 7 / 22 Quorum and split-brain ● What is the problem? ● Split-brain → bad! ● Galera is a pessimistic Cluster → good! ● Quorum: FLOOR(n/2+1) → more than half! → 3-node Cluster (or 2+1) ?
  • 10. www.fromdual.com 10 / 22 Installation ● Galera Cluster consists of: ● A patched Codership MySQL (mysqld) ● Or MariaDB Galera Cluster ● Or Percona XtraDB Cluster ● The Galera Plugin (libgalera_smm.so) ● Ways of installation ● Packets (RPM, DEB) ● Binary tar-ball ● Patch MySQL source and compile both ● Download http://galeracluster.com/downloads/
  • 11. www.fromdual.com 11 / 22 MySQL Configuration my.cnf [mysqld] default_storage_engine         = InnoDB binlog_format                  = row innodb_autoinc_lock_mode       = 2   # parallel applying innodb_flush_log_at_trx_commit = 0   # performance only! query_cache_size               = 0   # Galera 3   experimental→ query_cache_type               = 0   # Mutex! Consistency!
  • 12. www.fromdual.com 12 / 22 Galera Configuration my.cnf (conf.d/wsrep.cnf) [mysqld] # wsrep_provider = none wsrep_provider = …/lib/plugin/libgalera_smm.so # wsrep_cluster_address = "gcomm://" wsrep_cluster_address = "gcomm://ip_node2,ip_node3" wsrep_cluster_name = 'Galera Cluster' wsrep_node_name = 'Node A' wsrep_sst_method = mysqldump wsrep_sst_auth = sst:secret
  • 14. www.fromdual.com 14 / 22 Initial Cluster start ● Start very 1st node with: wsrep_cluster_address = "gcomm://" or mysqld_safe ­­wsrep­cluster­address="gcomm://" ● → this tells the node to be the first one! ● All other nodes normal: service mysqld start
  • 15. www.fromdual.com 15 / 22 Rolling Restart ● Scenario: ● Hardware-, O/S-, DB- and Galera-Upgrade ● MySQL configuration change ● During full operation!!! (99.999% HA, 5x9 HA) ● → Rolling Restart ● Start one node after the other in a cycle ● New features or settings are used after Rolling Restart is completed
  • 16. www.fromdual.com 16 / 22 Load Balancing ● Connectors ● Connector/J ● PHP: MySQLnd replication and load balancing plug-in ● SW Load Balancer ● GLB, LVS/IPVS/Ldirector, HAProxy ● HW Load Balancer
  • 19. www.fromdual.com 19 / 22 Online Schema Upgrade (OSU) ● Schema Upgrade = DDL run against the DB ● Change DB structure ● Non transactional ● 2 Methods: ● Total Order Isolation (TOI) (default) ● Rolling Schema Upgrade (RSU) ● wsrep_osu_method = {TOI|RSU}
  • 20. www.fromdual.com 20 / 22 Online Schema Upgrade ● Total Order Isolation (TOI) (default) ● Part of the database is locked for the duration of the DDL. ● + Simple, predictable and guaranteed data consistency. ● - Locking operation ● Good for fast DDL operations ● Rolling Schema Upgrade (RSU) ● DDL will be only processed locally at the node. ● Node is desynchronized for the duration of the DDL processing. ● After DDL completion, delayed write sets are applied (similar to IST). ● DDL should be manually executed at each node. ● + only blocking one node at a time ● - potentially unsafe and may fail if new and old schema are incompatible ● Good for slow DDL operations
  • 21. www.fromdual.com 21 / 22 Wir suchen noch: ● Datenbank Enthusiast/in für Support / remote-DBA / Beratung
  • 22. www.fromdual.com 22 / 22 Q & A Questions ? Discussion? We have time for some face-to-face talks... ● FromDual provides neutral and independent: ● Consulting ● Remote-DBA ● Support for MySQL, Galera, Percona Server and MariaDB ● Training www.fromdual.com