SlideShare a Scribd company logo
Best practices for MySQL High Availability
in 2017
Colin Charles, Chief Evangelist, Percona Inc.

colin.charles@percona.com / byte@bytebot.net

http://www.bytebot.net/blog/ | @bytebot on Twitter

O’Reilly Velocity, London, United Kingdom

18 October 2017
whoami
• Chief Evangelist, Percona Inc

• Founding team of MariaDB Server (2009-2016), previously
at Monty Program Ab, merged with SkySQL Ab, now
MariaDB Corporation

• Formerly MySQL AB (exit: Sun Microsystems)

• Past lives include Fedora Project (FESCO), OpenOffice.org

• MySQL Community Contributor of the Year Award winner
2014
License
• Creative Commons BY-NC-SA 4.0

• https://creativecommons.org/licenses/by-
nc-sa/4.0/legalcode
Agenda
• Choosing the right High Availability (HA) solution

• Discuss replication

• Handling failure

• Discuss proxies

• HA in the cloud, geographical redundancy

• Sharding solutions

• MySQL 5.6/5.7 features + utilities + Fabric + Router

• What’s next?

• Break: 15:00-15:30

Recommended for you

Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & How

Standard Edition High Availability (SEHA) is the latest addition to Oracle’s high availability solutions. This presentation explains the motivation for Standard Edition High Availability, how it is implemented and the way it works currently as well as what is planned for future improvements. It was first presented during Oracle Groundbreakers Yatra (OGYatra) Online in July 2020.

high availabilitymaximum availability architecturecluster
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB

Bart Oles - Severalnines AB Organizations need an appropriate disaster recovery plan to mitigate the impact of downtime. But how much should a business invest? Designing a highly available system comes at a cost, and not all businesses and indeed not all applications need five 9's availability. We will explain fundamental disaster recovery concepts and walk you through the relevant options from the MySQL & MariaDB ecosystem to meet different tiers of disaster recovery requirements, and demonstrate how to automate an appropriate disaster recovery plan.

mysqlmariadbdisaster recovery
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers

The document discusses running MariaDB across multiple data centers. It begins by outlining the need for multi-datacenter database architectures to provide high availability, disaster recovery, and continuous operation. It then describes topology choices for different use cases, including traditional disaster recovery, geo-synchronous distributed architectures, and how technologies like MariaDB Master/Slave and Galera Cluster work. The rest of the document discusses answering key questions when designing a multi-datacenter topology, trade-offs to consider, architecture technologies, and pros and cons of different approaches.

Setting up
• Vagrant/Virtualbox

• github.com/ronaldbradford/mysql-security-tutorial 

• Docker

• wget https://bit.ly/dockerhelper 

• source ./dockerhelper

• docker_mysql | docker_percona | docker_mariadb

• Better yet, wait a while and setup MySQL Sandbox
(easiest option - Linux/macOS only)
Best practices for MySQL High Availability Tutorial
Ecosystem
Best practices for MySQL High Availability Tutorial

Recommended for you

MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes

2021년 11월 18일(목)​ - 14:00 ~ 15:00  MySQL Operator for Kubernetes          : Kubernetes 환경에서 MySQL에 대한 더 쉬운 운영  - 15:00 ~ 15:15  MySQL HA and Auto-Failover      : MySQL replication과 오픈소스 MHA를 통한 고가용성 확보

#mysql #kunbernetes
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems

PostgreSQL is a very popular and feature-rich DBMS. At the same time, PostgreSQL has a set of annoying wicked problems, which haven't been resolved in decades. Miraculously, with just a small patch to PostgreSQL core extending this API, it appears possible to solve wicked PostgreSQL problems in a new engine made within an extension.

postgresqlorioledbdatabase
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013

The document discusses intra-cluster replication in Apache Kafka, including its architecture where partitions are replicated across brokers for high availability. Kafka uses a leader and in-sync replicas approach to strongly consistent replication while tolerating failures. Performance considerations in Kafka replication include latency and durability tradeoffs for producers and optimizing throughput for consumers.

Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
Uptime
Percentile target Max downtime per year
90% 36 days
99% 3.65 days
99.5% 1.83 days
99.9% 8.76 hours
99.99% 52.56 minutes
99.999% 5.25 minutes
99.9999% 31.5 seconds

Recommended for you

Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c

Oracle Data Guard ensures high availability, disaster recovery and data protection for enterprise data. This enable production Oracle databases to survive disasters and data corruptions. Oracle 18c and 19c offers many new features it will bring many advantages to organization.

active dataguarddata guarddatabase upgrade
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021

You may be familiar with the Presto plugin used to run fast interactive queries over Pulsar using ANSI SQL and can be joined with other data sources. This plugin will soon get a rename to align with the rename of the PrestoSQL project to Trino. What is the purpose of this rename and what does it mean for those using the Presto plugin? We cover the history of the community shift from PrestoDB to PrestoSQL, as well as, the future plans for the Pulsar community to donate this plugin to the Trino project. One of the connector maintainers will then demo the connector and show what is possible when using Trino and Pulsar!

prestosqlprestodbpresto
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database

The document provides an overview of 14 topics related to Oracle Autonomous Database. It begins with how to get started with the Autonomous Database free tier and Oracle Machine Learning. It then discusses cross region data guard, exporting data as JSON to object storage, wallet rotation, partitions with external tables in cloud, set patch level when cloning, performance monitoring, data safe audit retention time increase, change concurrency limits via console, SQL monitor report, ASH analytics in performance hub, workload metrics on performance hub, and customer managed keys.

top 20 faq oracle autonomousoracle machine learning autonomous cloudoracle autonomous dba onprem cloud automation
Estimates of levels of availability
Method
Level of
Availability
Simple replication 98-99.9%
Master-Master/MMM 99%
SAN 99.5-99.9%
DRBD, MHA, Tungsten
Replicator
99.9%
NDBCluster, Galera, Group
Replication/InnoDB Cluster
99.999%
HA is Redundancy
• RAID: disk crashes? Another works

• Clustering: server crashes? Another works

• Power: fuse blows? Redundant power supplies

• Network: Switch/NIC crashes? 2nd network
route

• Geographical: Datacenter offline/destroyed?
Computation to another DC
Durability
• Data stored on disks

• Is it really written to the disk?

• being durable means calling fsync() on
each commit

• Is it written in a transactional way to
guarantee atomicity, crash safety, integrity?
High Availability for databases
• HA is harder for databases

• Hardware resources and data need to be redundant

• Remember, this isn’t just data - constantly changing
data

• HA means the operation can continue uninterrupted,
not by restoring a new/backup server

• uninterrupted: measured in percentiles

Recommended for you

ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview

The document provides an overview of high availability and configuration management options for ProxySQL. It discusses deploying ProxySQL locally on application servers, in a dedicated layer, or using both approaches. When deploying in a dedicated layer, options for high availability include keepalived, load balancers, Consul, and Kubernetes. Configuration can be managed through tools like Ansible, Puppet, or by loading SQL files. ProxySQL Cluster enables syncing configuration across nodes.

mysqlproxysqlconfiguration management
Automated master failover
Automated master failoverAutomated master failover
Automated master failover

Automated, Non-Stop MySQL Operations and Failover discusses automating master failover in MySQL to minimize downtime. The goal is to have no single point of failure by automatically promoting a slave as the new master when the master goes down. This is challenging due to asynchronous replication and the possibility that not all slaves have received the same binary log events from the crashed master. Differential relay log events must be identified and applied to bring all slaves to an eventually consistent state.

mysql
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC

This document discusses the top 5 reasons to deploy applications on Oracle Real Application Clusters (RAC). It discusses how RAC provides: 1. Developer productivity through transparency that allows developers to focus on application code without worrying about high availability or scalability. 2. Integrated scalability for both applications and database features through techniques like parallel execution and cache fusion that allow linear scaling. 3. Seamless high availability for the entire application stack through capabilities like fast reconfiguration times and zero data loss that prevent application outages. 4. Isolated consolidation for converged use cases through features like pluggable database isolation that allow secure sharing of hardware resources. 5. Full flexibility to choose deployment options

oracle racracoracle database
Redundancy through client-side XA
transactions
• Client writes to 2 independent but
identical databases

• HA-JDBC (http://ha-jdbc.github.io/) 

• No replication anywhere
InnoDB “recovery” time
•innodb_log_file_size
• larger = longer recovery times

• Percona Server 5.5 (XtraDB) -
innodb_recovery_stats
Redundancy through shared storage
• Requires specialist hardware, like a SAN

• Complex to operate

• One set of data is your single point of failure

• Cold standby

• failover 1-30 minutes

• this isn’t scale-out
Redundancy through disk replication
• DRBD

• Linux administration vs. DBA skills

• Synchronous

• Second set of data inaccessible for use

• Passive server acting as hot standby

• Failover: 1-30 minutes

• Performance hit: DRBD worst case is ~60% single node
performance, with higher average latencies

Recommended for you

Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium

We have covered the need for CDC and the benefits of building a CDC pipeline. We will compare various CDC streaming and reconciliation frameworks. We will also cover the architecture and the challenges we faced while running this system in the production. Finally, we will conclude the talk by covering Apache Hudi, Schema Registry and Debezium in detail and our contributions to the open-source community.

big datacdcapache hudi
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf

MySQL is still hot, with Percona XtraDB Cluster (PXC) and MariaDB Server. Welcome back post-pandemic to see what is on offer in the current ecosystem. Did you know that Amazon RDS now uses semi-sync replication rather than DRBD for multi-AZ deployments? Did you know that Galera Cluster for MySQL 8 is much more efficient with CLONE SST rather than using the xtrabackup method for SST? Did you know that Percona Server continues to extend MyRocks? Did you know that MariaDB Server has more Oracle syntax compatibility? This and more will be covered in the session, while short and quick, should leave you wandering to discover new features for production.

#mysql #mysql8 #mariadb #opensource #databases
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached

Introduction to memcached, a caching service designed for optimizing performance and scaling in the web stack, seen from perspective of MySQL/PHP users. Given for 2nd year students of professional bachelor in ICT at Kaho St. Lieven, Gent.

phpmysqlikdoeict
Best practices for MySQL High Availability Tutorial
MySQL Sandbox
• Great for testing various versions of MySQL/
Percona Server/MariaDB

• Great for creating replication environments

• make_sandbox mysql.tar.gz

•make_replication_sandbox
mysql.tar.gz
• http://mysqlsandbox.net/
Redundancy through MySQL replication
• MySQL replication

• Tungsten Replicator

• Galera Cluster

• MySQL Group Replication

• MySQL Cluster (NDBCLUSTER)

• Storage requirements are multiplied

• Huge potential for scaling out
MySQL Replication
• Statement based generally

• Row based became available in 5.1, and the default in 5.7

• mixed-mode, resulting in STATEMENT except if calling

• UUID function, UDF, CURRENT_USER/USER function, LOAD_FILE
function

• 2 or more AUTO_INCREMENT columns updated with same statement

• server variable used in statement

• storage engine doesn’t allow statement based replication, like
NDBCLUSTER

• default in MariaDB Server 10.2 onwards

Recommended for you

MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive

Detailed technical material about MyRocks -- RocksDB storage engine for MySQL -- https://github.com/facebook/mysql-5.6

myrocksmysqlrocksdb
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx

개발자를 위한 MySQL의 기본 이해.

OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...

The MySQL world is full of tradeoffs and choosing a High Availability (HA) solution is no exception. This session aims to look at all of the alternatives in an unbiased nature. While the landscape will be covered, including but not limited to MySQL replication, MHA, DRBD, Galera Cluster, etc. the focus of the talk will be what is recommended for today, and what to look out for. Thus, this will include extensive deep-dive coverage of ProxySQL, semi-sync replication, Orchestrator, MySQL Router, and Galera Cluster variants like Percona XtraDB Cluster and MariaDB Galera Cluster. I will also touch on group replication. Learn how we do this for our nearly 4000+ customers!

mysqlopen source data center conferenceosdc 2018
MySQL Replication II
• Asynchronous by default

• Semi-synchronous plugin in 5.5+

• However the holy grail of fully synchronous replication
is not part of standard MySQL replication (yet?)

• MariaDB Galera Cluster is built-in to MariaDB Server
10.1

• Group replication plugin for MySQL 5.7 / Percona
Server 5.7
The logs
• Binary log (binlog) - events that describe database
changes

• Relay log - events read from binlog on master,
written by slave i/o thread

• master_info_log - status/config info for slave’s
connection to master

• relay_log_info_log - status info about execution
point in slave’s relay log
Semi-synchronous replication
• semi-sync capable slave acknowledges transaction
event only after written to relay log & flushed to disk

• timeout occurs? master reverts to async
replication; resumes when slaves catch up

• at scale, Facebook runs semi-sync: http://
yoshinorimatsunobu.blogspot.com/2014/04/semi-
synchronous-replication-at-facebook.html
Semi-sync II
• nowadays, its enhanced (COMMIT method):
1. prepare transaction in storage engine
2. write transaction to binlog, flush to disk
3. wait for at least one slave to ack binlog event
4. commit transaction to storage engine

Recommended for you

Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability

Best practices for MySQL/MariaDB Server/Percona Server High Availability - presented at Percona Live Amsterdam 2016. The focus is on picking the right High Availability solution, discussing replication, handling failure (yes, you can achieve a quick automatic failover), proxies (there are plenty), HA in the cloud/geographical redundancy, sharding solutions, how newer versions of MySQL help you, and what to watch for next.

high availabilityfailoverplams16
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...

Scalability with MariaDB and MaxScale talks about MariaDB 10, and MaxScale, a pluggable router for your queries. These are technologies developed at MariaDB Corporation, made opensource, and will help scale your MariaDB and MySQL workloads

dbts-tokyo-2014
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)

MariaDB is like the "new" MySQL, and its available everywhere. This talk was given at LinuxCon Europe in Dublin in October 2015. Learn about all the new features, considering the release was just around the corner. Changes in replication are also very interesting

mysqlmariadb
MySQL Replication in 5.6
• Global Transaction ID (GTID)

• Server UUID

• Ignore (master) server IDs (filtering)

• Per-schema multi-threaded slave

• Group commit in the binary log

• Binary log (binlog) checksums

• Crash safe binlog and relay logs

• Time delayed replication

• Parallel replication (per database)
MySQL Replication in 5.7
• Multi-source replication

• Online GTID implementation

• Loss-less semi-sync

• Intra-schema parallel replication

• Group commit tuning

• Online CHANGE MASTER TO w/o stopping replication
thread

• GTIDs in the OK packet
crash-safe binlog
• MariaDB 5.5 checkpoints after every commit —> expensive!
• 5.5/5.6 stalls commits around binlog rotate, waiting for all prepared
transactions to commit (since crash recovery can only scan latest
binlog file)
crash-safe binlog 10.0
• 10.0 makes binlog checkpoints asynchronous
• A binlog can have no checkpoints at all
• Ability to scan multiple binlogs during crash recovery
• Remove stalls around binlog rotates

Recommended for you

Meet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web SummitMeet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web Summit

Meet MariaDB 10.1 at the Bulgaria Web Summit, held in Sofia in February 2016. Learn all about MariaDB Server, and the new features like encryption, audit plugins, and more.

mariadb servermysqlmariadb
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup

Presented at the Tokyo MariaDB Server meetup in July 2016, this is an overview of what you can see and use in MariaDB Server 10.1, but more importantly what is planned to arrive in 10.2

mariadb servermysqlmariadb
MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC

MariaDB 10: A MySQL Replacement. Current up to 10.0.9, right before the 10.0.10 GA release presented the weekend before the release in Hong Kong, at the Hong Kong Open Source Conference.

mysqlhkoscmariadb
Group commit in MariaDB 10.1
• Tricky locking issues hard to change without getting deadlocks sometimes
• mysql#68251, mysql#68569
• New code? Binlog rotate in background thread (further reducing stalls). Split transactions
across binlogs, so big transactions do not lead to big binlog files
• Works with enhanced semi-sync replication (wait for slave before commit on the master
rather than after commit)
Replication: START TRANSACTION
WITH CONSISTENT SNAPSHOT
• Works with the binlog, possible to obtain the binlog position corresponding to a
transactional snapshot of the database without blocking any other queries.
• by-product of group commit in the binlog to view commit ordering (MariaDB
Server 5.3+, Percona Server for MySQL 5.6+)
• Used by the command mysqldump--single-transaction --master-
data to do a fully non-blocking backup
• Works consistently between transactions involving more than one storage engine
• Originally from MariaDB Server, but is present in MySQL 5.7+
• Percona Server enhanced it by adding session ID, and also introducing backup locks
Multi-source replication
• Multi-source replication - (real-time) analytics, shard provisioning, backups, etc.
• @@default_master_connection contains current connection name
(used if connection name is not given)
• All master/slave commands take a connection name now (like CHANGE
MASTER “connection_name”, SHOW SLAVE “connection_name” STATUS, etc.)
• Remember syntax differences in MySQL 5.7 and MariaDB Server 10.0+
• also there are channel limitation differences (256 vs 64, which “grows”)
Global Transaction ID (GTID)
• Supports multi-source replication
• GTID can be enabled or disabled independently and online for masters or slaves
• Slaves using GTID do not have to have binary logging enabled.
• (MariaDB Server) Supports multiple replication domains (independent binlog streams)
• Queries in different domains can be run in parallel on the slave.

Recommended for you

Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?

The myriad reasons why you want to use MariaDB over stock MySQL. Current up to MariaDB 5.3, and presented at Percona Live London 2011.

percona livemariadbpercona live london
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...

There are many Galera Cluster distributions and sometimes differences are well worth noting. We get a lot of queries about which Galera Cluster to use, or why one should use one distribution over the other. Learn about Galera Cluster with MySQL 5.7 from Codership, and we’ll compare it with Galera Cluster 4 with MariaDB 10.4, and Percona XtraDB Cluster 5.7 with Galera 3. This is also the webinar where we preview Galera Cluster 4 with MySQL 8.0 as well as compare it with the preview release of Percona XtraDB Cluster 8.0. Overall, learn why distributions exists, and how you can get the most out of your Galera Cluster experience.

galera clustermariadb galera clusterpercona xtradb cluster
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014

MariaDB Enterprise & MariaDB Enterprise Cluster, webinar by Ivan Zoratti. Presented on 1.7.2014 as a MariaDB webinar.

mariadbmysqlmariadb enterprise cluster
Why is MariaDB Server GTID is different compared
to MySQL 5.6?
• MySQL 5.6 GTID does not support multi-source replication (only 5.7
supports this)
• Supports —log-slave-updates=0 for efficiency (like 5.7)
• Enabled by default
• Turn it on without having to restart the topology (just like 5.7)
Crash-safe slave (w/InnoDB DML)
• Replace non-transactional file relay_log.info with transactional
mysql.rpl_slave_state
• Changes to rpl_slave_state are transactionally recovered after
crash along with user data.
Crash-safe slaves in 5.6?
• Not using GTID
• you can put relay-log.info into InnoDB table, that gets updated along w/trxn
• Using GTID
• relay-log.info not used. Slave position stored in binlog on slave (—log-slave-updates required)
• Using parallel replication
• Uses a different InnoDB table for this use case
Replication domains
• Keep central concept that replication is just applying events in-order from a serial
binlog stream.
• Allow multi-source replication with multiple active masters
• Let’s the DBA configure multiple independent binlog streams (one per active
master: mysqld --git-domain-id=#)
• Events within one stream are ordered the same across entire replication topology
• Events between different streams can be in different order on different servers
• Binlog position is one ID per replication domain
Unique to
MariaDB

Recommended for you

MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment

This summary provides an overview of the key points from the document: 1. The document is a presentation on MySQL replication scalability and reliability given at dataops.barcelona in June 2019. It covers topics like introduction to replication, use cases for replication like read scaling and high availability, and best practices. 2. The presentation provides an overview of MySQL replication including what it is, why you would use it, and how it works at a high level. It also discusses tools for monitoring and visualizing replication topology. 3. Challenges like replication lag are discussed along with techniques to prevent and address lag, such as transaction design practices and throttling. Advanced topics like parallel replication are also mentioned.

mariadb servermysqlreliability
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt

MariaDB und mehr Presented by Ralf Gebhardt at the MariaDB Roadshow Germany: 4.7.2014 in Hamburg, 8.7.2014 in Berlin and 11.7.2014 in Frankfurt.

mariadbmysql
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures

This is my third iteration of the talk presented in Tokyo, Japan - first was at a keynote at rootconf.in in April 2016, then at the MySQL meetup in New York, and now for dbtechshowcase. The focus is on database failures of the past, and how modern MySQL / MariaDB Server technologies could have helped them avoid such failure. The focus is on backups and verification, replication and failover, and security and encryption.

mysqlsecurityencrypytion
Parallel (//) replication
• MySQL 5.6: schema based // replication

• MariaDB Server 10.0: domain id + group
commit // replication + per table

• MariaDB Server 10.1: optimistic // replication

• MySQL 5.7: logical clock // replication (interval
based)

• MySQL 8: write set parallelism identification
Parallel replication 2
• MySQL 5.7

•SET GLOBAL slave_parallel_workers=N
• DATABASE: schema based // replication

• LOGICAL_CLOCK: interval in binlog

• “out-of-order” // replication uses gaps (START SLAVE UNTIL
SQL_AFTER_MTS_GAPS;)

• slave_preserve_commit_order=1 (no gaps, but log-slave-updates must
be on)

• Slow down master to speed up slave?

•binlog_group_commit_sync_delay
•binlog_group_commit_sync_no_delay_count
Intervals vs. commit ids
• MariaDB has “commit id”

•#150316 11:33:46 ... GTID 0-1-185 cid=2335
• MySQL 5.7 has

• sequence_number: increasing id for each transaction (not the GTID)

• last_committed: sequence number of latest transaction on which
transaction depends on

• Interval is last_committed/sequence_number pair

•#170206 20:08:33 ... last_committed=6205
sequence_number=6207
All in… sometimes it can get out of sync
• Changed information on slave directly

• Statement based replication

• non-deterministic SQL (UPDATE/DELETE with LIMIT and without ORDER BY)

• triggers & stored procedures

• Master in MyISAM, slave in InnoDB (deadlocks)

• --replication-ignore-db with fully qualified queries

• Binlog corruption on master

• PURGE BINARY LOGS issued and not enough files to update slave

• read_buffer_size larger than max_allowed_packet

• Timezones matter! (UTC+0 is great)

• Bugs?

Recommended for you

Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster

Oracle’s InnoDB Cluster vs. Continuent Tungsten Clusters for MySQL Building a Geo-Distributed, Multi-Region and Highly Available MySQL Cloud Back-End This is the fifth of our High Noon series covering MySQL clustering solutions for high availability (HA), disaster recovery (DR), and geographic distribution. InnoDB Cluster uses MySQL’s group replication to handle the replication. It’s also known as semi-synchronous replication. Learn about this and more in this webinar! You may use Tungsten Clustering with native MySQL, MariaDB or Percona Server for MySQL in GCP, AWS, Azure, and/or on-premises data centers for better technological capabilities, control, and flexibility. But learn about the pros and cons! AGENDA - Goals for the High Noon Webinar Series - High Noon Series: Tungsten Clustering vs Others - Oracle InnoDB Cluster - Key Characteristics - Certification-based Replication - InnoDB Cluster Multi-Site Requirements - Limitations Using InnoDB Cluster - How to do better MySQL HA / DR / Geo-Distribution? - InnoDB Cluster vs Tungsten Clustering - About Continuent & Its Solutions PRESENTER Matthew Lang - Customer Success Director – Americas, Continuent - has over 25 years of experience in database administration, database programming, and system architecture, including the creation of a database replication product that is still in use today. He has designed highly available, scaleable systems that have allowed startups to quickly become enterprise organizations, utilizing a variety of technologies including open source projects, virtualization and cloud.

mysqlmariadbgeographic distribution
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability

This document discusses various MySQL high availability solutions and best practices. It begins with an introduction to the presenter and their background and experience. Then it discusses the problems of redundancy, scaling, and high availability that these solutions aim to address. Several specific solutions are covered in detail, including Galera Cluster, master-slave replication, MySQL Cluster, Group Replication, MaxScale, MySQL Router, and MySQL InnoDB Cluster. Key features of each are summarized. The document concludes with an invitation for questions.

databasemysqlhighavailability
Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0

MySQL and MariaDB are becoming more divergent. Learn what is different from a high level. It is also a good idea to ensure that you use the correct database for the correct job.

mysqlmariadbmariadb server
Replication Monitoring
• Percona Toolkit is important

• pt-slave-find: find slave information from master

• pt-table-checksum: online replication
consistency check

• executes checksum queries on master

• pt-table-sync: synchronise table data efficiently

• changes data, so backups important
Replication Monitoring with PMM
•http://pmmdemo.percona.com/
Setting up PMM
• https://www.percona.com/doc/percona-
monitoring-and-management/index.html 

• docker pull percona/pmm-server:latest

• docker run ... -e
ORCHESTRATOR_ENABLED=true
Statement Based Replication Binlog
$ mysqlbinlog mysql-bin.000001 

# at 3134

#140721 13:59:57 server id 1 end_log_pos 3217 CRC32 0x974e3831 	 Query	 thread_id=9	 exec_time=0	
error_code=0

SET TIMESTAMP=1405943997/*!*/;

BEGIN
/*!*/;

# at 3217

#140721 13:59:57 server id 1 end_log_pos 3249 CRC32 0x8de28161 	 Intvar

SET INSERT_ID=2/*!*/;

# at 3249

#140721 13:59:57 server id 1 end_log_pos 3370 CRC32 0x121ef29f 	 Query	 thread_id=9	 exec_time=0	
error_code=0

SET TIMESTAMP=1405943997/*!*/;

insert into auto (data) values ('a test 2')
/*!*/;

# at 3370

#140721 13:59:57 server id 1 end_log_pos 3401 CRC32 0x34354945 	 Xid = 414
COMMIT/*!*/;

Recommended for you

MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar

The document discusses MySQL 5.6 replication features including: - Multi-threaded replication which allows parallel application of transactions to different databases for increased slave throughput. - Binary log group commit which increases master performance by committing multiple transactions as a group to the binary log. - Optimized row-based replication which reduces binary log size and network bandwidth by only replicating changed row elements. - Global transaction identifiers which simplify tracking replication across clusters and identifying the most up-to-date slave for failover. - Crash-safe slaves which store replication metadata in tables, allowing automatic recovery of slaves and binary logs after failures.

mysql
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesA26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles

The document discusses MariaDB 5.5 and the future of MariaDB, noting that MariaDB aims to be a drop-in replacement for MySQL that is fully compatible but with additional features; it provides an overview of MariaDB's history and major releases from 5.1 to 5.5; and it outlines some of MariaDB's goals and plans for the future, including the 10.0 release and incorporating additional storage engines.

dbts2012
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)

This document provides an overview of MariaDB 10 and the MariaDB Foundation. It discusses the history and development of MariaDB, including key features added in versions 5.1 through 10.0 such as new storage engines, performance improvements, and features backported from MySQL. It outlines the goals of MariaDB to be compatible with MySQL while adding new features, and describes the community-led development model. The roadmap aims to have MariaDB be a drop-in replacement for MySQL 5.6 by releasing version 10.1.

Dynamic replication variable control
•SET GLOBAL
binlog_format=‘STATEMENT’ |
‘ROW’ | ‘MIXED’
• Can also be set as a session level

• Dynamic replication filtering variables on
MariaDB 5.3+, MySQL 5.7+
Row based replication event
> mysqlbinlog mysql-bin.*

# at 3401

#140721 14:03:59 server id 1 end_log_pos 3477 CRC32 0xa37f424a 	 Query	 thread_id=9	 exec_time=0	 error_code=0

SET TIMESTAMP=1405944239.559237/*!*/;

BEGIN

/*!*/;

# at 3477

#140721 14:03:59 server id 1 end_log_pos 3529 CRC32 0xf4587de5 	 Table_map: `demo`.`auto` mapped to number 80

# at 3529

#140721 14:03:59 server id 1 end_log_pos 3585 CRC32 0xbfd73d98 	 Write_rows: table id 80 flags: STMT_END_F

BINLOG '
rwHNUxMBAAAANAAAAMkNAAAAAFAAAAAAAAEABGRlbW8ABGF1dG8AAwMRDwMGZAAE5X1Y9A==
rwHNUx4BAAAAOAAAAAEOAAAAAFAAAAAAAAEAAgAD//gDAAAAU80BrwiIhQhhIHRlc3QgM5g9178=
'/*!*/;
# at 3585

#140721 14:03:59 server id 1 end_log_pos 3616 CRC32 0x5f422fed 	 Xid = 416

COMMIT/*!*/;
mysqlbinlog versions
•ERROR: Error in
Log_event::read_log_event(): 'Found
invalid event in binary log', data_len:
56, event_type: 30
• 5.6 ships with a “streaming binlog backup server” -
v.3.4; MariaDB 10 doesn’t - v.3.3 (fixed in 10.2 -
MDEV-8713)

• GTID variances!
GTID
# at 471
#140721 14:20:01 server id 1 end_log_pos 519 CRC32 0x209d8843 GTID [commit=yes]
SET @@SESSION.GTID_NEXT= 'ff89bf58-105e-11e4-b2f1-448a5b5dd481:2'/*!*/;
# at 519
#140721 14:20:01 server id 1 end_log_pos 602 CRC32 0x5c798741 Querythread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=1405945201.329607/*!*/;
BEGIN
/*!*/;
# at 602
# at 634
#140721 14:20:01 server id 1 end_log_pos 634 CRC32 0xa5005598 Intvar
SET INSERT_ID=5/*!*/;
#140721 14:20:01 server id 1 end_log_pos 760 CRC32 0x0b701850 Querythread_id=3 exec_time=0 error_code=0
SET TIMESTAMP=1405945201.329607/*!*/;
insert into auto (data) values ('a test 5 gtid')
/*!*/;
# at 760
#140721 14:20:01 server id 1 end_log_pos 791 CRC32 0x497a23e0 Xid = 31
COMMIT/*!*/;

Recommended for you

MariaDB: The 2012 Edition
MariaDB: The 2012 EditionMariaDB: The 2012 Edition
MariaDB: The 2012 Edition

MariaDB is a community developed branch of MySQL that is feature enhanced and backward compatible. It aims to be a 100% drop-in replacement for MySQL that is stable, bug-free, and released under the GPLv2 license. Major releases of MariaDB include new storage engines like XtraDB and Aria, as well as new features for performance, scalability, and compatibility. MariaDB is developed as an open source project and supported by Monty Program and other community contributors and service providers.

mysqlpercona livemariadb
What is MariaDB Server 10.3?
What is MariaDB Server 10.3?What is MariaDB Server 10.3?
What is MariaDB Server 10.3?

MariaDB Server 10.3 is a culmination of features from MariaDB Server 10.2+10.1+10.0+5.5+5.3+5.2+5.1 as well as a base branch from MySQL 5.5 and backports from MySQL 5.6/5.7. It has many new features, like a GA-ready sharding engine (SPIDER), MyRocks, as well as some Oracle compatibility, system versioned tables and a whole lot more.

mariadb servermysqldatabase
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud

Presented at OSCON 2018. A review of what is available from MySQL, MariaDB Server, MongoDB, PostgreSQL, and more. Covering your choices, considerations, versions, access methods, cost, a deeper look at RDS and if you should run your own instances or not.

mysqlclouddatabase
SHOW SLAVE STATUS
mysql> show slave statusG

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: server1

Master_User: repluser

Master_Port: 3306

...

Master_Log_File: server1-binlog.000008	 	 <- io_thread (read)

Read_Master_Log_Pos: 436614719	 	 	 <- io_thread (read)

Relay_Log_File: server2-relaylog.000007	 	 <- io_thread (write)

Relay_Log_Pos: 236	 	 	 	 	 	 <- io_thread (write)

Relay_Master_Log_File: server1-binlog.000008	 <- sql_thread

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

...

Exec_Master_Log_Pos: 436614719	 	 	 <- sql_thread

...

Seconds_Behind_Master: 0
Slave prefetching
• Replication Booster

• https://github.com/yoshinorim/replication-booster-
for-mysql

• Prefetch MySQL relay logs to make the SQL thread
faster

• Tungsten has slave prefetch

• Percona Server till 5.6 + MariaDB till 10.1 have
InnoDB fake changes
What replaces slave prefetching?
• In Percona Server 5.7, slave prefetching has
been replaced by doing intra-schema
parallel replication

• Feature removed from Percona XtraDB
storage engine

• MariaDB Server 10.2 uses InnoDB so use
intra-schema parallel replication too
Tungsten Replicator
• Replaces MySQL Replication layer

• MySQL writes binlog, Tungsten reads it and uses its own replication
protocol

• Global Transaction ID

• Per-schema multi-threaded slave

• Heterogeneous replication: MySQL <-> MongoDB <-> PostgreSQL <->
Oracle

• Multi-master replication

• Multiple masters to single slave (multi-source replication)

• Many complex topologies

• Continuent Tungsten (Enterprise) vs Tungsten Replicator (Open Source)

Recommended for you

MySQL features missing in MariaDB Server
MySQL features missing in MariaDB ServerMySQL features missing in MariaDB Server
MySQL features missing in MariaDB Server

MySQL features missing in MariaDB Server. Here's an overview from the New York developer's Unconference in February 2018. This is primarily aimed at the developers, to decide what goes into MariaDB 10.4, as opposed to users. High level comparisons are made between MySQL 5.6/5.7 with of course MySQL 8.0 as well. Here's to ensuring MariaDB Server 10/310.4 has more "Drop-in" compatibility.

mysqlmariadbmariadb server
The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it! The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it!

You're a busy DBA thinking about having to maintain a mix of this. Or you're a CIO planning to choose one branch over another. How do you go about picking? Supporting multiple databases? Find out more in this talk. Also covered is a deep-dive into what feature differences exist between MySQL/Percona Server/MariaDB Server. Within 20 minutes, you'll leave informed and knowledgable on what to pick. A base blog post to get started: https://www.percona.com/blog/2017/11/02/mysql-vs-mariadb-reality-check/

mysqlmariadbmariadb server
Databases in the Hosted Cloud
Databases in the Hosted CloudDatabases in the Hosted Cloud
Databases in the Hosted Cloud

With a focus on Amazon AWS RDS MySQL and PostgreSQL, Rackspace cloud, Google Cloud SQL, Microsoft Azure for MySQL and PostgreSQL as well as a hint of the other clouds

postgresqlmysqlcloud
In today’s world, what does it offer?
•opensource MySQL <-> Oracle replication to aid in your
migration
• automatic failover without MHA
• multi-master with cloud topologies too
•Oracle <-> Oracle replication (this is like Golden Gate for
FREE)
• Replication from MySQL to MongoDB
• Data loading into Hadoop
Galera Cluster
• Inside MySQL, a replication plugin (wsrep)

• Replaces MySQL replication (but can work alongside it
too)

• True multi-master, active-active solution

• Virtually Synchronous

• WAN performance: 100-300ms/commit, works in parallel

• No slave lag or integrity issues

• Automatic node provisioning
Best practices for MySQL High Availability Tutorial
Percona XtraDB Cluster 5.7
• Engineering within Percona

• Load balancing with ProxySQL (bundled)

• Integration with Percona Monitoring &
Management (PMM)

• Benefits of all the MySQL 5.7 feature-set

Recommended for you

Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)

Engineering that goes into making Percona Server for MySQL 5.6 & 5.7 different (and a hint of MongoDB) for dbtechshowcase 2017 - the slides also have some Japanese in it. This should help a Japanese audience to read it. If there are questions due to poor translation, do not hesitate to drop me an email (byte@bytebot.net) or tweet: @bytebot

dbtechshowcasehigh availabilityjapan
Capacity planning for your data stores
Capacity planning for your data storesCapacity planning for your data stores
Capacity planning for your data stores

Databases require capacity planning (and to those coming from traditional RDBMS solutions, this can be thought of as a sizing guide). Capacity planning prevents resource exhaustion. Capacity planning can be hard. This talk has a heavier leaning on MySQL, but the concepts and addendum will help with any other data store.

rootconfcapacity planningdatabase
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale

This document discusses MySQL proxy technologies including MySQL Router, ProxySQL, and MariaDB MaxScale. It provides an overview of each technology, including when they were released, key features, and comparisons between them. ProxySQL is highlighted as a popular option currently with integration with Percona tools, while MySQL Router may become more widely used due to its support for MySQL InnoDB Cluster. MariaDB MaxScale is noted for its binlog routing capabilities. Overall the document aims to help people understand and choose between the different MySQL proxy options.

fosdemfosdem2017proxy
Group replication
• Virtually fully synchronous replication (update everywhere), self-
healing, with elasticity, redundancy

• Single primary mode supported

• MySQL InnoDB Cluster - a combination of group replication, Router,
to make magic!

• Recent blogs:

• https://www.percona.com/blog/2017/02/24/battle-for-synchronous-
replication-in-mysql-galera-vs-group-replication/

• https://www.percona.com/blog/2017/02/15/group-replication-
shipped-early/
MySQL NDBCLUSTER
• 3 types of nodes: SQL, data and management

• MySQL node provides interface to data. Alternate API’s available:
LDAP, memcached, native NDBAPI, node.js

• Data nodes (NDB storage)

• different to InnoDB

• transactions synchronously written to 2 nodes (or more) - replicas

• transparent sharding: partitions = data nodes/replicas

• automatic node provisioning, online re-partitioning

• High performance: 1 billion updates / minute
Summary of Replication Performance
• SAN has "some" latency overhead compared to local disk. Can be
great for throughput.

• DRBD = potentially 50% performance penalty

• Replication, when implemented correctly, has no performance
penalty

• But MySQL replication with disk bound data set has single-
threaded issues!

• Semi-sync is poorer on WAN compared to async

• Galera & NDB provide read/write scale-out, thus more performance
Handling failure
• How do we find out about failure?

• Polling, monitoring, alerts...

• Error returned to and handled in client side

• What should we do about it?

• Direct requests to the spare nodes (or DCs)

• How to protect data integrity?

• Master-slave is unidirectional: Must ensure there is only one master at all
times.

• DRBD and SAN have cold-standby: Must mount disks and start mysqld.

• In all cases must ensure that 2 disconnected replicas cannot both commit
independently. (split brain)

Recommended for you

Lessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companiesLessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companies

A last minute talk for the people at DevOps Amsterdam, happening around the same time as O'Reilly Velocity Amsterdam 2016. Here are lessons one can learn from distributed/remote/virtual communities and companies from someone that has spent a long time being remote and distributed.

distributedvirtualcommunity
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?

Forking Successfully or do you think a branch will work better? Learn from history, see what's current, etc. Presented at OSCON London 2016. This is forking beyond the github generation. And if you're going to do it, some tips on how you could be successful.

mariadbgnu emacsxemacs
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQL

At the MariaDB Server Developer's meeting in Amsterdam, Oct 8 2016. This was the deck to talk about what MariaDB Server 10.1/10.2 might be missing from MySQL versions up to 5.7. The focus is on compatibility of MariaDB Server with MySQL.

mysqlmariadb servermariadb
Frameworks to handle failure
• MySQL-MMM

• Severalnines ClusterControl

• Orchestrator

• MySQL MHA

• Percona Replication Manager

• Tungsten Replicator

• 5.6: mysqlfailover, mysqlrpladmin

• Replication Manager
MySQL-MMM
• You have to setup all nodes and replication manually

• MMM gives Monitoring + Automated and manual failover on top

• Architecture consists of Monitor and Agents

• Typical topology: 

• 2 master nodes 

• Read slaves replicate from each master

• If a master dies, all slaves connected to it are stale

• http://mysql-mmm.org/
Severalnines ClusterControl
• Started as automated deployment of MySQL NDB Cluster

• now: 4 node cluster up and running in 5 min!

• Now supports 

• MySQL replication and Galera

• Semi-sync replication

• Automated failover

• Manual failovers, status check, start & stop of node, replication, full cluster... from
single command line.

• Monitoring

• Topology: Pair of semi-sync masters, additional read-only slaves

• Can move slaves to new master

• http://severalnines.com/
ClusterControl II
• Handles deployment: on-premise, EC2, or
hybrid (Rackspace, etc.)

• Adding HAProxy as a Galera load balancer

• Hot backups, online software upgrades

• Workload simulation

• Monitoring (real-time), health reports

Recommended for you

Securing your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server dataSecuring your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server data

Co-presented alongside Ronald Bradford, this covers MySQL, Percona Server, and MariaDB Server (since the latter occasionally can be different enough). Go thru insecure practices, focus on communication security, connection security, data security, user accounts and server access security.

auditsecuritymariadb server
The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016

This was a short 25 minute talk, but we go into a bit of a history of MySQL, how the branches and forks appeared, what's sticking around today (branch? Percona Server. Fork? MariaDB Server). What should you use? Think about what you need today and what the roadmap holds.

percona livemariadb serverpercona server
The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorial

Presented at Percona Live Amsterdam 2016, this is an in-depth look at MariaDB Server right up to MariaDB Server 10.1. Learn the differences. See what's already in MySQL. And so on.

mysqlmariadb serverplams16
Orchestrator
• Reads replication topologies, keeps state,
continuous polling

• Modify your topology — move slaves
around

• Nice GUI, JSON API, CLI
http://pmmdemo.percona.com/
orchestrator/web/clusters
MySQL MHA
• Like MMM, specialized solution for MySQL replication

• Developed by Yoshinori Matsunobu at DeNA

• Automated and manual failover options

• Topology: 1 master, many slaves

• Choose new master by comparing slave binlog
positions

• Can be used in conjunction with other solutions

• http://code.google.com/p/mysql-master-ha/
Cluster suites
• Heartbeat, Pacemaker, Red Hat Cluster Suite

• Generic, can be used to cluster any server
daemon

• Usually used in conjunction with Shared Disk or
Replicated Disk solutions (preferred)

• Can be used with replication.

• Robust, Node Fencing / STONITH
Pacemaker
• Heartbeat, Corosync, Pacemaker

• Resource Agents, Percona-PRM

• Percona Replication Manager - cluster, geographical
disaster recovery options

• Pacemaker agent specialised on MySQL replication

• https://github.com/percona/percona-pacemaker-agents/ 

• Pacemaker Resource Agents 3.9.3+ include Percona
Replication Manager (PRM)

Recommended for you

Lessons from database failures
Lessons from database failures Lessons from database failures
Lessons from database failures

Failure happens, and we can learn from it. We need to think about backups, but also verification of them. We should definitely make use of replication and think about automatic failover. And security is key, but don't forget that encryption is now available in MySQL, Percona Server and MariaDB Server.

mysqlplams16database
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures

Presented at the MySQL Chicago Meetup in August 2016. The focus of the talk is on backups and verification, replication and failover, as well as security and encryption.

mysqlpercona serverreplication
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDB

An introduction to MongoDB from an experienced MySQL user and developer. There are differences and we go thru the What/Why/Who/Where of MongoDB, the "similarities" to the MySQL world like storage engines, how replication is a little more interesting with built-in sharding and automatic failover, backups, monitoring, DBaaS, going to production and finding out more resources.

nosqlmongodbdatabase
VM based failover
• VMWare, Oracle VM, etc can migrate /
failover the entire VM guest

• This isn’t the focus of the talk
Load Balancers for multi-master clusters
• Synchronous multi-master clusters like
Galera require load balancers

• HAProxy

• Galera Load Balancer (GLB)

• MaxScale

• ProxySQL
What is a proxy?
• Lightweight application between the
MySQL clients and the server

• Man-in-the-middle between client/server

• Communicate with one or more clients/
servers
Image via Giuseppe Maxia

Recommended for you

MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016

This document summarizes a presentation on MariaDB/MySQL security essentials. The presentation covered historically insecure default configurations, privilege escalation vulnerabilities, access control best practices like limiting privileges to only what users need and removing unnecessary accounts. It also discussed authentication methods like SSL, PAM, Kerberos and audit plugins. Encryption at the table, tablespace and binary log level was explained as well. Preventing SQL injections and available security assessment tools were also mentioned.

securitymysqlmariadb
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016

Some best practices about tuning Linux for your database workloads. The focus is not just on MySQL or MariaDB Server but also on understanding the OS from hardware/cloud, I/O, filesystems, memory, CPU, network, and resources.

linuxmariadbtools
Distributions from the view a package
Distributions from the view a packageDistributions from the view a package
Distributions from the view a package

Having spent more than the last decade being the main point of contact for distributions shipping MySQL, then MariaDB Server, it's clear that working with distributions have many challenges. Licensing changes (when MySQL moved the client libraries from LGPL to GPL with a FOSS Exception), ABI changes, speed (or lack thereof) of distribution releases/freezes, supporting the software throughout the lifespan of the distribution, specific bugs due to platforms, and a lot more will be discussed in this talk. Let's not forget the politics. How do we decide "tiers" of importance for distributions? As a bonus, there will be a focus on how much effort it took to "replace" MySQL with MariaDB. Benefits: if you're making a distribution, this is the point of view of the upstream package makers. Why are distribution statistics important to us? Do we monitor your bugs system or do you have a better escalation to us? How do we test to make sure things are going well before release. This and more will be spoken about. As an upstream project (package), we love nothing more than being available everywhere. But time and energy goes into making this is so as there are quirks in every distribution.

percona serverlinuxfosdem2016
MySQL Proxy - ten years ago!
• The first proxy, which had an embedded
Lua interpreter

• It is used in MySQL Enterprise Monitor

• Lua was flexible to allow you to rewrite
queries, add statements, filter, etc.

• 2007-2014
MariaDB MaxScale 1.0…1.4.x
• GA January 2015

• The “Swiss Army Knife” - pluggable router with an
extensible architecture

• Logging, writing to other backends (besides MySQL),
firewall filter, routing via hints, query rewriting

• Binlog Server - popularised by booking.com to not have
intermediate masters

• Popular use case: sitting in front of a 3-node Galera Cluster
MariaDB MaxScale ecosystem
• First known plugin: Kafka backend written by
Yves Trudeau

• https://www.percona.com/blog/2015/06/08/maxscale-a-new-tool-to-solve-your-
mysql-scalability-problems/ 

• First known credible fork: AirBnB MaxScale 1.3

•connection pooling (not 1:1, multiplexed N:M,
N>M connections), requests throttling, denylist
query rejection, monitoring
MariaDB MaxScale 2.0
• Same Github repository, unlinked against
MySQL client libraries (replaced with
SQLite), CDC to Kafka, binlog events to
Avro/JSON

• License change from GPLv2 to Business
Source License (BSL)

Recommended for you

Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation

Java Servlet programs

How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx

How do we build an IoT product, and make it profitable? Talk from the IoT meetup in March 2024. https://www.meetup.com/iot-sweden/events/299487375/

iot
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence

Our Linux Web Hosting plans offer unbeatable performance, security, and scalability, ensuring your website runs smoothly and efficiently. Visit- https://onliveserver.com/linux-web-hosting/

cheap linux hosting
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
MariaDB MaxScale 2.1
• Dynamic
(re)configuration

• Performance
MySQL Router - GPLv2
• GA October 2015

• Transparent routing between applications and any
backend MySQL servers

• Pluggable architecture via the MySQL Harness

• Failover, load balancing

• This is how you manage MySQL InnoDB Cluster with
mysqlsh - https://www.youtube.com/watch?
v=JWy7ZLXxtZ4

Recommended for you

20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf

Support en anglais diffusé lors de l'événement 100% IA organisé dans les locaux parisiens d'Iguane Solutions, le mardi 2 juillet 2024 : - Présentation de notre plateforme IA plug and play : ses fonctionnalités avancées, telles que son interface utilisateur intuitive, son copilot puissant et des outils de monitoring performants. - REX client : Cyril Janssens, CTO d’ easybourse, partage son expérience d’utilisation de notre plateforme IA plug & play.

genaicloudrgpd
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf

These fighter aircraft have uses outside of traditional combat situations. They are essential in defending India's territorial integrity, averting dangers, and delivering aid to those in need during natural calamities. Additionally, the IAF improves its interoperability and fortifies international military alliances by working together and conducting joint exercises with other air forces.

air force fighter planebiggest submarinezambia port
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf

As a popular open-source library for analytics engineering, dbt is often used in combination with Airflow. Orchestrating and executing dbt models as DAGs ensures an additional layer of control over tasks, observability, and provides a reliable, scalable environment to run dbt models. This webinar will cover a step-by-step guide to Cosmos, an open source package from Astronomer that helps you easily run your dbt Core projects as Airflow DAGs and Task Groups, all with just a few lines of code. We’ll walk through: - Standard ways of running dbt (and when to utilize other methods) - How Cosmos can be used to run and visualize your dbt projects in Airflow - Common challenges and how to address them, including performance, dependency conflicts, and more - How running dbt projects in Airflow helps with cost optimization Webinar given on 9 July 2024

apache airflowdbtdbt-core
ProxySQL - GPLv3
• Stable December 2015

• ProxySQL - included with Percona
XtraDB Cluster 5.7, proxysql-
admin tool available for PXC
configurations

• Improve database operations,
understand and solve
performance issues, HA to DB
topology

• Connection Pooling & Multiplexing

• Read/Write Split and Sharding

• Seamless failover (including query
rerouting), load balancing

• Query caching

• Query rewriting

• Query blocking (database aware
firewall)

• Query mirroring (cache warming)

• Query throttling and timeouts

• Runtime reconfigurable 

• Monitoring built-in
Comparison
• http://www.proxysql.com/compare
ProxySQL missing features from MariaDB
MaxScale
• Front-end SSL encryption (client -> SSL -> proxy
-> application) - issue#891

• Binlog router

• Streaming binlogs to Kafka

• use Maxwell’s Daemon: http://maxwells-
daemon.io/ 

• Binlogs to Avro
ProxySQL Resources
• Marco Tusa: https://tusacentral.net/joomla/
index.php/mysql-blogs 

• SeveralNines: https://severalnines.com/blog?
keywords=%23proxysql 

• Pythian: https://www.pythian.com/blog/tag/proxysql/ 

• Percona: https://www.percona.com/blog/category/
proxysql/

Recommended for you

Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces

An invited talk given by Mark Billinghurst on Research Directions for Cross Reality Interfaces. This was given on July 2nd 2024 as part of the 2024 Summer School on Cross Reality in Hagenberg, Austria (July 1st - 7th)

augmented realitycross realityvirtual reality
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf

Solar Storms (Geo Magnetic Storms) are the motion of accelerated charged particles in the solar environment with high velocities due to the coronal mass ejection (CME).

solar storms
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry

Are you interested in dipping your toes in the cloud native observability waters, but as an engineer you are not sure where to get started with tracing problems through your microservices and application landscapes on Kubernetes? Then this is the session for you, where we take you on your first steps in an active open-source project that offers a buffet of languages, challenges, and opportunities for getting started with telemetry data. The project is called openTelemetry, but before diving into the specifics, we’ll start with de-mystifying key concepts and terms such as observability, telemetry, instrumentation, cardinality, percentile to lay a foundation. After understanding the nuts and bolts of observability and distributed traces, we’ll explore the openTelemetry community; its Special Interest Groups (SIGs), repositories, and how to become not only an end-user, but possibly a contributor.We will wrap up with an overview of the components in this project, such as the Collector, the OpenTelemetry protocol (OTLP), its APIs, and its SDKs. Attendees will leave with an understanding of key observability concepts, become grounded in distributed tracing terminology, be aware of the components of openTelemetry, and know how to take their first steps to an open-source contribution! Key Takeaways: Open source, vendor neutral instrumentation is an exciting new reality as the industry standardizes on openTelemetry for observability. OpenTelemetry is on a mission to enable effective observability by making high-quality, portable telemetry ubiquitous. The world of observability and monitoring today has a steep learning curve and in order to achieve ubiquity, the project would benefit from growing our contributor community.

cloudcloud native observabilitycloud native
Health of these projects
• MariaDB MaxScale: 142 watchers, 670
stars, 199 forks, 19 contributors

• MySQL Router: 25 watchers, 47 stars, 30
forks, 8 contributors

• ProxySQL: 119 watchers, 951 stars, 145
forks, 25 contributors
Punch cards
Best practices for MySQL High Availability Tutorial
What do you use?
• MySQL Router is clearly very interesting going forward,
especially with the advent of the MySQL InnoDB Cluster

• ProxySQL is a great choice today, has wide use, also
has Percona Monitoring & Management (PMM)
integration

• MariaDB MaxScale pre-2.0 if you really need a binlog
router

• Server you’re using?

Recommended for you

Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides

If you’ve ever had to analyze a map or GPS data, chances are you’ve encountered and even worked with coordinate systems. As historical data continually updates through GPS, understanding coordinate systems is increasingly crucial. However, not everyone knows why they exist or how to effectively use them for data-driven insights. During this webinar, you’ll learn exactly what coordinate systems are and how you can use FME to maintain and transform your data’s coordinate systems in an easy-to-digest way, accurately representing the geographical space that it exists within. During this webinar, you will have the chance to: - Enhance Your Understanding: Gain a clear overview of what coordinate systems are and their value - Learn Practical Applications: Why we need datams and projections, plus units between coordinate systems - Maximize with FME: Understand how FME handles coordinate systems, including a brief summary of the 3 main reprojectors - Custom Coordinate Systems: Learn how to work with FME and coordinate systems beyond what is natively supported - Look Ahead: Gain insights into where FME is headed with coordinate systems in the future Don’t miss the opportunity to improve the value you receive from your coordinate system data, ultimately allowing you to streamline your data analysis and maximize your time. See you there!

20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024

Everything that I found interesting about engineering leadership last month

quantumfaxmachine
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant

Password Rotation in 2024 is still Relevant

passwordmanagementrotation
Resources
• ProxySQL: https://groups.google.com/
forum/#!forum/proxysql 

• MariaDB MaxScale: https://
groups.google.com/forum/#!forum/maxscale 

• MySQL Router: https://forums.mysql.com/
list.php?146
JDBC/PHP drivers
• JDBC - multi-host failover feature (just
specify master/slave hosts in the properties)

• true for MariaDB Java Connector too

• PHP handles this too - mysqlnd_ms

• Can handle read-write splitting, round robin
or random host selection, and more
Clustering: solution or part of problem?
• "Causes of Downtime in Production MySQL Servers"
whitepaper, Baron Schwartz, VividCortex

• Human error

• SAN

• Clustering framework + SAN = more problems

• Galera is replication based, has no false positives as there’s
no “failover” moment, you don’t need a clustering
framework (JDBC or PHP can load balance), and is
relatively elegant overall
InnoDB based?
• Use InnoDB, continue using InnoDB,
know workarounds to InnoDB

• All solutions but NDB are InnoDB. NDB is
great for telco/session management for
high bandwidth sites, but setup,
maintenance, etc. is complex

Recommended for you

Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers

The integration of programming into civil engineering is transforming the industry. We can design complex infrastructure projects and analyse large datasets. Imagine revolutionizing the way we build our cities and infrastructure, all by the power of coding. Programming skills are no longer just a bonus—they’re a game changer in this era. Technology is revolutionizing civil engineering by integrating advanced tools and techniques. Programming allows for the automation of repetitive tasks, enhancing the accuracy of designs, simulations, and analyses. With the advent of artificial intelligence and machine learning, engineers can now predict structural behaviors under various conditions, optimize material usage, and improve project planning.

programmingcodingcivil engineering
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024

Everything that I found interesting about machines behaving intelligently during June 2024

quantumfaxmachine
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...

This presentation explores the practical application of image description techniques. Familiar guidelines will be demonstrated in practice, and descriptions will be developed “live”! If you have learned a lot about the theory of image description techniques but want to feel more confident putting them into practice, this is the presentation for you. There will be useful, actionable information for everyone, whether you are working with authors, colleagues, alone, or leveraging AI as a collaborator. Link to presentation recording and slides: https://bnctechforum.ca/sessions/details-of-description-part-ii-describing-images-in-practice/ Presented by BookNet Canada on June 25, 2024, with support from the Department of Canadian Heritage.

a11yaccessibilityalt text
Replication type
• Competence choices

• Replication: MySQL DBA
manages

• DRBD: Linux admin manages

• SAN: requires domain controller

• Operations

• DRBD (disk level) = cold
standby = longer failover

• Replication = hot standby =
shorter failover

• GTID helps tremendously

• Performance

• SAN has higher latency than
local disk

• DRBD has higher latency than
local disk

• Replication has little overhead

• Redundancy

• Shared disk = SPoF

• Shared nothing = redundant
SBR vs RBR? Async vs sync?
• row based: deterministic

• statement based: dangerous

• GTID: easier setup & failover of complex topologies

• async: data loss in failover

• sync: best

• semi-sync: best compromise

• multi-threaded slaves: scalability (hello 5.6+, Tungsten)
Conclusions for choice
• Simpler is better

• MySQL replication > DRBD > SAN

• Sync replication = no data loss

• Async replication = no latency (WAN)

• Sync multi-master = no failover required

• Multi-threaded slaves help in disk-bound workloads

• GTID increases operational usability

• Galera provides all this with good performance & stability
Deep-dive: MHA

Recommended for you

Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx

MuleSoft Meetup on APM and IDP

mulesoftai
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM

Quantum Communications Q&A with Gemini LLM. These are based on Shannon's Noisy channel Theorem and offers how the classical theory applies to the quantum world.

quantum communicationsshannon's channel theoremclassical theory
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL

Blockchain technology is transforming industries and reshaping the way we conduct business, manage data, and secure transactions. Whether you're new to blockchain or looking to deepen your knowledge, our guidebook, "Blockchain for Dummies", is your ultimate resource.

blockchainweb3blockchain technology
Why MHA needs coverage
• High Performance MySQL, 3rd Edition

• Published: March 16 2012
Where did MHA come from?
• DeNA won 2011 MySQL
Community Contributor of the
Year (April 2011)

• MHA came in about 3Q/2011

• Written by Yoshinori Matsunobu,
Oracle ACE Director
What is MHA?
• MHA for MySQL: Master High Availability
Manager tools for MySQL

• Goal: automating master failover & slave
promotion with minimal downtime

• Set of Perl scripts

• http://code.google.com/p/mysql-master-ha/
Why MHA?
• Automating monitoring of your replication topology for master failover

• Scheduled online master switching to a different host for online
maintenance

• Switch back after OPTIMIZE/ALTER table, software or hardware
upgrade

• Schema changes without stopping services

• pt-online-schema-change, oak-online-alter-table, Facebook OSC,
Github gh-ost

• Interactive/non-interactive master failover (just for failover, with
detection of master failure + VIP takeover to Pacemaker)

Recommended for you

WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf

Profile portofolio

Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf

Sustainability requires ingenuity and stewardship. Did you know Pigging Solutions pigging systems help you achieve your sustainable manufacturing goals AND provide rapid return on investment. How? Our systems recover over 99% of product in transfer piping. Recovering trapped product from transfer lines that would otherwise become flush-waste, means you can increase batch yields and eliminate flush waste. From raw materials to finished product, if you can pump it, we can pig it.

pigging solutionsprocess piggingproduct transfers
Why is master failover hard?
• When master fails, no more writes till
failover complete

• MySQL replication is asynchronous
(MHA works with async + semi-sync
replication)

• slave2 is latest, slave1+3 have missing
events, MHA does:

• copy id=10 from master if possible

• apply all missing events
MHA: Typical scenario
• Monitor replication topology

• If failure detected on master, immediately switch to a
candidate master or the most current slave to
become new master

• MHA must fail to connect to master server three
times 

• CHANGE MASTER for all slaves to new master

• Print (stderr)/email report, stop monitoring
So really, what does MHA do?
Typical timeline
• Usually no more than 10-30 seconds

• 0-10s: Master failover detected in around 10
seconds

• (optional) check connectivity via secondary network

• (optional) 10-20s: 10 seconds to power off master

• 10-20s: apply differential relay logs to new master

• Practice: 4s @ DeNA, usually less than 10s

Recommended for you

How does MHA work?
• Save binlog events from crashed master

• Identify latest slave

• Apply differential relay log to other slaves

• Apply saved binlog events from master

• Promote a slave to new master

• Make other slaves replicate from new master
Getting Started
• MHA requires no changes to
your application

• You are of course to write to a
virtual IP (VIP) for your master

• MHA does not build
replication environments for
you - that’s DIY
MHA Node
• Download mha4mysql-node & install this
on all machines: master, slaves, monitor

• Packages (DEB, RPM) available

• Manually, make sure you have
DBD::mysql & ensure it knows the path
of your MySQL
MHA Manager server
• Monitor server doesn’t have to be powerful
at all, just remain up

• This is a single-point-of-failure so monitor
the manager server where MHA Manager
gets installed

• If MHA Manager isn’t running, your app still
runs, but automated failover is now disabled

Recommended for you

MHA Manager
• You must install mha4mysql-node then
mha4mysql-manager 

• Manager server has many Perl dependencies:
DBD::mysql, Config::Tiny,
Log::Dispatch, Parallel::ForkManager,
Time::HiRes
• Package management fixes dependencies, else use
CPAN
Configuring MHA
• Application configuration file: see
samples/conf/app1.cnf

• Place this in /etc/MHA/app1.cnf

• Global configuration file: see /etc/MHA/
masterha_default.cnf (see samples/
conf/masterha_default.cnf)
app1.cnf
[server default]
manager_workdir=/var/log/masterha/app1
manager_log=/var/log/masterha/app1/manager.log
[server1]
hostname=host1
[server2]
hostname=host2
candidate_master=1
[server3]
hostname=host3
[server4]
hostname=host4
no_master=1
no need to specify
master as
MHA auto-detects this
sets priority, but doesn’t necessarily mean it gets
promoted
as a default (say its too far behind replication).
But maybe this is a more powerful box, or has a
better setup
will never be the master. RAID0 instead
of RAID1+0?
Slave is in another data centre?
masterha_default.cnf
[server default]
user=root
password=rootpass
ssh_user=root
master_binlog_dir= /var/lib/mysql,/var/log/mysql
remote_workdir=/data/log/masterha
ping_interval=3
# secondary_check_script=masterha_secondary_check -s
remote_host1 -s remote_host2
# master_ip_failover_script= /script/masterha/master_ip_failover
# shutdown_script= /script/masterha/power_manager
# report_script= /script/masterha/send_report
# master_ip_online_change_script= /script/masterha/
master_ip_online_change
116
check master activity from
manager->remote_hostN->
master (multiple hosts to
ensure its not a network issue)
STONITH

Recommended for you

MHA uses SSH
• MHA uses SSH actively; passphraseless login

• In theory, only require Manager SSH to all
nodes

• However, remember
masterha_secondary_check
•masterha_check_ssh --conf=/etc/MHA/
app1.cnf
Check replication
•masterha_check_repl --conf=/etc/MHA/
app1.cnf
• If you don’t see MySQL Replication Health is OK,
MHA will fail

• Common errors? Master binlog in different position,
read privileges on binary/relay log not granted,
using multi-master replication w/o read-only=1 set
(only 1 writable master allowed)
MHA Manager
•masterha_manager --conf=/etc/MHA/
app1.cnf
• Logs are printed to stderr by default, set
manager_log

• Recommended running with nohup, or daemontools
(preferred in production)

• http://code.google.com/p/mysql-master-ha/wiki/
Runnning_Background
So, the MHA Playbook
• Install MHA node, MHA manager

•masterha_check_ssh --conf=/etc/
app1.cnf
•masterha_check_repl --conf=/etc/
app1.cnf
•masterha_manager --conf=/etc/app1.cnf
• That’s it!

Recommended for you

master_ip_failover_script
• Pacemaker can monitor & takeover VIP if required 

• Can use a catalog database

• map between application name + writer/reader IPs

• Shared VIP is easy to implement with minimal
changes to master_ip_failover itself (however,
use shutdown_script to power off machine)
master_ip_online_change
• Similar to master_ip_failover script, but
used for online maintenance

•masterha_master_switch --
master_state=alive
• MHA executes FLUSH TABLES WITH
READ LOCK after the writing freeze
Test the failover
•masterha_check_status --conf=/etc/
MHA/app1.cnf
• Kill MySQL (kill -9, shutdown server, kernel
panic)

• MHA should go thru failover (stderr)

• parse the log as well

• Upon completion, it stops running
masterha_master_switch
• Manual failover

•--master_state=dead
• Scheduled online master switchover

• Great for upgrades to server, etc.

•masterha_master_switch --
master_state=alive --conf=/etc/MHA/
app1.cnf --new_master_host=host2

Recommended for you

Handling VIPs
my $vip = ‘192.168.0.1/24”;
my $interface = “0”;
my $ssh_start_vip = “sudo /sbin/ifconfig eth0:$key $vip”;
my $ssh_stop_vip = “sudo /sbin/ifconfig eth0:$key down”;
...
sub start_vip() {
`ssh $ssh_user@$new_master_host ” $ssh_start_vip ”`; }
sub stop_vip() {
`ssh $ssh_user@$orig_master_host ” $ssh_stop_vip ”`; }
Integration with other HA solutions
• Pacemaker

• on RHEL6, you need some HA add-on, just use the CentOS
packages

• /etc/ha.d/haresources to configure VIP

•`masterha_master_switch --master_state=dead
--interactive=0 --wait_on_failover_error=0 --
dead_master_host=host1 --
new_master_host=host2`
• Corosync + Pacemaker works well
What about replication delay?
• By default, MHA checks to see if slave is
behind master. By more than 100MB, it is
never a candidate master

• If you have candidate_master=1 set,
consider setting check_repl_delay=0
• You can integrate it with pt-heartbeat from
Percona Toolkit
MHA deployment tips
• You really should install this as root

• SSH needs to work across all hosts

• If you don’t want plaintext passwords in config files, use
init_conf_load_script

• Each monitor can monitor multiple MHA pairs (hence app1, app2, etc.)

• You can have a standby master, make sure its read-only

• By default, master1->master2->slave3 doesn’t work

• MHA manages master1->master2 without issue

• Use multi_tier_slave=1 option

• Make sure replication user exists on candidate master too!

Recommended for you

Consul
• Service discovery & configuration.
Distributed, highly available, data centre
aware

• Comes with its own built-in DNS server,
KV storage with HTTP API

• Raft Consensus Algorithm
MHA + Consul
VIPs vs Consul
• Previously, you handled VIPs and had to write
to master_ip_online_change/master_ip_failover

• system(“curl -X PUT -d ‘{”Node”:”master”}’
localhost:8500/v1/catalog/deregister);

• system(“curl -X PUT -d ‘{”Node”:”master”,
”Address”:”$new_master_host”}’ localhost:
8500/v1/catalog/register);
mysqlfailover
• mysqlfailover from mysql-utilities using GTID’s in 5.6

• target topology: 1 master, n-slaves

• enable: log-slave-updates, report-host, report-port, master-info-table=TABLE

• modes: elect (choose candidate from list), auto (default), fail

• --discover-slaves-login for topology discovery

• monitoring node: SPoF

• Errant transactions prevent failover!

• Restart node? Rejoins replication topology, as a slave.

Recommended for you

MariaDB 10
• New slave: SET GLOBAL GTID_SLAVE_POS = BINLOG_GTID_POS("masterbin.
00024", 1600); CHANGE MASTER TO master_host="10.2.3.4",
master_use_gtid=slave_pos; START SLAVE;

• use GTID: STOP SLAVE

CHANGE MASTER TO master_use_gtid=current_pos; START SLAVE;

• Change master: STOP SLAVE

CHANGE MASTER TO master_host="10.2.3.5"; START SLAVE;
Where is MHA used
• DeNA

• Premaccess (Swiss HA hosting company)

• Ireland’s national TV & radio service

• Jetair Belgium (MHA + MariaDB!)

• Samsung

• SK Group

• DAPA
MHA 0.56 is current
• Major release: MHA 0.56 April 1 2014
(0.55: December 12 2012)

• http://code.google.com/p/mysql-master-
ha/wiki/ReleaseNotes
MHA 0.56
• 5.6 GTID: GTID + auto position enabled? Failover with GTID SQL syntax not
relay log failover

• MariaDB 10+ doesn’t work

• MySQL 5.6 support for checksum in binlog events + multi-threaded slaves

• mysqlbinlog and mysql in custom locations (configurable clients)

• binlog streaming server supported

Recommended for you

MHA 0.56
• ping_type = INSERT (for master connectivity checks - assuming master
isn’t accepting writes)
Replication Manager
• Support for MariaDB Server GTIDs, MySQL and Percona
Server

• Single, portable 12MB binary

• Interactive GTID monitoring

• Supports failover or switchover based on requests

• Topology detection

• Health checks

• GUI! - https://github.com/tanji/replication-manager
Best practices for MySQL High Availability Tutorial
Is fully automated failover a good idea?
• False alarms

• Can cause short downtime, restarting all write connections

• Repeated failover

• Problem not fixed? Master overloaded?

• MHA ensures a failover doesn’t happen within 8h, unless --last_failover_minute=n is
set

• Data loss

• id=103 is latest, relay logs are at id=101, loss

• group commit means sync_binlog=1, innodb_flush_log_at_trx_commit=1 can be
enabled! (just wait for master to recover)

• Split brain

• sometimes poweroff takes a long time

Recommended for you

Video resources
• Yoshinori Matsunobu talking about High Availability &
MHA at Oracle MySQL day

• http://www.youtube.com/watch?v=CNCALAw3VpU

• Alex Alexander (AccelerationDB) talks about MHA, with
an example of failover, and how it compares to Tungsten

• http://www.youtube.com/watch?v=M9vVZ7jWTgw

• Consul & MHA failover in action

• https://www.youtube.com/watch?v=rA4hyJ-pccU
References
• Design document

• http://www.slideshare.net/matsunobu/automated-master-failover

• Configuration parameters

• http://code.google.com/p/mysql-master-ha/wiki/Parameters

• JetAir MHA use case

• http://www.percona.com/live/mysql-conference-2012/sessions/
case-study-jetair-dramatically-increasing-uptime-mha

• MySQL binary log

• http://dev.mysql.com/doc/internals/en/binary-log.html
Best practices for MySQL High Availability Tutorial
Service Level Agreements (SLA)
• AWS - 99.95% in a calendar month

• Rackspace - 99.9% in a calendar month

• Google - 99.95% in a calendar month

• SLAs exclude “scheduled maintenance”

• AWS is 30 minutes/week, so really 99.65%

Recommended for you

RDS: Multi-AZ
• Provides enhanced durability (synchronous data
replication)

• Increased availability (automatic failover)

• Warning: can be slow (1-10 mins+)

• Easy GUI administration

• Doesn’t give you another usable “read-replica”
though
External replication
• MySQL 5.6 you can do RDS -> Non-RDS

• enable backup retention, you now have binlog access

• target: exporting data out of RDS

• Replicate into RDS with 5.5.33 or later

• AWS provides stored procedures like mysql.rds_set_external_master
nowadays
High Availability
• Plan for node failures

• Don’t assume node provisioning is quick

• Backup, backup, backup!

• “Bad” nodes exist

• HA is not equal across options

• RDS: DRBD (multi-AZ)

• Google (v2): semi-sync replication
Unsupported features
• AWS MySQL: GTIDs (but MariaDB Server GTIDs work!), InnoDB Cache
Warming (intra-schema parallel replication in 5.7 works - this was an XtraDB
5.6 feature), InnoDB transportable tablespaces, authentication plugins,
password strength plugin, replication filters, semi-sync replication

• AWS MariaDB: Data at Rest Encryption, MariaDB Galera Cluster,
HandlerSocket, Multi-source Replication, Password validation plugin,
simple_password_check, and cracklib_password_check, Replication Filters,
Storage engine-specific object attributes, table and Tablespace Encryption

• Google: UDFs, PERFORMANCE_SCHEMA, LOAD DATA INFILE, INSTALL
PLUGIN, SELECT ... INTO OUTFILE

• mysqlsh?

Recommended for you

Can you configure MySQL?
• You don’t access
my.cnf naturally

• In AWS you have
parameter groups
which allow
configuration of
MySQL
source: http://www.mysqlperformanceblog.com/2013/08/21/amazon-rds-with-mysql-5-6-configuration-variables/
Best practices for MySQL High Availability Tutorial
Sharding solutions
• Not all data lives in one place

• hash records to partitions

• partition alphabetically? put n-users/
shard? organise by postal codes?
Horizontal vs vertical
192.168.0.1
User
id int(10)
username char(15)
password char(15)
email char(50)
192.168.0.2
User
id int(10)
username char(15)
password char(15)
email char(50)
192.168.0.3
User
id int(10)
username char(15)
password char(15)
email char(50)
192.168.0.1
User
id int(10)
username char(15)
password char(15)
email char(50)
192.168.0.2
UserInfo
login datetime
md5 varchar(32)
guid varchar(32)
Better if INSERT
heavy and there’s
less frequently
changed data

Recommended for you

How do you shard?
• Use your own sharding framework

• write it in the language of your choice

• simple hashing algorithm that you can devise yourself

• SPIDER

• Tungsten Replicator

• Tumblr JetPants

• Google Vitess
SPIDER
• storage engine to vertically partition
tables
Tungsten Replicator (OSS)
• Each transaction tagged with a Shard ID

• controlled in a file: shard.list, exposed via
JMX MBean API

• primary use? geographic replication

• in application, requires changes to use
the API to specify shards used
Tumblr JetPants
• clone replicas, rebalance shards, master
promotions (can also use MHA for master
promotions)

• Ruby library, range-based sharding scheme

• https://github.com/tumblr/jetpants

• Uses MariaDB as an aggregator node (multi-
source replication)

Recommended for you

Google (YouTube) vitess
• Servers & tools to scale MySQL for web written in Go

• Has MariaDB Server & MySQL support 

• DML annotation, connection pooling, shard management, workflow
management, zero downtime restarts

• Become extremely easy to use: http://vitess.io/ (with the help of
Kubernetes)
Best practices for MySQL High Availability Tutorial
Conclusion
• MySQL replication is amazing if you know it (and
monitor it) well enough

• Large sites run just fine with semi-sync + tooling for
automated failover

• Galera Cluster is great for virtually synchronous
replication

• Don’t forget the need for a load balancer: ProxySQL
is nifty
At Percona, we care about your High
Availability
• Percona XtraDB Cluster 5.7 with support for
ProxySQL and Percona Monitoring & Management
(PMM)

• Percona Monitoring & Management (PMM) with
Orchestrator

• Percona Toolkit

• Percona Server for MySQL 5.7

• Percona XtraBackup

Recommended for you

Resources
Resources II
Blogs
• http://jfg-mysql.blogspot.com/ 

• http://planet.mysql.com/
• http://www.percona.com/blog/
Tomorrow
• 10:45-11:20 - Meet the Experts - O’Reilly
Booth, Table 3 

• 14:10-14:50 - Capacity planning for your
data stores (Buckingham Room, Palace
Suite — here)

Recommended for you

Slides
• http://bit.ly/MySQLHAVelocity 

• Exercises as well
Q&A / Thanks
colin.charles@percona.com / byte@bytebot.net
@bytebot on Twitter | http://bytebot.net/blog/

More Related Content

What's hot

RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ Twitter
Redis Labs
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability Practices
Yoshinori Matsunobu
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
Colin Charles
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & How
Markus Michalewicz
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
Severalnines
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
MariaDB plc
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes
rockplace
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
Alexander Korotkov
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
Jun Rao
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
Satishbabu Gunukula
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
StreamNative
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database
Sandesh Rao
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
René Cannaò
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
Yoshinori Matsunobu
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
Markus Michalewicz
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
Tathastu.ai
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
Alkin Tezuysal
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
Jurriaan Persyn
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
Yoshinori Matsunobu
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
NeoClova
 

What's hot (20)

RedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ TwitterRedisConf17- Using Redis at scale @ Twitter
RedisConf17- Using Redis at scale @ Twitter
 
RocksDB Performance and Reliability Practices
RocksDB Performance and Reliability PracticesRocksDB Performance and Reliability Practices
RocksDB Performance and Reliability Practices
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
Standard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & HowStandard Edition High Availability (SEHA) - The Why, What & How
Standard Edition High Availability (SEHA) - The Why, What & How
 
Disaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDBDisaster Recovery Planning for MySQL & MariaDB
Disaster Recovery Planning for MySQL & MariaDB
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
MySQL operator for_kubernetes
MySQL operator for_kubernetesMySQL operator for_kubernetes
MySQL operator for_kubernetes
 
Solving PostgreSQL wicked problems
Solving PostgreSQL wicked problemsSolving PostgreSQL wicked problems
Solving PostgreSQL wicked problems
 
Kafka replication apachecon_2013
Kafka replication apachecon_2013Kafka replication apachecon_2013
Kafka replication apachecon_2013
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
 
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
Trino: A Ludicrously Fast Query Engine - Pulsar Summit NA 2021
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database
 
ProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management OverviewProxySQL High Avalability and Configuration Management Overview
ProxySQL High Avalability and Configuration Management Overview
 
Automated master failover
Automated master failoverAutomated master failover
Automated master failover
 
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RACThe Top 5 Reasons to Deploy Your Applications on Oracle RAC
The Top 5 Reasons to Deploy Your Applications on Oracle RAC
 
Building robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and DebeziumBuilding robust CDC pipeline with Apache Hudi and Debezium
Building robust CDC pipeline with Apache Hudi and Debezium
 
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdfMySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
MySQL Ecosystem in 2023 - FOSSASIA'23 - Alkin.pptx.pdf
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
MyRocks Deep Dive
MyRocks Deep DiveMyRocks Deep Dive
MyRocks Deep Dive
 
MySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docxMySQL_SQL_Tunning_v0.1.3.docx
MySQL_SQL_Tunning_v0.1.3.docx
 

Similar to Best practices for MySQL High Availability Tutorial

OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
NETWAYS
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Colin Charles
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
Insight Technology, Inc.
 
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
Colin Charles
 
Meet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web SummitMeet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web Summit
Colin Charles
 
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
Colin Charles
 
MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC
Colin Charles
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
Colin Charles
 
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...
Codership Oy - Creators of Galera Cluster
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Corporation
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
Jean-François Gagné
 
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB Corporation
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
Colin Charles
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Continuent
 
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability
Baruch Osoveskiy
 
Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0
Colin Charles
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
Mark Swarbrick
 
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesA26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
Insight Technology, Inc.
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)
kayokogoto
 
MariaDB: The 2012 Edition
MariaDB: The 2012 EditionMariaDB: The 2012 Edition
MariaDB: The 2012 Edition
Colin Charles
 

Similar to Best practices for MySQL High Availability Tutorial (20)

OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
OSDC 2018 | Scaling & High Availability MySQL learnings from the past decade+...
 
Best practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High AvailabilityBest practices for MySQL/MariaDB Server/Percona Server High Availability
Best practices for MySQL/MariaDB Server/Percona Server High Availability
 
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale  by ...
[db tech showcase Tokyo 2014] B15: Scalability with MariaDB and MaxScale by ...
 
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
MariaDB - the "new" MySQL is 5 years old and everywhere (LinuxCon Europe 2015)
 
Meet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web SummitMeet MariaDB 10.1 at the Bulgaria Web Summit
Meet MariaDB 10.1 at the Bulgaria Web Summit
 
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB MeetupMariaDB 10.1   what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
MariaDB 10.1 what's new and what's coming in 10.2 - Tokyo MariaDB Meetup
 
MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC MariaDB 10: A MySQL Replacement - HKOSC
MariaDB 10: A MySQL Replacement - HKOSC
 
Why MariaDB?
Why MariaDB?Why MariaDB?
Why MariaDB?
 
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...
 
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
MariaDB Enterprise & MariaDB Enterprise Cluster - MariaDB Webinar July 2014
 
MySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated EnvironmentMySQL Scalability and Reliability for Replicated Environment
MySQL Scalability and Reliability for Replicated Environment
 
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin FrankfurtMariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
MariaDB und mehr - MariaDB Roadshow Summer 2014 Hamburg Berlin Frankfurt
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB ClusterWebinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
Webinar Slides: MySQL HA/DR/Geo-Scale - High Noon #5: Oracle’s InnoDB Cluster
 
MySQL highav Availability
MySQL highav AvailabilityMySQL highav Availability
MySQL highav Availability
 
Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0Differences between MariaDB 10.3 & MySQL 8.0
Differences between MariaDB 10.3 & MySQL 8.0
 
MySQL 5.6 Replication Webinar
MySQL 5.6 Replication WebinarMySQL 5.6 Replication Webinar
MySQL 5.6 Replication Webinar
 
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin CharlesA26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
A26 MariaDB : The New&Implemented MySQL Branch by Colin Charles
 
Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)Maria db 10 and the mariadb foundation(colin)
Maria db 10 and the mariadb foundation(colin)
 
MariaDB: The 2012 Edition
MariaDB: The 2012 EditionMariaDB: The 2012 Edition
MariaDB: The 2012 Edition
 

More from Colin Charles

What is MariaDB Server 10.3?
What is MariaDB Server 10.3?What is MariaDB Server 10.3?
What is MariaDB Server 10.3?
Colin Charles
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud
Colin Charles
 
MySQL features missing in MariaDB Server
MySQL features missing in MariaDB ServerMySQL features missing in MariaDB Server
MySQL features missing in MariaDB Server
Colin Charles
 
The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it! The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it!
Colin Charles
 
Databases in the Hosted Cloud
Databases in the Hosted CloudDatabases in the Hosted Cloud
Databases in the Hosted Cloud
Colin Charles
 
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Colin Charles
 
Capacity planning for your data stores
Capacity planning for your data storesCapacity planning for your data stores
Capacity planning for your data stores
Colin Charles
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
Colin Charles
 
Lessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companiesLessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companies
Colin Charles
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?
Colin Charles
 
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQL
Colin Charles
 
Securing your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server dataSecuring your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server data
Colin Charles
 
The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016
Colin Charles
 
The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorial
Colin Charles
 
Lessons from database failures
Lessons from database failures Lessons from database failures
Lessons from database failures
Colin Charles
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
Colin Charles
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDB
Colin Charles
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016
Colin Charles
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
Colin Charles
 
Distributions from the view a package
Distributions from the view a packageDistributions from the view a package
Distributions from the view a package
Colin Charles
 

More from Colin Charles (20)

What is MariaDB Server 10.3?
What is MariaDB Server 10.3?What is MariaDB Server 10.3?
What is MariaDB Server 10.3?
 
Databases in the hosted cloud
Databases in the hosted cloud Databases in the hosted cloud
Databases in the hosted cloud
 
MySQL features missing in MariaDB Server
MySQL features missing in MariaDB ServerMySQL features missing in MariaDB Server
MySQL features missing in MariaDB Server
 
The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it! The MySQL ecosystem - understanding it, not running away from it!
The MySQL ecosystem - understanding it, not running away from it!
 
Databases in the Hosted Cloud
Databases in the Hosted CloudDatabases in the Hosted Cloud
Databases in the Hosted Cloud
 
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
Percona ServerをMySQL 5.6と5.7用に作るエンジニアリング(そしてMongoDBのヒント)
 
Capacity planning for your data stores
Capacity planning for your data storesCapacity planning for your data stores
Capacity planning for your data stores
 
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScaleThe Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
The Proxy Wars - MySQL Router, ProxySQL, MariaDB MaxScale
 
Lessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companiesLessons from {distributed,remote,virtual} communities and companies
Lessons from {distributed,remote,virtual} communities and companies
 
Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?Forking Successfully - or is a branch better?
Forking Successfully - or is a branch better?
 
MariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQLMariaDB Server Compatibility with MySQL
MariaDB Server Compatibility with MySQL
 
Securing your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server dataSecuring your MySQL / MariaDB Server data
Securing your MySQL / MariaDB Server data
 
The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016The MySQL Server Ecosystem in 2016
The MySQL Server Ecosystem in 2016
 
The Complete MariaDB Server tutorial
The Complete MariaDB Server tutorialThe Complete MariaDB Server tutorial
The Complete MariaDB Server tutorial
 
Lessons from database failures
Lessons from database failures Lessons from database failures
Lessons from database failures
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
My first moments with MongoDB
My first moments with MongoDBMy first moments with MongoDB
My first moments with MongoDB
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016
 
Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016Tuning Linux for your database FLOSSUK 2016
Tuning Linux for your database FLOSSUK 2016
 
Distributions from the view a package
Distributions from the view a packageDistributions from the view a package
Distributions from the view a package
 

Recently uploaded

Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
shanthidl1
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
Sally Laouacheria
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
jackson110191
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
Mark Billinghurst
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
Eric D. Schabell
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
Matthew Sinclair
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
Bert Blevins
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
Awais Yaseen
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
Matthew Sinclair
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
BookNet Canada
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
ishalveerrandhawa1
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
Vijayananda Mohire
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
Liveplex
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
ArgaBisma
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 

Recently uploaded (20)

Cookies program to display the information though cookie creation
Cookies program to display the information though cookie creationCookies program to display the information though cookie creation
Cookies program to display the information though cookie creation
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf20240702 Présentation Plateforme GenAI.pdf
20240702 Présentation Plateforme GenAI.pdf
 
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdfINDIAN AIR FORCE FIGHTER PLANES LIST.pdf
INDIAN AIR FORCE FIGHTER PLANES LIST.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Research Directions for Cross Reality Interfaces
Research Directions for Cross Reality InterfacesResearch Directions for Cross Reality Interfaces
Research Directions for Cross Reality Interfaces
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 
Observability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetryObservability For You and Me with OpenTelemetry
Observability For You and Me with OpenTelemetry
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
20240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 202420240704 QFM023 Engineering Leadership Reading List June 2024
20240704 QFM023 Engineering Leadership Reading List June 2024
 
Password Rotation in 2024 is still Relevant
Password Rotation in 2024 is still RelevantPassword Rotation in 2024 is still Relevant
Password Rotation in 2024 is still Relevant
 
Best Programming Language for Civil Engineers
Best Programming Language for Civil EngineersBest Programming Language for Civil Engineers
Best Programming Language for Civil Engineers
 
20240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 202420240702 QFM021 Machine Intelligence Reading List June 2024
20240702 QFM021 Machine Intelligence Reading List June 2024
 
Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...Transcript: Details of description part II: Describing images in practice - T...
Transcript: Details of description part II: Describing images in practice - T...
 
Calgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptxCalgary MuleSoft Meetup APM and IDP .pptx
Calgary MuleSoft Meetup APM and IDP .pptx
 
Quantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLMQuantum Communications Q&A with Gemini LLM
Quantum Communications Q&A with Gemini LLM
 
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALLBLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
BLOCKCHAIN FOR DUMMIES: GUIDEBOOK FOR ALL
 
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdfWhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
WhatsApp Image 2024-03-27 at 08.19.52_bfd93109.pdf
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 

Best practices for MySQL High Availability Tutorial

  • 1. Best practices for MySQL High Availability in 2017 Colin Charles, Chief Evangelist, Percona Inc. colin.charles@percona.com / byte@bytebot.net http://www.bytebot.net/blog/ | @bytebot on Twitter O’Reilly Velocity, London, United Kingdom 18 October 2017
  • 2. whoami • Chief Evangelist, Percona Inc • Founding team of MariaDB Server (2009-2016), previously at Monty Program Ab, merged with SkySQL Ab, now MariaDB Corporation • Formerly MySQL AB (exit: Sun Microsystems) • Past lives include Fedora Project (FESCO), OpenOffice.org • MySQL Community Contributor of the Year Award winner 2014
  • 3. License • Creative Commons BY-NC-SA 4.0 • https://creativecommons.org/licenses/by- nc-sa/4.0/legalcode
  • 4. Agenda • Choosing the right High Availability (HA) solution • Discuss replication • Handling failure • Discuss proxies • HA in the cloud, geographical redundancy • Sharding solutions • MySQL 5.6/5.7 features + utilities + Fabric + Router • What’s next? • Break: 15:00-15:30
  • 5. Setting up • Vagrant/Virtualbox • github.com/ronaldbradford/mysql-security-tutorial • Docker • wget https://bit.ly/dockerhelper • source ./dockerhelper • docker_mysql | docker_percona | docker_mariadb • Better yet, wait a while and setup MySQL Sandbox (easiest option - Linux/macOS only)
  • 12. Uptime Percentile target Max downtime per year 90% 36 days 99% 3.65 days 99.5% 1.83 days 99.9% 8.76 hours 99.99% 52.56 minutes 99.999% 5.25 minutes 99.9999% 31.5 seconds
  • 13. Estimates of levels of availability Method Level of Availability Simple replication 98-99.9% Master-Master/MMM 99% SAN 99.5-99.9% DRBD, MHA, Tungsten Replicator 99.9% NDBCluster, Galera, Group Replication/InnoDB Cluster 99.999%
  • 14. HA is Redundancy • RAID: disk crashes? Another works • Clustering: server crashes? Another works • Power: fuse blows? Redundant power supplies • Network: Switch/NIC crashes? 2nd network route • Geographical: Datacenter offline/destroyed? Computation to another DC
  • 15. Durability • Data stored on disks • Is it really written to the disk? • being durable means calling fsync() on each commit • Is it written in a transactional way to guarantee atomicity, crash safety, integrity?
  • 16. High Availability for databases • HA is harder for databases • Hardware resources and data need to be redundant • Remember, this isn’t just data - constantly changing data • HA means the operation can continue uninterrupted, not by restoring a new/backup server • uninterrupted: measured in percentiles
  • 17. Redundancy through client-side XA transactions • Client writes to 2 independent but identical databases • HA-JDBC (http://ha-jdbc.github.io/) • No replication anywhere
  • 18. InnoDB “recovery” time •innodb_log_file_size • larger = longer recovery times • Percona Server 5.5 (XtraDB) - innodb_recovery_stats
  • 19. Redundancy through shared storage • Requires specialist hardware, like a SAN • Complex to operate • One set of data is your single point of failure • Cold standby • failover 1-30 minutes • this isn’t scale-out
  • 20. Redundancy through disk replication • DRBD • Linux administration vs. DBA skills • Synchronous • Second set of data inaccessible for use • Passive server acting as hot standby • Failover: 1-30 minutes • Performance hit: DRBD worst case is ~60% single node performance, with higher average latencies
  • 22. MySQL Sandbox • Great for testing various versions of MySQL/ Percona Server/MariaDB • Great for creating replication environments • make_sandbox mysql.tar.gz •make_replication_sandbox mysql.tar.gz • http://mysqlsandbox.net/
  • 23. Redundancy through MySQL replication • MySQL replication • Tungsten Replicator • Galera Cluster • MySQL Group Replication • MySQL Cluster (NDBCLUSTER) • Storage requirements are multiplied • Huge potential for scaling out
  • 24. MySQL Replication • Statement based generally • Row based became available in 5.1, and the default in 5.7 • mixed-mode, resulting in STATEMENT except if calling • UUID function, UDF, CURRENT_USER/USER function, LOAD_FILE function • 2 or more AUTO_INCREMENT columns updated with same statement • server variable used in statement • storage engine doesn’t allow statement based replication, like NDBCLUSTER • default in MariaDB Server 10.2 onwards
  • 25. MySQL Replication II • Asynchronous by default • Semi-synchronous plugin in 5.5+ • However the holy grail of fully synchronous replication is not part of standard MySQL replication (yet?) • MariaDB Galera Cluster is built-in to MariaDB Server 10.1 • Group replication plugin for MySQL 5.7 / Percona Server 5.7
  • 26. The logs • Binary log (binlog) - events that describe database changes • Relay log - events read from binlog on master, written by slave i/o thread • master_info_log - status/config info for slave’s connection to master • relay_log_info_log - status info about execution point in slave’s relay log
  • 27. Semi-synchronous replication • semi-sync capable slave acknowledges transaction event only after written to relay log & flushed to disk • timeout occurs? master reverts to async replication; resumes when slaves catch up • at scale, Facebook runs semi-sync: http:// yoshinorimatsunobu.blogspot.com/2014/04/semi- synchronous-replication-at-facebook.html
  • 28. Semi-sync II • nowadays, its enhanced (COMMIT method): 1. prepare transaction in storage engine 2. write transaction to binlog, flush to disk 3. wait for at least one slave to ack binlog event 4. commit transaction to storage engine
  • 29. MySQL Replication in 5.6 • Global Transaction ID (GTID) • Server UUID • Ignore (master) server IDs (filtering) • Per-schema multi-threaded slave • Group commit in the binary log • Binary log (binlog) checksums • Crash safe binlog and relay logs • Time delayed replication • Parallel replication (per database)
  • 30. MySQL Replication in 5.7 • Multi-source replication • Online GTID implementation • Loss-less semi-sync • Intra-schema parallel replication • Group commit tuning • Online CHANGE MASTER TO w/o stopping replication thread • GTIDs in the OK packet
  • 31. crash-safe binlog • MariaDB 5.5 checkpoints after every commit —> expensive! • 5.5/5.6 stalls commits around binlog rotate, waiting for all prepared transactions to commit (since crash recovery can only scan latest binlog file)
  • 32. crash-safe binlog 10.0 • 10.0 makes binlog checkpoints asynchronous • A binlog can have no checkpoints at all • Ability to scan multiple binlogs during crash recovery • Remove stalls around binlog rotates
  • 33. Group commit in MariaDB 10.1 • Tricky locking issues hard to change without getting deadlocks sometimes • mysql#68251, mysql#68569 • New code? Binlog rotate in background thread (further reducing stalls). Split transactions across binlogs, so big transactions do not lead to big binlog files • Works with enhanced semi-sync replication (wait for slave before commit on the master rather than after commit)
  • 34. Replication: START TRANSACTION WITH CONSISTENT SNAPSHOT • Works with the binlog, possible to obtain the binlog position corresponding to a transactional snapshot of the database without blocking any other queries. • by-product of group commit in the binlog to view commit ordering (MariaDB Server 5.3+, Percona Server for MySQL 5.6+) • Used by the command mysqldump--single-transaction --master- data to do a fully non-blocking backup • Works consistently between transactions involving more than one storage engine • Originally from MariaDB Server, but is present in MySQL 5.7+ • Percona Server enhanced it by adding session ID, and also introducing backup locks
  • 35. Multi-source replication • Multi-source replication - (real-time) analytics, shard provisioning, backups, etc. • @@default_master_connection contains current connection name (used if connection name is not given) • All master/slave commands take a connection name now (like CHANGE MASTER “connection_name”, SHOW SLAVE “connection_name” STATUS, etc.) • Remember syntax differences in MySQL 5.7 and MariaDB Server 10.0+ • also there are channel limitation differences (256 vs 64, which “grows”)
  • 36. Global Transaction ID (GTID) • Supports multi-source replication • GTID can be enabled or disabled independently and online for masters or slaves • Slaves using GTID do not have to have binary logging enabled. • (MariaDB Server) Supports multiple replication domains (independent binlog streams) • Queries in different domains can be run in parallel on the slave.
  • 37. Why is MariaDB Server GTID is different compared to MySQL 5.6? • MySQL 5.6 GTID does not support multi-source replication (only 5.7 supports this) • Supports —log-slave-updates=0 for efficiency (like 5.7) • Enabled by default • Turn it on without having to restart the topology (just like 5.7)
  • 38. Crash-safe slave (w/InnoDB DML) • Replace non-transactional file relay_log.info with transactional mysql.rpl_slave_state • Changes to rpl_slave_state are transactionally recovered after crash along with user data.
  • 39. Crash-safe slaves in 5.6? • Not using GTID • you can put relay-log.info into InnoDB table, that gets updated along w/trxn • Using GTID • relay-log.info not used. Slave position stored in binlog on slave (—log-slave-updates required) • Using parallel replication • Uses a different InnoDB table for this use case
  • 40. Replication domains • Keep central concept that replication is just applying events in-order from a serial binlog stream. • Allow multi-source replication with multiple active masters • Let’s the DBA configure multiple independent binlog streams (one per active master: mysqld --git-domain-id=#) • Events within one stream are ordered the same across entire replication topology • Events between different streams can be in different order on different servers • Binlog position is one ID per replication domain Unique to MariaDB
  • 41. Parallel (//) replication • MySQL 5.6: schema based // replication • MariaDB Server 10.0: domain id + group commit // replication + per table • MariaDB Server 10.1: optimistic // replication • MySQL 5.7: logical clock // replication (interval based) • MySQL 8: write set parallelism identification
  • 42. Parallel replication 2 • MySQL 5.7 •SET GLOBAL slave_parallel_workers=N • DATABASE: schema based // replication • LOGICAL_CLOCK: interval in binlog • “out-of-order” // replication uses gaps (START SLAVE UNTIL SQL_AFTER_MTS_GAPS;) • slave_preserve_commit_order=1 (no gaps, but log-slave-updates must be on) • Slow down master to speed up slave? •binlog_group_commit_sync_delay •binlog_group_commit_sync_no_delay_count
  • 43. Intervals vs. commit ids • MariaDB has “commit id” •#150316 11:33:46 ... GTID 0-1-185 cid=2335 • MySQL 5.7 has • sequence_number: increasing id for each transaction (not the GTID) • last_committed: sequence number of latest transaction on which transaction depends on • Interval is last_committed/sequence_number pair •#170206 20:08:33 ... last_committed=6205 sequence_number=6207
  • 44. All in… sometimes it can get out of sync • Changed information on slave directly • Statement based replication • non-deterministic SQL (UPDATE/DELETE with LIMIT and without ORDER BY) • triggers & stored procedures • Master in MyISAM, slave in InnoDB (deadlocks) • --replication-ignore-db with fully qualified queries • Binlog corruption on master • PURGE BINARY LOGS issued and not enough files to update slave • read_buffer_size larger than max_allowed_packet • Timezones matter! (UTC+0 is great) • Bugs?
  • 45. Replication Monitoring • Percona Toolkit is important • pt-slave-find: find slave information from master • pt-table-checksum: online replication consistency check • executes checksum queries on master • pt-table-sync: synchronise table data efficiently • changes data, so backups important
  • 46. Replication Monitoring with PMM •http://pmmdemo.percona.com/
  • 47. Setting up PMM • https://www.percona.com/doc/percona- monitoring-and-management/index.html • docker pull percona/pmm-server:latest • docker run ... -e ORCHESTRATOR_ENABLED=true
  • 48. Statement Based Replication Binlog $ mysqlbinlog mysql-bin.000001 # at 3134 #140721 13:59:57 server id 1 end_log_pos 3217 CRC32 0x974e3831 Query thread_id=9 exec_time=0 error_code=0 SET TIMESTAMP=1405943997/*!*/; BEGIN /*!*/; # at 3217 #140721 13:59:57 server id 1 end_log_pos 3249 CRC32 0x8de28161 Intvar SET INSERT_ID=2/*!*/; # at 3249 #140721 13:59:57 server id 1 end_log_pos 3370 CRC32 0x121ef29f Query thread_id=9 exec_time=0 error_code=0 SET TIMESTAMP=1405943997/*!*/; insert into auto (data) values ('a test 2') /*!*/; # at 3370 #140721 13:59:57 server id 1 end_log_pos 3401 CRC32 0x34354945 Xid = 414 COMMIT/*!*/;
  • 49. Dynamic replication variable control •SET GLOBAL binlog_format=‘STATEMENT’ | ‘ROW’ | ‘MIXED’ • Can also be set as a session level • Dynamic replication filtering variables on MariaDB 5.3+, MySQL 5.7+
  • 50. Row based replication event > mysqlbinlog mysql-bin.* # at 3401 #140721 14:03:59 server id 1 end_log_pos 3477 CRC32 0xa37f424a Query thread_id=9 exec_time=0 error_code=0 SET TIMESTAMP=1405944239.559237/*!*/; BEGIN /*!*/; # at 3477 #140721 14:03:59 server id 1 end_log_pos 3529 CRC32 0xf4587de5 Table_map: `demo`.`auto` mapped to number 80 # at 3529 #140721 14:03:59 server id 1 end_log_pos 3585 CRC32 0xbfd73d98 Write_rows: table id 80 flags: STMT_END_F BINLOG ' rwHNUxMBAAAANAAAAMkNAAAAAFAAAAAAAAEABGRlbW8ABGF1dG8AAwMRDwMGZAAE5X1Y9A== rwHNUx4BAAAAOAAAAAEOAAAAAFAAAAAAAAEAAgAD//gDAAAAU80BrwiIhQhhIHRlc3QgM5g9178= '/*!*/; # at 3585 #140721 14:03:59 server id 1 end_log_pos 3616 CRC32 0x5f422fed Xid = 416 COMMIT/*!*/;
  • 51. mysqlbinlog versions •ERROR: Error in Log_event::read_log_event(): 'Found invalid event in binary log', data_len: 56, event_type: 30 • 5.6 ships with a “streaming binlog backup server” - v.3.4; MariaDB 10 doesn’t - v.3.3 (fixed in 10.2 - MDEV-8713) • GTID variances!
  • 52. GTID # at 471 #140721 14:20:01 server id 1 end_log_pos 519 CRC32 0x209d8843 GTID [commit=yes] SET @@SESSION.GTID_NEXT= 'ff89bf58-105e-11e4-b2f1-448a5b5dd481:2'/*!*/; # at 519 #140721 14:20:01 server id 1 end_log_pos 602 CRC32 0x5c798741 Querythread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1405945201.329607/*!*/; BEGIN /*!*/; # at 602 # at 634 #140721 14:20:01 server id 1 end_log_pos 634 CRC32 0xa5005598 Intvar SET INSERT_ID=5/*!*/; #140721 14:20:01 server id 1 end_log_pos 760 CRC32 0x0b701850 Querythread_id=3 exec_time=0 error_code=0 SET TIMESTAMP=1405945201.329607/*!*/; insert into auto (data) values ('a test 5 gtid') /*!*/; # at 760 #140721 14:20:01 server id 1 end_log_pos 791 CRC32 0x497a23e0 Xid = 31 COMMIT/*!*/;
  • 53. SHOW SLAVE STATUS mysql> show slave statusG *************************** 1. row *************************** Slave_IO_State: Waiting for master to send event Master_Host: server1 Master_User: repluser Master_Port: 3306 ... Master_Log_File: server1-binlog.000008 <- io_thread (read) Read_Master_Log_Pos: 436614719 <- io_thread (read) Relay_Log_File: server2-relaylog.000007 <- io_thread (write) Relay_Log_Pos: 236 <- io_thread (write) Relay_Master_Log_File: server1-binlog.000008 <- sql_thread Slave_IO_Running: Yes Slave_SQL_Running: Yes ... Exec_Master_Log_Pos: 436614719 <- sql_thread ... Seconds_Behind_Master: 0
  • 54. Slave prefetching • Replication Booster • https://github.com/yoshinorim/replication-booster- for-mysql • Prefetch MySQL relay logs to make the SQL thread faster • Tungsten has slave prefetch • Percona Server till 5.6 + MariaDB till 10.1 have InnoDB fake changes
  • 55. What replaces slave prefetching? • In Percona Server 5.7, slave prefetching has been replaced by doing intra-schema parallel replication • Feature removed from Percona XtraDB storage engine • MariaDB Server 10.2 uses InnoDB so use intra-schema parallel replication too
  • 56. Tungsten Replicator • Replaces MySQL Replication layer • MySQL writes binlog, Tungsten reads it and uses its own replication protocol • Global Transaction ID • Per-schema multi-threaded slave • Heterogeneous replication: MySQL <-> MongoDB <-> PostgreSQL <-> Oracle • Multi-master replication • Multiple masters to single slave (multi-source replication) • Many complex topologies • Continuent Tungsten (Enterprise) vs Tungsten Replicator (Open Source)
  • 57. In today’s world, what does it offer? •opensource MySQL <-> Oracle replication to aid in your migration • automatic failover without MHA • multi-master with cloud topologies too •Oracle <-> Oracle replication (this is like Golden Gate for FREE) • Replication from MySQL to MongoDB • Data loading into Hadoop
  • 58. Galera Cluster • Inside MySQL, a replication plugin (wsrep) • Replaces MySQL replication (but can work alongside it too) • True multi-master, active-active solution • Virtually Synchronous • WAN performance: 100-300ms/commit, works in parallel • No slave lag or integrity issues • Automatic node provisioning
  • 60. Percona XtraDB Cluster 5.7 • Engineering within Percona • Load balancing with ProxySQL (bundled) • Integration with Percona Monitoring & Management (PMM) • Benefits of all the MySQL 5.7 feature-set
  • 61. Group replication • Virtually fully synchronous replication (update everywhere), self- healing, with elasticity, redundancy • Single primary mode supported • MySQL InnoDB Cluster - a combination of group replication, Router, to make magic! • Recent blogs: • https://www.percona.com/blog/2017/02/24/battle-for-synchronous- replication-in-mysql-galera-vs-group-replication/ • https://www.percona.com/blog/2017/02/15/group-replication- shipped-early/
  • 62. MySQL NDBCLUSTER • 3 types of nodes: SQL, data and management • MySQL node provides interface to data. Alternate API’s available: LDAP, memcached, native NDBAPI, node.js • Data nodes (NDB storage) • different to InnoDB • transactions synchronously written to 2 nodes (or more) - replicas • transparent sharding: partitions = data nodes/replicas • automatic node provisioning, online re-partitioning • High performance: 1 billion updates / minute
  • 63. Summary of Replication Performance • SAN has "some" latency overhead compared to local disk. Can be great for throughput. • DRBD = potentially 50% performance penalty • Replication, when implemented correctly, has no performance penalty • But MySQL replication with disk bound data set has single- threaded issues! • Semi-sync is poorer on WAN compared to async • Galera & NDB provide read/write scale-out, thus more performance
  • 64. Handling failure • How do we find out about failure? • Polling, monitoring, alerts... • Error returned to and handled in client side • What should we do about it? • Direct requests to the spare nodes (or DCs) • How to protect data integrity? • Master-slave is unidirectional: Must ensure there is only one master at all times. • DRBD and SAN have cold-standby: Must mount disks and start mysqld. • In all cases must ensure that 2 disconnected replicas cannot both commit independently. (split brain)
  • 65. Frameworks to handle failure • MySQL-MMM • Severalnines ClusterControl • Orchestrator • MySQL MHA • Percona Replication Manager • Tungsten Replicator • 5.6: mysqlfailover, mysqlrpladmin • Replication Manager
  • 66. MySQL-MMM • You have to setup all nodes and replication manually • MMM gives Monitoring + Automated and manual failover on top • Architecture consists of Monitor and Agents • Typical topology: • 2 master nodes • Read slaves replicate from each master • If a master dies, all slaves connected to it are stale • http://mysql-mmm.org/
  • 67. Severalnines ClusterControl • Started as automated deployment of MySQL NDB Cluster • now: 4 node cluster up and running in 5 min! • Now supports • MySQL replication and Galera • Semi-sync replication • Automated failover • Manual failovers, status check, start & stop of node, replication, full cluster... from single command line. • Monitoring • Topology: Pair of semi-sync masters, additional read-only slaves • Can move slaves to new master • http://severalnines.com/
  • 68. ClusterControl II • Handles deployment: on-premise, EC2, or hybrid (Rackspace, etc.) • Adding HAProxy as a Galera load balancer • Hot backups, online software upgrades • Workload simulation • Monitoring (real-time), health reports
  • 69. Orchestrator • Reads replication topologies, keeps state, continuous polling • Modify your topology — move slaves around • Nice GUI, JSON API, CLI http://pmmdemo.percona.com/ orchestrator/web/clusters
  • 70. MySQL MHA • Like MMM, specialized solution for MySQL replication • Developed by Yoshinori Matsunobu at DeNA • Automated and manual failover options • Topology: 1 master, many slaves • Choose new master by comparing slave binlog positions • Can be used in conjunction with other solutions • http://code.google.com/p/mysql-master-ha/
  • 71. Cluster suites • Heartbeat, Pacemaker, Red Hat Cluster Suite • Generic, can be used to cluster any server daemon • Usually used in conjunction with Shared Disk or Replicated Disk solutions (preferred) • Can be used with replication. • Robust, Node Fencing / STONITH
  • 72. Pacemaker • Heartbeat, Corosync, Pacemaker • Resource Agents, Percona-PRM • Percona Replication Manager - cluster, geographical disaster recovery options • Pacemaker agent specialised on MySQL replication • https://github.com/percona/percona-pacemaker-agents/ • Pacemaker Resource Agents 3.9.3+ include Percona Replication Manager (PRM)
  • 73. VM based failover • VMWare, Oracle VM, etc can migrate / failover the entire VM guest • This isn’t the focus of the talk
  • 74. Load Balancers for multi-master clusters • Synchronous multi-master clusters like Galera require load balancers • HAProxy • Galera Load Balancer (GLB) • MaxScale • ProxySQL
  • 75. What is a proxy? • Lightweight application between the MySQL clients and the server • Man-in-the-middle between client/server • Communicate with one or more clients/ servers
  • 77. MySQL Proxy - ten years ago! • The first proxy, which had an embedded Lua interpreter • It is used in MySQL Enterprise Monitor • Lua was flexible to allow you to rewrite queries, add statements, filter, etc. • 2007-2014
  • 78. MariaDB MaxScale 1.0…1.4.x • GA January 2015 • The “Swiss Army Knife” - pluggable router with an extensible architecture • Logging, writing to other backends (besides MySQL), firewall filter, routing via hints, query rewriting • Binlog Server - popularised by booking.com to not have intermediate masters • Popular use case: sitting in front of a 3-node Galera Cluster
  • 79. MariaDB MaxScale ecosystem • First known plugin: Kafka backend written by Yves Trudeau • https://www.percona.com/blog/2015/06/08/maxscale-a-new-tool-to-solve-your- mysql-scalability-problems/ • First known credible fork: AirBnB MaxScale 1.3 •connection pooling (not 1:1, multiplexed N:M, N>M connections), requests throttling, denylist query rejection, monitoring
  • 80. MariaDB MaxScale 2.0 • Same Github repository, unlinked against MySQL client libraries (replaced with SQLite), CDC to Kafka, binlog events to Avro/JSON • License change from GPLv2 to Business Source License (BSL)
  • 83. MariaDB MaxScale 2.1 • Dynamic (re)configuration • Performance
  • 84. MySQL Router - GPLv2 • GA October 2015 • Transparent routing between applications and any backend MySQL servers • Pluggable architecture via the MySQL Harness • Failover, load balancing • This is how you manage MySQL InnoDB Cluster with mysqlsh - https://www.youtube.com/watch? v=JWy7ZLXxtZ4
  • 85. ProxySQL - GPLv3 • Stable December 2015 • ProxySQL - included with Percona XtraDB Cluster 5.7, proxysql- admin tool available for PXC configurations • Improve database operations, understand and solve performance issues, HA to DB topology • Connection Pooling & Multiplexing • Read/Write Split and Sharding • Seamless failover (including query rerouting), load balancing • Query caching • Query rewriting • Query blocking (database aware firewall) • Query mirroring (cache warming) • Query throttling and timeouts • Runtime reconfigurable • Monitoring built-in
  • 87. ProxySQL missing features from MariaDB MaxScale • Front-end SSL encryption (client -> SSL -> proxy -> application) - issue#891 • Binlog router • Streaming binlogs to Kafka • use Maxwell’s Daemon: http://maxwells- daemon.io/ • Binlogs to Avro
  • 88. ProxySQL Resources • Marco Tusa: https://tusacentral.net/joomla/ index.php/mysql-blogs • SeveralNines: https://severalnines.com/blog? keywords=%23proxysql • Pythian: https://www.pythian.com/blog/tag/proxysql/ • Percona: https://www.percona.com/blog/category/ proxysql/
  • 89. Health of these projects • MariaDB MaxScale: 142 watchers, 670 stars, 199 forks, 19 contributors • MySQL Router: 25 watchers, 47 stars, 30 forks, 8 contributors • ProxySQL: 119 watchers, 951 stars, 145 forks, 25 contributors
  • 92. What do you use? • MySQL Router is clearly very interesting going forward, especially with the advent of the MySQL InnoDB Cluster • ProxySQL is a great choice today, has wide use, also has Percona Monitoring & Management (PMM) integration • MariaDB MaxScale pre-2.0 if you really need a binlog router • Server you’re using?
  • 93. Resources • ProxySQL: https://groups.google.com/ forum/#!forum/proxysql • MariaDB MaxScale: https:// groups.google.com/forum/#!forum/maxscale • MySQL Router: https://forums.mysql.com/ list.php?146
  • 94. JDBC/PHP drivers • JDBC - multi-host failover feature (just specify master/slave hosts in the properties) • true for MariaDB Java Connector too • PHP handles this too - mysqlnd_ms • Can handle read-write splitting, round robin or random host selection, and more
  • 95. Clustering: solution or part of problem? • "Causes of Downtime in Production MySQL Servers" whitepaper, Baron Schwartz, VividCortex • Human error • SAN • Clustering framework + SAN = more problems • Galera is replication based, has no false positives as there’s no “failover” moment, you don’t need a clustering framework (JDBC or PHP can load balance), and is relatively elegant overall
  • 96. InnoDB based? • Use InnoDB, continue using InnoDB, know workarounds to InnoDB • All solutions but NDB are InnoDB. NDB is great for telco/session management for high bandwidth sites, but setup, maintenance, etc. is complex
  • 97. Replication type • Competence choices • Replication: MySQL DBA manages • DRBD: Linux admin manages • SAN: requires domain controller • Operations • DRBD (disk level) = cold standby = longer failover • Replication = hot standby = shorter failover • GTID helps tremendously • Performance • SAN has higher latency than local disk • DRBD has higher latency than local disk • Replication has little overhead • Redundancy • Shared disk = SPoF • Shared nothing = redundant
  • 98. SBR vs RBR? Async vs sync? • row based: deterministic • statement based: dangerous • GTID: easier setup & failover of complex topologies • async: data loss in failover • sync: best • semi-sync: best compromise • multi-threaded slaves: scalability (hello 5.6+, Tungsten)
  • 99. Conclusions for choice • Simpler is better • MySQL replication > DRBD > SAN • Sync replication = no data loss • Async replication = no latency (WAN) • Sync multi-master = no failover required • Multi-threaded slaves help in disk-bound workloads • GTID increases operational usability • Galera provides all this with good performance & stability
  • 101. Why MHA needs coverage • High Performance MySQL, 3rd Edition • Published: March 16 2012
  • 102. Where did MHA come from? • DeNA won 2011 MySQL Community Contributor of the Year (April 2011) • MHA came in about 3Q/2011 • Written by Yoshinori Matsunobu, Oracle ACE Director
  • 103. What is MHA? • MHA for MySQL: Master High Availability Manager tools for MySQL • Goal: automating master failover & slave promotion with minimal downtime • Set of Perl scripts • http://code.google.com/p/mysql-master-ha/
  • 104. Why MHA? • Automating monitoring of your replication topology for master failover • Scheduled online master switching to a different host for online maintenance • Switch back after OPTIMIZE/ALTER table, software or hardware upgrade • Schema changes without stopping services • pt-online-schema-change, oak-online-alter-table, Facebook OSC, Github gh-ost • Interactive/non-interactive master failover (just for failover, with detection of master failure + VIP takeover to Pacemaker)
  • 105. Why is master failover hard? • When master fails, no more writes till failover complete • MySQL replication is asynchronous (MHA works with async + semi-sync replication) • slave2 is latest, slave1+3 have missing events, MHA does: • copy id=10 from master if possible • apply all missing events
  • 106. MHA: Typical scenario • Monitor replication topology • If failure detected on master, immediately switch to a candidate master or the most current slave to become new master • MHA must fail to connect to master server three times • CHANGE MASTER for all slaves to new master • Print (stderr)/email report, stop monitoring
  • 107. So really, what does MHA do?
  • 108. Typical timeline • Usually no more than 10-30 seconds • 0-10s: Master failover detected in around 10 seconds • (optional) check connectivity via secondary network • (optional) 10-20s: 10 seconds to power off master • 10-20s: apply differential relay logs to new master • Practice: 4s @ DeNA, usually less than 10s
  • 109. How does MHA work? • Save binlog events from crashed master • Identify latest slave • Apply differential relay log to other slaves • Apply saved binlog events from master • Promote a slave to new master • Make other slaves replicate from new master
  • 110. Getting Started • MHA requires no changes to your application • You are of course to write to a virtual IP (VIP) for your master • MHA does not build replication environments for you - that’s DIY
  • 111. MHA Node • Download mha4mysql-node & install this on all machines: master, slaves, monitor • Packages (DEB, RPM) available • Manually, make sure you have DBD::mysql & ensure it knows the path of your MySQL
  • 112. MHA Manager server • Monitor server doesn’t have to be powerful at all, just remain up • This is a single-point-of-failure so monitor the manager server where MHA Manager gets installed • If MHA Manager isn’t running, your app still runs, but automated failover is now disabled
  • 113. MHA Manager • You must install mha4mysql-node then mha4mysql-manager • Manager server has many Perl dependencies: DBD::mysql, Config::Tiny, Log::Dispatch, Parallel::ForkManager, Time::HiRes • Package management fixes dependencies, else use CPAN
  • 114. Configuring MHA • Application configuration file: see samples/conf/app1.cnf • Place this in /etc/MHA/app1.cnf • Global configuration file: see /etc/MHA/ masterha_default.cnf (see samples/ conf/masterha_default.cnf)
  • 115. app1.cnf [server default] manager_workdir=/var/log/masterha/app1 manager_log=/var/log/masterha/app1/manager.log [server1] hostname=host1 [server2] hostname=host2 candidate_master=1 [server3] hostname=host3 [server4] hostname=host4 no_master=1 no need to specify master as MHA auto-detects this sets priority, but doesn’t necessarily mean it gets promoted as a default (say its too far behind replication). But maybe this is a more powerful box, or has a better setup will never be the master. RAID0 instead of RAID1+0? Slave is in another data centre?
  • 116. masterha_default.cnf [server default] user=root password=rootpass ssh_user=root master_binlog_dir= /var/lib/mysql,/var/log/mysql remote_workdir=/data/log/masterha ping_interval=3 # secondary_check_script=masterha_secondary_check -s remote_host1 -s remote_host2 # master_ip_failover_script= /script/masterha/master_ip_failover # shutdown_script= /script/masterha/power_manager # report_script= /script/masterha/send_report # master_ip_online_change_script= /script/masterha/ master_ip_online_change 116 check master activity from manager->remote_hostN-> master (multiple hosts to ensure its not a network issue) STONITH
  • 117. MHA uses SSH • MHA uses SSH actively; passphraseless login • In theory, only require Manager SSH to all nodes • However, remember masterha_secondary_check •masterha_check_ssh --conf=/etc/MHA/ app1.cnf
  • 118. Check replication •masterha_check_repl --conf=/etc/MHA/ app1.cnf • If you don’t see MySQL Replication Health is OK, MHA will fail • Common errors? Master binlog in different position, read privileges on binary/relay log not granted, using multi-master replication w/o read-only=1 set (only 1 writable master allowed)
  • 119. MHA Manager •masterha_manager --conf=/etc/MHA/ app1.cnf • Logs are printed to stderr by default, set manager_log • Recommended running with nohup, or daemontools (preferred in production) • http://code.google.com/p/mysql-master-ha/wiki/ Runnning_Background
  • 120. So, the MHA Playbook • Install MHA node, MHA manager •masterha_check_ssh --conf=/etc/ app1.cnf •masterha_check_repl --conf=/etc/ app1.cnf •masterha_manager --conf=/etc/app1.cnf • That’s it!
  • 121. master_ip_failover_script • Pacemaker can monitor & takeover VIP if required • Can use a catalog database • map between application name + writer/reader IPs • Shared VIP is easy to implement with minimal changes to master_ip_failover itself (however, use shutdown_script to power off machine)
  • 122. master_ip_online_change • Similar to master_ip_failover script, but used for online maintenance •masterha_master_switch -- master_state=alive • MHA executes FLUSH TABLES WITH READ LOCK after the writing freeze
  • 123. Test the failover •masterha_check_status --conf=/etc/ MHA/app1.cnf • Kill MySQL (kill -9, shutdown server, kernel panic) • MHA should go thru failover (stderr) • parse the log as well • Upon completion, it stops running
  • 124. masterha_master_switch • Manual failover •--master_state=dead • Scheduled online master switchover • Great for upgrades to server, etc. •masterha_master_switch -- master_state=alive --conf=/etc/MHA/ app1.cnf --new_master_host=host2
  • 125. Handling VIPs my $vip = ‘192.168.0.1/24”; my $interface = “0”; my $ssh_start_vip = “sudo /sbin/ifconfig eth0:$key $vip”; my $ssh_stop_vip = “sudo /sbin/ifconfig eth0:$key down”; ... sub start_vip() { `ssh $ssh_user@$new_master_host ” $ssh_start_vip ”`; } sub stop_vip() { `ssh $ssh_user@$orig_master_host ” $ssh_stop_vip ”`; }
  • 126. Integration with other HA solutions • Pacemaker • on RHEL6, you need some HA add-on, just use the CentOS packages • /etc/ha.d/haresources to configure VIP •`masterha_master_switch --master_state=dead --interactive=0 --wait_on_failover_error=0 -- dead_master_host=host1 -- new_master_host=host2` • Corosync + Pacemaker works well
  • 127. What about replication delay? • By default, MHA checks to see if slave is behind master. By more than 100MB, it is never a candidate master • If you have candidate_master=1 set, consider setting check_repl_delay=0 • You can integrate it with pt-heartbeat from Percona Toolkit
  • 128. MHA deployment tips • You really should install this as root • SSH needs to work across all hosts • If you don’t want plaintext passwords in config files, use init_conf_load_script • Each monitor can monitor multiple MHA pairs (hence app1, app2, etc.) • You can have a standby master, make sure its read-only • By default, master1->master2->slave3 doesn’t work • MHA manages master1->master2 without issue • Use multi_tier_slave=1 option • Make sure replication user exists on candidate master too!
  • 129. Consul • Service discovery & configuration. Distributed, highly available, data centre aware • Comes with its own built-in DNS server, KV storage with HTTP API • Raft Consensus Algorithm
  • 131. VIPs vs Consul • Previously, you handled VIPs and had to write to master_ip_online_change/master_ip_failover • system(“curl -X PUT -d ‘{”Node”:”master”}’ localhost:8500/v1/catalog/deregister); • system(“curl -X PUT -d ‘{”Node”:”master”, ”Address”:”$new_master_host”}’ localhost: 8500/v1/catalog/register);
  • 132. mysqlfailover • mysqlfailover from mysql-utilities using GTID’s in 5.6 • target topology: 1 master, n-slaves • enable: log-slave-updates, report-host, report-port, master-info-table=TABLE • modes: elect (choose candidate from list), auto (default), fail • --discover-slaves-login for topology discovery • monitoring node: SPoF • Errant transactions prevent failover! • Restart node? Rejoins replication topology, as a slave.
  • 133. MariaDB 10 • New slave: SET GLOBAL GTID_SLAVE_POS = BINLOG_GTID_POS("masterbin. 00024", 1600); CHANGE MASTER TO master_host="10.2.3.4", master_use_gtid=slave_pos; START SLAVE; • use GTID: STOP SLAVE
 CHANGE MASTER TO master_use_gtid=current_pos; START SLAVE; • Change master: STOP SLAVE
 CHANGE MASTER TO master_host="10.2.3.5"; START SLAVE;
  • 134. Where is MHA used • DeNA • Premaccess (Swiss HA hosting company) • Ireland’s national TV & radio service • Jetair Belgium (MHA + MariaDB!) • Samsung • SK Group • DAPA
  • 135. MHA 0.56 is current • Major release: MHA 0.56 April 1 2014 (0.55: December 12 2012) • http://code.google.com/p/mysql-master- ha/wiki/ReleaseNotes
  • 136. MHA 0.56 • 5.6 GTID: GTID + auto position enabled? Failover with GTID SQL syntax not relay log failover • MariaDB 10+ doesn’t work • MySQL 5.6 support for checksum in binlog events + multi-threaded slaves • mysqlbinlog and mysql in custom locations (configurable clients) • binlog streaming server supported
  • 137. MHA 0.56 • ping_type = INSERT (for master connectivity checks - assuming master isn’t accepting writes)
  • 138. Replication Manager • Support for MariaDB Server GTIDs, MySQL and Percona Server • Single, portable 12MB binary • Interactive GTID monitoring • Supports failover or switchover based on requests • Topology detection • Health checks • GUI! - https://github.com/tanji/replication-manager
  • 140. Is fully automated failover a good idea? • False alarms • Can cause short downtime, restarting all write connections • Repeated failover • Problem not fixed? Master overloaded? • MHA ensures a failover doesn’t happen within 8h, unless --last_failover_minute=n is set • Data loss • id=103 is latest, relay logs are at id=101, loss • group commit means sync_binlog=1, innodb_flush_log_at_trx_commit=1 can be enabled! (just wait for master to recover) • Split brain • sometimes poweroff takes a long time
  • 141. Video resources • Yoshinori Matsunobu talking about High Availability & MHA at Oracle MySQL day • http://www.youtube.com/watch?v=CNCALAw3VpU • Alex Alexander (AccelerationDB) talks about MHA, with an example of failover, and how it compares to Tungsten • http://www.youtube.com/watch?v=M9vVZ7jWTgw • Consul & MHA failover in action • https://www.youtube.com/watch?v=rA4hyJ-pccU
  • 142. References • Design document • http://www.slideshare.net/matsunobu/automated-master-failover • Configuration parameters • http://code.google.com/p/mysql-master-ha/wiki/Parameters • JetAir MHA use case • http://www.percona.com/live/mysql-conference-2012/sessions/ case-study-jetair-dramatically-increasing-uptime-mha • MySQL binary log • http://dev.mysql.com/doc/internals/en/binary-log.html
  • 144. Service Level Agreements (SLA) • AWS - 99.95% in a calendar month • Rackspace - 99.9% in a calendar month • Google - 99.95% in a calendar month • SLAs exclude “scheduled maintenance” • AWS is 30 minutes/week, so really 99.65%
  • 145. RDS: Multi-AZ • Provides enhanced durability (synchronous data replication) • Increased availability (automatic failover) • Warning: can be slow (1-10 mins+) • Easy GUI administration • Doesn’t give you another usable “read-replica” though
  • 146. External replication • MySQL 5.6 you can do RDS -> Non-RDS • enable backup retention, you now have binlog access • target: exporting data out of RDS • Replicate into RDS with 5.5.33 or later • AWS provides stored procedures like mysql.rds_set_external_master nowadays
  • 147. High Availability • Plan for node failures • Don’t assume node provisioning is quick • Backup, backup, backup! • “Bad” nodes exist • HA is not equal across options • RDS: DRBD (multi-AZ) • Google (v2): semi-sync replication
  • 148. Unsupported features • AWS MySQL: GTIDs (but MariaDB Server GTIDs work!), InnoDB Cache Warming (intra-schema parallel replication in 5.7 works - this was an XtraDB 5.6 feature), InnoDB transportable tablespaces, authentication plugins, password strength plugin, replication filters, semi-sync replication • AWS MariaDB: Data at Rest Encryption, MariaDB Galera Cluster, HandlerSocket, Multi-source Replication, Password validation plugin, simple_password_check, and cracklib_password_check, Replication Filters, Storage engine-specific object attributes, table and Tablespace Encryption • Google: UDFs, PERFORMANCE_SCHEMA, LOAD DATA INFILE, INSTALL PLUGIN, SELECT ... INTO OUTFILE • mysqlsh?
  • 149. Can you configure MySQL? • You don’t access my.cnf naturally • In AWS you have parameter groups which allow configuration of MySQL source: http://www.mysqlperformanceblog.com/2013/08/21/amazon-rds-with-mysql-5-6-configuration-variables/
  • 151. Sharding solutions • Not all data lives in one place • hash records to partitions • partition alphabetically? put n-users/ shard? organise by postal codes?
  • 152. Horizontal vs vertical 192.168.0.1 User id int(10) username char(15) password char(15) email char(50) 192.168.0.2 User id int(10) username char(15) password char(15) email char(50) 192.168.0.3 User id int(10) username char(15) password char(15) email char(50) 192.168.0.1 User id int(10) username char(15) password char(15) email char(50) 192.168.0.2 UserInfo login datetime md5 varchar(32) guid varchar(32) Better if INSERT heavy and there’s less frequently changed data
  • 153. How do you shard? • Use your own sharding framework • write it in the language of your choice • simple hashing algorithm that you can devise yourself • SPIDER • Tungsten Replicator • Tumblr JetPants • Google Vitess
  • 154. SPIDER • storage engine to vertically partition tables
  • 155. Tungsten Replicator (OSS) • Each transaction tagged with a Shard ID • controlled in a file: shard.list, exposed via JMX MBean API • primary use? geographic replication • in application, requires changes to use the API to specify shards used
  • 156. Tumblr JetPants • clone replicas, rebalance shards, master promotions (can also use MHA for master promotions) • Ruby library, range-based sharding scheme • https://github.com/tumblr/jetpants • Uses MariaDB as an aggregator node (multi- source replication)
  • 157. Google (YouTube) vitess • Servers & tools to scale MySQL for web written in Go • Has MariaDB Server & MySQL support • DML annotation, connection pooling, shard management, workflow management, zero downtime restarts • Become extremely easy to use: http://vitess.io/ (with the help of Kubernetes)
  • 159. Conclusion • MySQL replication is amazing if you know it (and monitor it) well enough • Large sites run just fine with semi-sync + tooling for automated failover • Galera Cluster is great for virtually synchronous replication • Don’t forget the need for a load balancer: ProxySQL is nifty
  • 160. At Percona, we care about your High Availability • Percona XtraDB Cluster 5.7 with support for ProxySQL and Percona Monitoring & Management (PMM) • Percona Monitoring & Management (PMM) with Orchestrator • Percona Toolkit • Percona Server for MySQL 5.7 • Percona XtraBackup
  • 163. Blogs • http://jfg-mysql.blogspot.com/ • http://planet.mysql.com/ • http://www.percona.com/blog/
  • 164. Tomorrow • 10:45-11:20 - Meet the Experts - O’Reilly Booth, Table 3 • 14:10-14:50 - Capacity planning for your data stores (Buckingham Room, Palace Suite — here)
  • 166. Q&A / Thanks colin.charles@percona.com / byte@bytebot.net @bytebot on Twitter | http://bytebot.net/blog/