SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
www.fromdual.com 
1 / 21 
High-availability with 
Galera Cluster 
for MySQL 
FromDual Company Meeting 
10. September 2014, Barcelona 
by oli.sennhauser@fromdual.com 
www.fromdual.com
www.fromdual.com 
2 / 21 
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 / 21 
High-Availability :-( 
● 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 / 21 
The Galera Cluster for MySQL
www.fromdual.com 
5 / 21 
Maintenance time... 
App 
Load balancing (LB) 
Upgrade 
RAM/HW 
O/S 
DB? 
pG 
Node 1 Node 2 
wsrewsrep 
alera replication 
Node 3 
wsrep
www.fromdual.com 
6 / 21 
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 / 21 
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 / 21 
Quorum
www.fromdual.com 
9 / 21 
Installation and Configuration
www.fromdual.com 
10 / 21 
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 / 21 
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 / 21 
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 / 21 
Operations
www.fromdual.com 
14 / 21 
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 / 21 
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 / 21 
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 / 21 
Location of Load Balancing
www.fromdual.com 
18 / 21 
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 
19 / 21 
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 
20 / 21 
We want you! 
● Database enthusiast for support / 
remote-DBA / consulting
www.fromdual.com 
21 / 21 
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

Weitere ähnliche Inhalte

Was ist angesagt?

Speeding up ps and top
Speeding up ps and topSpeeding up ps and top
Speeding up ps and top
Kirill Kolyshkin
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel Emelyanov
OpenVZ
 
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
OpenNebula Project
 

Was ist angesagt? (20)

Storage based snapshots for KVM VMs in CloudStack
Storage based snapshots for KVM VMs in CloudStackStorage based snapshots for KVM VMs in CloudStack
Storage based snapshots for KVM VMs in CloudStack
 
Customizing Virtual Machine Images - Javier Fontán
Customizing Virtual Machine Images - Javier FontánCustomizing Virtual Machine Images - Javier Fontán
Customizing Virtual Machine Images - Javier Fontán
 
Gluster volume snapshot
Gluster volume snapshotGluster volume snapshot
Gluster volume snapshot
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
NUMA and Java Databases
NUMA and Java DatabasesNUMA and Java Databases
NUMA and Java Databases
 
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
TechDay - Cambridge 2016 - OpenNebula at Harvard UniverityTechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
TechDay - Cambridge 2016 - OpenNebula at Harvard Univerity
 
Control your service resources with systemd
 Control your service resources with systemd  Control your service resources with systemd
Control your service resources with systemd
 
Speeding up ps and top
Speeding up ps and topSpeeding up ps and top
Speeding up ps and top
 
OpenNebula TechDay Waterloo 2015 - OpenNebula is Evolving Fast
OpenNebula TechDay Waterloo 2015 - OpenNebula is Evolving FastOpenNebula TechDay Waterloo 2015 - OpenNebula is Evolving Fast
OpenNebula TechDay Waterloo 2015 - OpenNebula is Evolving Fast
 
MySQL Galera 集群
MySQL Galera 集群MySQL Galera 集群
MySQL Galera 集群
 
How Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project FeedbackHow Can OpenNebula Fit Your Needs: A European Project Feedback
How Can OpenNebula Fit Your Needs: A European Project Feedback
 
Building AuroraObjects- Ceph Day Frankfurt
Building AuroraObjects- Ceph Day Frankfurt Building AuroraObjects- Ceph Day Frankfurt
Building AuroraObjects- Ceph Day Frankfurt
 
Live migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel EmelyanovLive migration: pros, cons and gotchas -- Pavel Emelyanov
Live migration: pros, cons and gotchas -- Pavel Emelyanov
 
MySQL for Oracle DBAs
MySQL for Oracle DBAsMySQL for Oracle DBAs
MySQL for Oracle DBAs
 
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
OpenNebulaConf2015 2.14 Cloud Service Experience in TeideHPC Infrastructure -...
 
Cinder Live Migration and Replication - OpenStack Summit Austin
Cinder Live Migration and Replication - OpenStack Summit AustinCinder Live Migration and Replication - OpenStack Summit Austin
Cinder Live Migration and Replication - OpenStack Summit Austin
 
OpenNebulaConf 2016 - The DRBD SDS for OpenNebula by Philipp Reisner, LINBIT
OpenNebulaConf 2016 - The DRBD SDS for OpenNebula by Philipp Reisner, LINBITOpenNebulaConf 2016 - The DRBD SDS for OpenNebula by Philipp Reisner, LINBIT
OpenNebulaConf 2016 - The DRBD SDS for OpenNebula by Philipp Reisner, LINBIT
 
How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013 How can OpenNebula fit your needs - OpenNebulaConf 2013
How can OpenNebula fit your needs - OpenNebulaConf 2013
 
Storage as a Service with Gluster
Storage as a Service with GlusterStorage as a Service with Gluster
Storage as a Service with Gluster
 
4. v sphere big data extensions hadoop
4. v sphere big data extensions   hadoop4. v sphere big data extensions   hadoop
4. v sphere big data extensions hadoop
 

Ähnlich wie High-availability with Galera Cluster for MySQL

UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
FromDual GmbH
 
MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02Mysqlhacodebits20091203 1260184765-phpapp02
Mysqlhacodebits20091203 1260184765-phpapp02
Louis liu
 

Ähnlich wie High-availability with Galera Cluster for MySQL (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...
 
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)
 
UKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL TuningUKOUG 2011: Practical MySQL Tuning
UKOUG 2011: Practical MySQL Tuning
 
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?
 
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
 
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
 
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
 
Linux Huge Pages
Linux Huge PagesLinux Huge Pages
Linux Huge Pages
 
The Accidental DBA
The Accidental DBAThe Accidental DBA
The Accidental DBA
 
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 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
 
Kubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard wayKubernetes at Datadog the very hard way
Kubernetes at Datadog the very hard way
 
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
 
Coredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS serverCoredns nodecache - A highly-available Node-cache DNS server
Coredns nodecache - A highly-available Node-cache DNS server
 
Monitoring with Ganglia
Monitoring with GangliaMonitoring with Ganglia
Monitoring with Ganglia
 
MySQL and MariaDB Backups
MySQL and MariaDB BackupsMySQL and MariaDB Backups
MySQL and MariaDB Backups
 
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
 
Open Source Data Deduplication
Open Source Data DeduplicationOpen Source Data Deduplication
Open Source Data Deduplication
 

Mehr von FromDual GmbH

Mehr von 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
 
PERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schemaPERFORMANCE_SCHEMA and sys schema
PERFORMANCE_SCHEMA and sys schema
 
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 Indexierung CeBIT 2014
MySQL Indexierung CeBIT 2014MySQL Indexierung CeBIT 2014
MySQL Indexierung CeBIT 2014
 
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
 

Kürzlich hochgeladen

No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
Sheetaleventcompany
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
Kayode Fayemi
 

Kürzlich hochgeladen (20)

No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
Busty Desi⚡Call Girls in Sector 51 Noida Escorts >༒8448380779 Escort Service-...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 

High-availability with Galera Cluster for MySQL

  • 1. www.fromdual.com 1 / 21 High-availability with Galera Cluster for MySQL FromDual Company Meeting 10. September 2014, Barcelona by oli.sennhauser@fromdual.com www.fromdual.com
  • 2. www.fromdual.com 2 / 21 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 / 21 High-Availability :-( ● 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 / 21 The Galera Cluster for MySQL
  • 5. www.fromdual.com 5 / 21 Maintenance time... App Load balancing (LB) Upgrade RAM/HW O/S DB? pG Node 1 Node 2 wsrewsrep alera replication Node 3 wsrep
  • 6. www.fromdual.com 6 / 21 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 / 21 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)
  • 9. www.fromdual.com 9 / 21 Installation and Configuration
  • 10. www.fromdual.com 10 / 21 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 / 21 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 / 21 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
  • 13. www.fromdual.com 13 / 21 Operations
  • 14. www.fromdual.com 14 / 21 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 / 21 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 / 21 Load Balancing ● Connectors ● Connector/J ● PHP: MySQLnd replication and load balancing plug-in ● SW Load Balancer ● GLB, LVS/IPVS/Ldirector, HAProxy ● HW Load Balancer
  • 17. www.fromdual.com 17 / 21 Location of Load Balancing
  • 18. www.fromdual.com 18 / 21 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}
  • 19. www.fromdual.com 19 / 21 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
  • 20. www.fromdual.com 20 / 21 We want you! ● Database enthusiast for support / remote-DBA / consulting
  • 21. www.fromdual.com 21 / 21 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