SlideShare a Scribd company logo
1 of 25
Galera Cluster Best Practices
for DBAs and DevOps
Philip Stoev
Codership Oy
Agenda
• A very quick overview of Galera Cluster
• Ongoing monitoring of the cluster and detection of
bottlenecks
• Backup strategies
• Selecting the optimal State Snapshot Transfer (SST)
method
Galera Cluster Overview
Synchronous
– each transaction is immediately replicated on all nodes at commit
– no stale slaves
Multi-Master
– read from and write to any node
– automatic transaction conflict detection
Replication
– a copy of the entire dataset is available on all nodes
– new nodes can join automatically
For MySQL
– based on a modified version of MySQL (5.5, 5.6 with 5.7 coming up)
– InnoDB storage engine
And more …
• Recovers from node failures within seconds
• Data consistency protections
– avoids reading stale data
– prevents unsafe data modifications
• Cloud and WAN support
Monitoring Galera Cluster
General Principles of Monitoring
• Galera Cluster is first and foremost MySQL + InnoDB:
– all traditional advice still applies (e.g. slow query log)
– InnoDB still does most of the heavy lifting (e.g. I/O)
• Galera reports metrics via SHOW GLOBAL STATUS
– FLUSH STATUS resets counters
• Galera reports events via the MySQL server error log
– good idea to check you logs or log rotation scripts
• Monitor each node separately for maximum visibility
Monitoring the Network
Especially in WAN or complex network environments:
• monitor the health of the network using a third-party
tool:
– round-trip (ping) times
– bandwidth utilization
• monitor each network link between any two segments
separately
– Galera assumes all links perform equally well
Detecting Issues With Cluster Health
• SHOW GLOBAL STATUS variables:
MySQL [test]> show status like '%wsrep%';
+------------------------------+-------------------------------------------+
| Variable_name | Value |
+------------------------------+-------------------------------------------+
| wsrep_ready | ON |
| wsrep_cluster_status | Primary (or non-Primary) |
| wsrep_local_state_comment | Synced (or Donor/Desynced, Joiner) |
| wsrep_cluster_size | 3 |
+------------------------------+-------------------------------------------+
Detecting Galera-Specific Bottlenecks
MySQL [test]> show global status like '%wsrep%';
+------------------------------+--------------------------------------------
+
| Variable_name | Value
|
+------------------------------+--------------------------------------------
+
| wsrep_flow_control_paused | 0.100000
|
| wsrep_flow_control_sent | 123
|
| wsrep_local_bf_aborts | 77
|
| wsrep_local_cert_failures | 24
|
+------------------------------+--------------------------------------------
+
In case of BF aborts or cert failures:
Detecting Galera-Specific Bottlenecks #2
• SHOW PROCESSLIST:
MySQL [test]> show processlist;
+----+------+-----------+------+---------+------+----------+---------------------------+
| Id | User | Host | db | Command | Time | State | Info |
+----+------+-----------+------+---------+------+----------+---------------------------+
...
| 5 | root | localhost | test | Query | 10 | query end| INSERT INTO t1 VALUES (1) |
...
3 rows in set (0.05 sec)
Backups
Backups
• Multiple nodes do not remove the need for backups
– backups also help in case of human error
• All nodes in Galera have the same information, so
backing up one node is sufficient
• Galera does not use the binary log files, so generate
and back those up only if you have a specific need
• Practicing the restore operation is highly recommended
Performance Considerations
• Backups slow down the node being backed up
– which in turn can cause the entire cluster to slow down
• or reduce the number of available nodes in the cluster
– can affect quorum calculations
• you can have an async slave and take backups from it
– Just do not let it fall far behind the master cluster
XtraBackup
Non-blocking backup for InnoDB
• --galera-info option records the precise position
when the backup was taken in a file named
xtrabackup_galera_info
• a short lock is still taken
Backup Procedure with a Dedicated Node
• Make sure backup node will get no write traffic
– make sure all existing sessions are disconnected
• Temporarily disconnect a node from the cluster
– SET GLOBAL wsrep_provider = ‘none’
• Perform backup
• Restore the value of wsrep_provider; check for
wsrep_ready=ON
Restoring Single Node from Backup
Option #1:
– wipe the data directory clean and restart
– let it rejoin the cluster via SST
– the operation will involve a donating node as well
Option #2:
– use a backup that was recently taken
– wipe the data directory clean and restore data
– put the information from xtrabackup_galera_info into grastate.dat
# GALERA saved state
version: 2.1
uuid: 021a77ed-80cf-11e6-9e8e-6249ad0d3a57
seqno: 1234
cert_index:
– restart node and it will catch up via IST
Restoring Entire Cluster #1
Note: a new logical cluster is being created
Easiest approach:
1. Restore data on one node and restart first node with –
wsrep-new-cluster
2. Start one more node. Node rejoins via SST, with first
node as donor
3. Restart two more nodes, first two nodes serve as
donors, and so forth.
Restoring Entire Cluster #2
Optimized approach:
1. Restore backup on first node, bootstrap 1-node
cluster. Prevent new transactions from being issued.
2. Restore backup on other nodes and create
grastate.dat on them:
# GALERA saved state
version: 2.1
uuid: <new-cluster-uuid>
seqno: 0
cert_index:
SST
General Principles
• It is always best to avoid SST altogether by sizing
gcache.size appropriately
• SST choice is determined by:
– availability of a dedicated donating node
– encryption requirements (SST encryption is configured
separately from other cluster operations)
– bandwidth utilization
SST Methods
• Rsync (the default)
– causes the donor to block new transactions
• XtraBackup
– Donor remains operational
• Mysqldump
– logical, rather than physical database copy
Configuration without a Dedicated Donor
• Use xtrabackup-v2 SST method
– requires the installation of XtraBackup
– there is still performance impact on the donor
– encryption, compression are available
Configuration with Dedicated Donor
• rsync may be the best method to use:
– available on any machine
– compression and partial file transfers are possible
• use wsrep_sst_donor to specify donor node to use:
– takes a list of node names as configured with
wsrep_node_name
– if the list terminates with a comma, other nodes can also be
used for donors if none of the nodes from the list are available
• if using an arbitrator, consider switching it to a full
Galera node that can then act as a dedicated donor
Questions
• Please use the Question/Chat box in the GoToWebinar
panel
• Ideas welcome for future webinars
Thank You
http://www.galeracluster.com
Discussion group:
codership-team@googlegroups.com

More Related Content

What's hot

What's hot (20)

MariaDB Galera Cluster presentation
MariaDB Galera Cluster presentationMariaDB Galera Cluster presentation
MariaDB Galera Cluster presentation
 
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
 
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
How to Secure Your Scylla Deployment: Authorization, Encryption, LDAP Authent...
 
The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS The Zen of High Performance Messaging with NATS
The Zen of High Performance Messaging with NATS
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
ProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQLProxySQL - High Performance and HA Proxy for MySQL
ProxySQL - High Performance and HA Proxy for MySQL
 
High Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando PatroniHigh Availability PostgreSQL with Zalando Patroni
High Availability PostgreSQL with Zalando Patroni
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
MySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptxMySQL8.0_performance_schema.pptx
MySQL8.0_performance_schema.pptx
 
MongoDB Administration 101
MongoDB Administration 101MongoDB Administration 101
MongoDB Administration 101
 
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
Room 3 - 7 - Nguyễn Như Phúc Huy - Vitastor: a fast and simple Ceph-like bloc...
 
Cluster management with Kubernetes
Cluster management with KubernetesCluster management with Kubernetes
Cluster management with Kubernetes
 
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
MySQL Parallel Replication: All the 5.7 and 8.0 Details (LOGICAL_CLOCK)
 
[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기[2018] MySQL 이중화 진화기
[2018] MySQL 이중화 진화기
 
Maxscale_메뉴얼
Maxscale_메뉴얼Maxscale_메뉴얼
Maxscale_메뉴얼
 
MySQL Data Encryption at Rest
MySQL Data Encryption at RestMySQL Data Encryption at Rest
MySQL Data Encryption at Rest
 
Optimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performanceOptimizing MariaDB for maximum performance
Optimizing MariaDB for maximum performance
 
MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較MySQLとPostgreSQLの基本的なレプリケーション設定比較
MySQLとPostgreSQLの基本的なレプリケーション設定比較
 
PostgreSQL Materialized Views with Active Record
PostgreSQL Materialized Views with Active RecordPostgreSQL Materialized Views with Active Record
PostgreSQL Materialized Views with Active Record
 

Viewers also liked

Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
Severalnines
 
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
Severalnines
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practices
Dimas Prasetyo
 

Viewers also liked (16)

Galera Cluster DDL and Schema Upgrades 220217
Galera Cluster DDL and Schema Upgrades 220217Galera Cluster DDL and Schema Upgrades 220217
Galera Cluster DDL and Schema Upgrades 220217
 
Taking Full Advantage of Galera Multi Master Cluster
Taking Full Advantage of Galera Multi Master ClusterTaking Full Advantage of Galera Multi Master Cluster
Taking Full Advantage of Galera Multi Master Cluster
 
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
Galera Cluster for MySQL vs MySQL (NDB) Cluster: A High Level Comparison
 
MySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinarMySQL High Availability Solutions - Feb 2015 webinar
MySQL High Availability Solutions - Feb 2015 webinar
 
Introduction to Galera
Introduction to GaleraIntroduction to Galera
Introduction to Galera
 
MariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly AvailableMariaDB Galera Cluster - Simple, Transparent, Highly Available
MariaDB Galera Cluster - Simple, Transparent, Highly Available
 
Galera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replicationGalera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replication
 
Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016Codership's galera cluster installation and quickstart webinar march 2016
Codership's galera cluster installation and quickstart webinar march 2016
 
Webinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera ClusterWebinar Slides: Migrating to Galera Cluster
Webinar Slides: Migrating to Galera Cluster
 
Zero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best PracticesZero Downtime Schema Changes - Galera Cluster - Best Practices
Zero Downtime Schema Changes - Galera Cluster - Best Practices
 
Maria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High AvailabilityMaria DB Galera Cluster for High Availability
Maria DB Galera Cluster for High Availability
 
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
Deep Dive Into How To Monitor MySQL or MariaDB Galera Cluster / Percona XtraD...
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
Galera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction SlidesGalera cluster for MySQL - Introduction Slides
Galera cluster for MySQL - Introduction Slides
 
Plny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practicesPlny12 galera-cluster-best-practices
Plny12 galera-cluster-best-practices
 
Universitas terbuka at a glance
Universitas terbuka at a glanceUniversitas terbuka at a glance
Universitas terbuka at a glance
 

Similar to Galera Cluster Best Practices for DBA's and DevOps Part 1

Cassandra
CassandraCassandra
Cassandra
exsuns
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
Paresh Patel
 
FOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with GaleraFOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with Galera
FromDual GmbH
 
London + Dublin Cassandra 2.0
London + Dublin Cassandra 2.0London + Dublin Cassandra 2.0
London + Dublin Cassandra 2.0
jbellis
 

Similar to Galera Cluster Best Practices for DBA's and DevOps Part 1 (20)

Training Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & RecoveryTraining Slides: 203 - Backup & Recovery
Training Slides: 203 - Backup & Recovery
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
 
Using Galera Cluster to Power Geo-distributed Applications on the WAN
Using Galera Cluster to Power Geo-distributed Applications on the WANUsing Galera Cluster to Power Geo-distributed Applications on the WAN
Using Galera Cluster to Power Geo-distributed Applications on the WAN
 
Migrating to XtraDB Cluster
Migrating to XtraDB ClusterMigrating to XtraDB Cluster
Migrating to XtraDB Cluster
 
Migrating to XtraDB Cluster
Migrating to XtraDB ClusterMigrating to XtraDB Cluster
Migrating to XtraDB Cluster
 
Cassandra
CassandraCassandra
Cassandra
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
Using galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wanUsing galera replication to create geo distributed clusters on the wan
Using galera replication to create geo distributed clusters on the wan
 
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
Training Slides: Intermediate 202: Performing Cluster Maintenance with Zero-D...
 
Do more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloudDo more with Galera Cluster in your OpenStack cloud
Do more with Galera Cluster in your OpenStack cloud
 
Best Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on SolarisBest Practices with PostgreSQL on Solaris
Best Practices with PostgreSQL on Solaris
 
Training Slides: Advanced 304: Upgrading From Native MySQL Replication To Tun...
Training Slides: Advanced 304: Upgrading From Native MySQL Replication To Tun...Training Slides: Advanced 304: Upgrading From Native MySQL Replication To Tun...
Training Slides: Advanced 304: Upgrading From Native MySQL Replication To Tun...
 
MySQL Galera 集群
MySQL Galera 集群MySQL Galera 集群
MySQL Galera 集群
 
Highly Available Load Balanced Galera MySql Cluster
Highly Available Load Balanced  Galera MySql ClusterHighly Available Load Balanced  Galera MySql Cluster
Highly Available Load Balanced Galera MySql Cluster
 
Galera explained 3
Galera explained 3Galera explained 3
Galera explained 3
 
FOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with GaleraFOSDEM 2012: MySQL synchronous replication in practice with Galera
FOSDEM 2012: MySQL synchronous replication in practice with Galera
 
London + Dublin Cassandra 2.0
London + Dublin Cassandra 2.0London + Dublin Cassandra 2.0
London + Dublin Cassandra 2.0
 
Overview of Postgres Utility Processes
Overview of Postgres Utility ProcessesOverview of Postgres Utility Processes
Overview of Postgres Utility Processes
 
Training Slides: Advanced 301: Multi-Site/Multi-Master Tungsten Clustering De...
Training Slides: Advanced 301: Multi-Site/Multi-Master Tungsten Clustering De...Training Slides: Advanced 301: Multi-Site/Multi-Master Tungsten Clustering De...
Training Slides: Advanced 301: Multi-Site/Multi-Master Tungsten Clustering De...
 

More from Codership Oy - Creators of Galera Cluster

More from Codership Oy - Creators of Galera Cluster (8)

Galera Cluster 4 for MySQL 8 Release Webinar slides
Galera Cluster 4 for MySQL 8 Release Webinar slidesGalera Cluster 4 for MySQL 8 Release Webinar slides
Galera Cluster 4 for MySQL 8 Release Webinar slides
 
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
Choosing between Codership's MySQL Galera, MariaDB Galera Cluster and Percona...
 
Planning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera ClusterPlanning for Disaster Recovery (DR) with Galera Cluster
Planning for Disaster Recovery (DR) with Galera Cluster
 
Running Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft AzureRunning Galera Cluster on Microsoft Azure
Running Galera Cluster on Microsoft Azure
 
How to understand Galera Cluster - 2013
How to understand Galera Cluster - 2013How to understand Galera Cluster - 2013
How to understand Galera Cluster - 2013
 
Galera Cluster 3.0 Features
Galera Cluster 3.0 FeaturesGalera Cluster 3.0 Features
Galera Cluster 3.0 Features
 
Zero Downtime Schema Changes in Galera Cluster
Zero Downtime Schema Changes in Galera ClusterZero Downtime Schema Changes in Galera Cluster
Zero Downtime Schema Changes in Galera Cluster
 
Introducing Galera 3.0
Introducing Galera 3.0Introducing Galera 3.0
Introducing Galera 3.0
 

Recently uploaded

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare%in Harare+277-882-255-28 abortion pills for sale in Harare
%in Harare+277-882-255-28 abortion pills for sale in Harare
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 

Galera Cluster Best Practices for DBA's and DevOps Part 1

  • 1. Galera Cluster Best Practices for DBAs and DevOps Philip Stoev Codership Oy
  • 2. Agenda • A very quick overview of Galera Cluster • Ongoing monitoring of the cluster and detection of bottlenecks • Backup strategies • Selecting the optimal State Snapshot Transfer (SST) method
  • 3. Galera Cluster Overview Synchronous – each transaction is immediately replicated on all nodes at commit – no stale slaves Multi-Master – read from and write to any node – automatic transaction conflict detection Replication – a copy of the entire dataset is available on all nodes – new nodes can join automatically For MySQL – based on a modified version of MySQL (5.5, 5.6 with 5.7 coming up) – InnoDB storage engine
  • 4. And more … • Recovers from node failures within seconds • Data consistency protections – avoids reading stale data – prevents unsafe data modifications • Cloud and WAN support
  • 6. General Principles of Monitoring • Galera Cluster is first and foremost MySQL + InnoDB: – all traditional advice still applies (e.g. slow query log) – InnoDB still does most of the heavy lifting (e.g. I/O) • Galera reports metrics via SHOW GLOBAL STATUS – FLUSH STATUS resets counters • Galera reports events via the MySQL server error log – good idea to check you logs or log rotation scripts • Monitor each node separately for maximum visibility
  • 7. Monitoring the Network Especially in WAN or complex network environments: • monitor the health of the network using a third-party tool: – round-trip (ping) times – bandwidth utilization • monitor each network link between any two segments separately – Galera assumes all links perform equally well
  • 8. Detecting Issues With Cluster Health • SHOW GLOBAL STATUS variables: MySQL [test]> show status like '%wsrep%'; +------------------------------+-------------------------------------------+ | Variable_name | Value | +------------------------------+-------------------------------------------+ | wsrep_ready | ON | | wsrep_cluster_status | Primary (or non-Primary) | | wsrep_local_state_comment | Synced (or Donor/Desynced, Joiner) | | wsrep_cluster_size | 3 | +------------------------------+-------------------------------------------+
  • 9. Detecting Galera-Specific Bottlenecks MySQL [test]> show global status like '%wsrep%'; +------------------------------+-------------------------------------------- + | Variable_name | Value | +------------------------------+-------------------------------------------- + | wsrep_flow_control_paused | 0.100000 | | wsrep_flow_control_sent | 123 | | wsrep_local_bf_aborts | 77 | | wsrep_local_cert_failures | 24 | +------------------------------+-------------------------------------------- + In case of BF aborts or cert failures:
  • 10. Detecting Galera-Specific Bottlenecks #2 • SHOW PROCESSLIST: MySQL [test]> show processlist; +----+------+-----------+------+---------+------+----------+---------------------------+ | Id | User | Host | db | Command | Time | State | Info | +----+------+-----------+------+---------+------+----------+---------------------------+ ... | 5 | root | localhost | test | Query | 10 | query end| INSERT INTO t1 VALUES (1) | ... 3 rows in set (0.05 sec)
  • 12. Backups • Multiple nodes do not remove the need for backups – backups also help in case of human error • All nodes in Galera have the same information, so backing up one node is sufficient • Galera does not use the binary log files, so generate and back those up only if you have a specific need • Practicing the restore operation is highly recommended
  • 13. Performance Considerations • Backups slow down the node being backed up – which in turn can cause the entire cluster to slow down • or reduce the number of available nodes in the cluster – can affect quorum calculations • you can have an async slave and take backups from it – Just do not let it fall far behind the master cluster
  • 14. XtraBackup Non-blocking backup for InnoDB • --galera-info option records the precise position when the backup was taken in a file named xtrabackup_galera_info • a short lock is still taken
  • 15. Backup Procedure with a Dedicated Node • Make sure backup node will get no write traffic – make sure all existing sessions are disconnected • Temporarily disconnect a node from the cluster – SET GLOBAL wsrep_provider = ‘none’ • Perform backup • Restore the value of wsrep_provider; check for wsrep_ready=ON
  • 16. Restoring Single Node from Backup Option #1: – wipe the data directory clean and restart – let it rejoin the cluster via SST – the operation will involve a donating node as well Option #2: – use a backup that was recently taken – wipe the data directory clean and restore data – put the information from xtrabackup_galera_info into grastate.dat # GALERA saved state version: 2.1 uuid: 021a77ed-80cf-11e6-9e8e-6249ad0d3a57 seqno: 1234 cert_index: – restart node and it will catch up via IST
  • 17. Restoring Entire Cluster #1 Note: a new logical cluster is being created Easiest approach: 1. Restore data on one node and restart first node with – wsrep-new-cluster 2. Start one more node. Node rejoins via SST, with first node as donor 3. Restart two more nodes, first two nodes serve as donors, and so forth.
  • 18. Restoring Entire Cluster #2 Optimized approach: 1. Restore backup on first node, bootstrap 1-node cluster. Prevent new transactions from being issued. 2. Restore backup on other nodes and create grastate.dat on them: # GALERA saved state version: 2.1 uuid: <new-cluster-uuid> seqno: 0 cert_index:
  • 19. SST
  • 20. General Principles • It is always best to avoid SST altogether by sizing gcache.size appropriately • SST choice is determined by: – availability of a dedicated donating node – encryption requirements (SST encryption is configured separately from other cluster operations) – bandwidth utilization
  • 21. SST Methods • Rsync (the default) – causes the donor to block new transactions • XtraBackup – Donor remains operational • Mysqldump – logical, rather than physical database copy
  • 22. Configuration without a Dedicated Donor • Use xtrabackup-v2 SST method – requires the installation of XtraBackup – there is still performance impact on the donor – encryption, compression are available
  • 23. Configuration with Dedicated Donor • rsync may be the best method to use: – available on any machine – compression and partial file transfers are possible • use wsrep_sst_donor to specify donor node to use: – takes a list of node names as configured with wsrep_node_name – if the list terminates with a comma, other nodes can also be used for donors if none of the nodes from the list are available • if using an arbitrator, consider switching it to a full Galera node that can then act as a dedicated donor
  • 24. Questions • Please use the Question/Chat box in the GoToWebinar panel • Ideas welcome for future webinars