SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Galera Cluster 
MySQL/MariaDB-tietokannan 
master-master-klusterointi 
Otto Kekäläinen 
@ottokekalainen 
SUSE & OpenSUSE -ilta 
Helsinki 27.11.2014
LINUX-JÄRJESTELMIEN 
ASIANTUNTIJA- JA TUKIPALVELUT
Kun master-slave ei riitä... 
Normaali MySQL/MariaDB pystyy tekemään replikointia 
siten, että tietokannan pääkone (master) lähettää tietoja 
varakoneeseen (slave). 
Galera tarjoaa multi-master toiminnon, eli on 
tietokannalla voi olla useampi tietokone, jotka voivat 
vastaanottaa tietoa (kirjoittaa tietokantaan) rinnakkain. 
Kehittäjä suomalainen Codership Oy
Galera-arkkitehtuuri 
read & write read & write read & write 
MariaDB MariaDB MariaDB 
Read & write mihin tahansa koneeseen 
Master-koneita voi olla useita 
Galera-replikointi Replikointi on synkronista
Galera 
MySQL/MariaDB/Percona-tietokannan 
tulee olla InnoDB/XtraDB-tyyppiä 
Klusteroinnissa pitää olla vähintään kolme 
tietokonetta – 3. koneessa voi olla koko 
tietokantaohjelman sijasta myös pelkkä 
Galera arbitrator -ohjelma
Galera 
Provisiointi on automaattista 
Koneet voi olla missä vaan (LAN/WAN) 
Galerassa on SSL/TLS-tuki, jonka voi 
tarvittaessa kytkeä päälle
Synkroninen replikointi 
Client Master Slave 
COMMIT 
replikointi 
ACK 
OK 
COMMIT 
ylimääräinen 
latenssi
Helppo ja halpa skaalautuvuus 
Aloita yhdellä tietokantapalvelimella 
Lisää toinen tietokantapalvelin (ja kolmas kone 
jossa garbd) 
Sovellukseen ei tarvitse tehdä muutoksia 
(Galera-klusteri näyttää 99,99 %:sti normaalilta 
InnoDB-taululta) 
Minimaalinen lisälatenssi vaikuttaa vain 
COMMIT-operaatioihin, eikä vältätmättä edes 
näy, koska lisäpalvelin nopeuttaa kaikkea muuta
Migraatio lennossa Galeraan? 
Lisää MySQL/MariaDB:een Galera-palvelin 
slave-tilassa. Laajenna klusteriksi ja tee 
Galerasta master. 
MySQL 
slave 
MySQL 
master 
Galera 
Node 1 
Galera 
Node 2 
Galera 
Node 3 
1 
2
Asentaminen 
Galeracluster.com: MySQL-wsrep 
MariaDB: MariaDB Galera Cluster (<10.1) 
Percona: Percona XtraDB Cluster 
Galera 3.6 (wsrep-API versio 25) on oma pakettinsa, 
mutta tulee palvelinten mukana koska API-version 
yhteensopivuus on tärkeää.
Asentaminen SUSE:een 
SUSE ja OpenSUSE-paketteja ei ole vielä virallisesti 
Galeracluster.com:ssa eikä Perconalla, ja 
MariaDB.org:stakin löytyy vain MariaDB Galera Cluster 
10.0 OpenSUSE 13:lle. 
Omat (epävakaat!) pakettini: 
https://build.opensuse.org/project/show/home:ottokek
Tukipalvelut 
Suomalainen Codership Oy + kumppanit, 
esim. suomalainen MariaDB 
http://galeracluster.com/support/
Ota yhteyttä kun haluat Seravo Oy:n 
kehittämään tai ylläpitämään 
Linux-pohjaisia tietojärjestelmiänne 
Avaa seravo.f 
Lisävinkkejä blogissamme

Weitere ähnliche Inhalte

Mehr von Otto Kekäläinen

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuOtto Kekäläinen
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itOtto Kekäläinen
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuOtto Kekäläinen
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?Otto Kekäläinen
 
Technical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionTechnical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionOtto Kekäläinen
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...Otto Kekäläinen
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...Otto Kekäläinen
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFOtto Kekäläinen
 
The 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themThe 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themOtto Kekäläinen
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressOtto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesOtto Kekäläinen
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...Otto Kekäläinen
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsOtto Kekäläinen
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Otto Kekäläinen
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetOtto Kekäläinen
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionOtto Kekäläinen
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingOtto Kekäläinen
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsOtto Kekäläinen
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017Otto Kekäläinen
 

Mehr von Otto Kekäläinen (20)

FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and UbuntuFOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
FOSDEM2021: MariaDB post-release quality assurance in Debian and Ubuntu
 
Search in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize itSearch in WordPress - how it works and howto customize it
Search in WordPress - how it works and howto customize it
 
MariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and UbuntuMariaDB quality assurance in Debian and Ubuntu
MariaDB quality assurance in Debian and Ubuntu
 
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
DebConf 2020: What’s New in MariaDB Server 10.5 and Galera 4?
 
Technical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 editionTechnical SEO for WordPress - 2019 edition
Technical SEO for WordPress - 2019 edition
 
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...The 5 most common reasons for a slow WordPress site and how to fix them – ext...
The 5 most common reasons for a slow WordPress site and how to fix them – ext...
 
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
How MariaDB packaging uses Salsa-CI to ensure smooth upgrades and avoid regre...
 
DebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoFDebConf 2019 MariaDB packaging in Debian BoF
DebConf 2019 MariaDB packaging in Debian BoF
 
The 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix themThe 5 most common reasons for a slow WordPress site and how to fix them
The 5 most common reasons for a slow WordPress site and how to fix them
 
How to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPressHow to investigate and recover from a security breach in WordPress
How to investigate and recover from a security breach in WordPress
 
Technical SEO for WordPress
Technical SEO for WordPressTechnical SEO for WordPress
Technical SEO for WordPress
 
Automatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themesAutomatic testing and quality assurance for WordPress plugins and themes
Automatic testing and quality assurance for WordPress plugins and themes
 
10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...10 things every developer should know about their database to run word press ...
10 things every developer should know about their database to run word press ...
 
Automatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress pluginsAutomatic testing and quality assurance for WordPress plugins
Automatic testing and quality assurance for WordPress plugins
 
Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)Improving WordPress performance (xdebug and profiling)
Improving WordPress performance (xdebug and profiling)
 
WordPress-tietoturvan perusteet
WordPress-tietoturvan perusteetWordPress-tietoturvan perusteet
WordPress-tietoturvan perusteet
 
Technical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 editionTechnical SEO for WordPress - 2017 edition
Technical SEO for WordPress - 2017 edition
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP Profiling
 
MariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environmentsMariaDB adoption in Linux distributions and development environments
MariaDB adoption in Linux distributions and development environments
 
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
WordPress security 101 - WP Jyväskylä Meetup 21.3.2017
 

Galera Cluster: MySQL/MariaDB-tietokannan master-master-klusterointi

  • 1. Galera Cluster MySQL/MariaDB-tietokannan master-master-klusterointi Otto Kekäläinen @ottokekalainen SUSE & OpenSUSE -ilta Helsinki 27.11.2014
  • 3. Kun master-slave ei riitä... Normaali MySQL/MariaDB pystyy tekemään replikointia siten, että tietokannan pääkone (master) lähettää tietoja varakoneeseen (slave). Galera tarjoaa multi-master toiminnon, eli on tietokannalla voi olla useampi tietokone, jotka voivat vastaanottaa tietoa (kirjoittaa tietokantaan) rinnakkain. Kehittäjä suomalainen Codership Oy
  • 4. Galera-arkkitehtuuri read & write read & write read & write MariaDB MariaDB MariaDB Read & write mihin tahansa koneeseen Master-koneita voi olla useita Galera-replikointi Replikointi on synkronista
  • 5. Galera MySQL/MariaDB/Percona-tietokannan tulee olla InnoDB/XtraDB-tyyppiä Klusteroinnissa pitää olla vähintään kolme tietokonetta – 3. koneessa voi olla koko tietokantaohjelman sijasta myös pelkkä Galera arbitrator -ohjelma
  • 6. Galera Provisiointi on automaattista Koneet voi olla missä vaan (LAN/WAN) Galerassa on SSL/TLS-tuki, jonka voi tarvittaessa kytkeä päälle
  • 7. Synkroninen replikointi Client Master Slave COMMIT replikointi ACK OK COMMIT ylimääräinen latenssi
  • 8. Helppo ja halpa skaalautuvuus Aloita yhdellä tietokantapalvelimella Lisää toinen tietokantapalvelin (ja kolmas kone jossa garbd) Sovellukseen ei tarvitse tehdä muutoksia (Galera-klusteri näyttää 99,99 %:sti normaalilta InnoDB-taululta) Minimaalinen lisälatenssi vaikuttaa vain COMMIT-operaatioihin, eikä vältätmättä edes näy, koska lisäpalvelin nopeuttaa kaikkea muuta
  • 9. Migraatio lennossa Galeraan? Lisää MySQL/MariaDB:een Galera-palvelin slave-tilassa. Laajenna klusteriksi ja tee Galerasta master. MySQL slave MySQL master Galera Node 1 Galera Node 2 Galera Node 3 1 2
  • 10. Asentaminen Galeracluster.com: MySQL-wsrep MariaDB: MariaDB Galera Cluster (<10.1) Percona: Percona XtraDB Cluster Galera 3.6 (wsrep-API versio 25) on oma pakettinsa, mutta tulee palvelinten mukana koska API-version yhteensopivuus on tärkeää.
  • 11. Asentaminen SUSE:een SUSE ja OpenSUSE-paketteja ei ole vielä virallisesti Galeracluster.com:ssa eikä Perconalla, ja MariaDB.org:stakin löytyy vain MariaDB Galera Cluster 10.0 OpenSUSE 13:lle. Omat (epävakaat!) pakettini: https://build.opensuse.org/project/show/home:ottokek
  • 12. Tukipalvelut Suomalainen Codership Oy + kumppanit, esim. suomalainen MariaDB http://galeracluster.com/support/
  • 13. Ota yhteyttä kun haluat Seravo Oy:n kehittämään tai ylläpitämään Linux-pohjaisia tietojärjestelmiänne Avaa seravo.f Lisävinkkejä blogissamme