SlideShare a Scribd company logo
MHA: Getting Started
& Moving Past Quirks
          Colin Charles, Monty Program Ab
  colin@montyprogram.com | byte@bytebot.net
  http://montyprogram.com/ | http://mariadb.org/
   http://bytebot.net/blog/ | @bytebot on Twitter
Percona Live London 2012, London, United Kingdom
                  4 December 2012
whoami

• Chief Evangelist, MariaDB at Monty
  Program Ab
• Formerly MySQL AB/Sun Microsystems
• Past lives included Fedora Project
  (FESCO), OpenOffice.org
Aims

• Why MHA?
• What does MHA do?
• How does MHA do it?
• Running MHA,VIP failover, integration, etc
• Who uses MHA?
My experience with
        MHA
• Started November 2011 (MHA 0.52, 0.53)
• NRE work to make it run on Solaris 10
  environment... with no Internet access :-)
• Continued deployment advice+work for
  data centre use
• Much thanks to SkySQL for the experience
Why this talk



• High Performance MySQL,
  3rd Edition
• Published: March 16 2012
Where did MHA come
       from?
•   2011 MySQL
    Community Award
    Corporate Contributor:
    DeNA

    •   MHA came shortly
        after the award

•   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?
1. Automating monitoring of your replication
   topology for master failover
2. Scheduled online master switching to a different
   host for online maintenance
  •   switch back after OPTIMIZE/ALTER table,
      software or hardware upgrade
3. Interactive/non-interactive master failover (just
   for failover, with detection of master failure + VIP
   takeover to Pacemaker)
Why is master failover
       hard?
•   When            •   slave2 is
    master fails,       latest,
    no more             slave1+3
    writes till         have missing
    failover            events,
    complete            MHA does:

•   MySQL               •   copy
    replication             id=10
    is                      from
    asynchrono              master if
    us (MHA                 possible
    works with
    async +             •   apply all
    semi-sync               missing
    replication)            events
Semi-sync replication
•   if master crashes (or is shutdown :P), MHA
    cannot save binlogs, latest data is lost
•   minimizes risk of binlog event existing only on
    crashed master
•   guarantees at least one slave receives binlog
    events at commit
•   http://code.google.com/p/mysql-master-ha/wiki/
    UseCases#Using_together_with_Semi-
    Synchronous_Replication
MHA: Typical scenario
• Monitor replication topology
• If failure detected on master, immediately
  switch a candidate master or the most
  current slave to become new master
• CHANGE MASTER for all slaves to new
  master
• Print (stderr)/email report, stop monitoring
What does MHA do?
Typical timeline
•   Usually no more than 10-30 seconds
•   0-10s: Master failover detected in around 10
    seconds
•   (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
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           •   MHA does
    requires no       not build
    changes to        replication
    your              environmen
    application       ts for you -
                      that’s DIY
•   You are of
    course to
    write to a
    virtual IP
    (VIP) for
    your master
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
What’s in MHA node
•   save_binary_logs - save & copy master’s
    binlogs

•   apply_diff_relay_logs - find differential
    relay log events & apply missing events

•   purge_relay_logs - purge relay log files

•   filter_mysqlbinlog - OBSOLETE + not
    used by MHA (trims ROLLBACK statements &
    equivalent binlog events added by mysqlbinlog)
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
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]
                                  no need to specify master as
hostname=host1
                                    MHA auto-detects this
[server2]
hostname=host2
                            sets priority, but doesn’t necessarily mean it gets promoted
candidate_master=1
                                   as a default (say its too far behind replication).
                           But maybe this is a more powerful box, or has a better setup
[server3]

hostname=host3


[server4]
                                will never be the master. RAID0 instead of RAID1+0?
hostname=host4
                                            Slave is in another data centre?
no_master=1
masterha_default.cnf
[server default]
                                                      check master activity from
                                                     manager->remote_hostN->
user=root
                                                       master (multiple hosts to
password=rootpass
                                                    ensure its not a network issue)
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
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
    even daemontools

    • 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!
master_ip_failover_script

• Pacemaker can monitor & takeover VIP if
  required or you can have a catalog database
• 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
Handling VIPs
                                    master_ip_online_change
my $vip = ‘192.168.0.1/24”;            master_ip_failover
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 solution
•   Pacemaker
    •   on RHEL6, you need some HA add-on, just
        use the CentOS
•   /etc/ha.d/haresources to configure VIP
•   A mostly 80% guide on how to get it going
    (using corosync+pacemaker):
    •   http://www.mysqlfanboy.com/2012/02/the-
        full-monty-version-2-3/
Solaris 10
•   MHA tested to work on Linux and Solaris 10 & greater
•   Use a .pkg MySQL
•   Solaris 10 needs a compiler (SolarisStudio - register w/
    Oracle to download)
•   CPAN: manual builds of dependencies
•   Solaris doesn’t have md5sum (call md5)
•   Solaris ssh isn’t OpenSSH, missing some features like
    ConnectionTimeout
What about replication
       delay?
•   by default, MHA checks to see if slave is behind
    master. By more than 100MB, it is never a candidate
    slave

•   If you have candidate_master=1 set, consider
    setting check_repl_delay=0

•   You can integrate it with pt-heartbeat from
    Percona Toolkit
    •   http://www.percona.com/doc/percona-toolkit/2.1/
        pt-heartbeat.html
MHA deployment tips
•   You really should install this as   •   You can have a standby master,
    root                                    make sure its read-only

•   SSH needs to work across all        •   By default, master1->master2-
    hosts                                   >slave3 doesn’t work

•   If you don’t want plaintext             •   MHA manages master1-
    passwords in config files, use                >master2 w/o issue
    init_conf_load_script
                                            •   use multi_tier_slave=1
•   Each monitor can monitor                    option
    multiple MHA pairs (hence
    app1, app2, etc.)                   •   Make sure replication user
                                            exists on candidate master too!
Alternative solutions
• Heartbeat + DRBD
 • cost $$$ -> passive master
 • innodb_flush_log_at_trx_commit=1,
   sync_binlog=1
   • use MariaDB/PS: https://
     kb.askmonty.org/en/group-commit-for-
     the-binary-log/
Alternative solutions II
• MySQL NDB Cluster
 • its not InnoDB...
• Percona Replication Manager (PRM)
• Tungsten Replicator
• Eventually (maybe), mysqlfailover from
  mysql-utilities using GTIDs in 5.6+
Where is MHA used
•   DeNA
•   Premaccess (Swiss HA hosting company)
•   Ireland’s national TV & radio service
•   Jetair Belgium (MHA + MariaDB!)
•   Samsung
•   SK Group
•   DAPA
•   Facebook
MHA 0.54                   Just
                                   released!




• MHA is being worked on & developed
  while Matsunobu-san is at Facebook
• MHA 0.54 is released December 1 2012
• http://code.google.com/p/mysql-master-ha/
  wiki/ReleaseNotes
Roadmap
• Improve examples in package (0.55 is
  already in works)
• Make more integrations: pt-heartbeat,
  commit Solaris code upstream, easier
  packages with Pacemaker/corosync
• More automated master recovery if possible
• Front-end that isn’t console
Support
• SkySQL: www.skysql.com
• Training from AccelerationDB
 • http://www.accelerationdb.com/mysql-
    mha-training.htm
• Developer support from Monty Program
  Ab: http://montyprogram.com/developer-
  support/
Automated tools

• 4-host Vagrant setup for MySQL MHA:
  https://github.com/hholzgra/vagrant-mysql-
  mha
• Palomino Cluster Tool: https://github.com/
  time-palominodb/PalominoClusterTool
  • Ansible playbooks for MHA
Video
• 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
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
Advert
• Donate to the MariaDB
  project & help keep the
  ecosystem alive
 • https://kb.askmonty.org/en/
    donations/
• Buy some merchandise:
  • http://www.cafepress.com/
    mariadb
Q&A
colin@montyprogram.com | byte@bytebot.net
http://montyprogram.com/ | http://mariadb.org/
twitter: @bytebot | url: http://bytebot.net/blog/

More Related Content

What's hot

MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
Lenz Grimmer
 
MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012
Colin Charles
 
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 CharlesInsight Technology, Inc.
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB Enterprise
MariaDB Corporation
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
Manish Kumar
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Kenny Gryp
 
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
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
Frederic Descamps
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
Ulf Wendel
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011
Henrik Ingo
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
Morgan Tocker
 
Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015
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
 
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
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
Colin Charles
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
Wipro
 
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Severalnines
 
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
 
Galera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replicationGalera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replication
Codership Oy - Creators of Galera Cluster
 
Methods of Sharding MySQL
Methods of Sharding MySQLMethods of Sharding MySQL
Methods of Sharding MySQLLaine Campbell
 

What's hot (20)

MySQL High Availability Solutions
MySQL High Availability SolutionsMySQL High Availability Solutions
MySQL High Availability Solutions
 
MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012MariaDB 5.5 and what comes next - Percona Live NYC 2012
MariaDB 5.5 and what comes next - Percona Live NYC 2012
 
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
 
High Availability with MariaDB Enterprise
High Availability with MariaDB EnterpriseHigh Availability with MariaDB Enterprise
High Availability with MariaDB Enterprise
 
MySQL Group Replication
MySQL Group ReplicationMySQL Group Replication
MySQL Group Replication
 
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group ReplicationPercona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
Percona XtraDB Cluster vs Galera Cluster vs MySQL Group Replication
 
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)
 
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
OpenWorld 2014 - Schema Management: versioning and automation with Puppet and...
 
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
MySQL? Load? Clustering! Balancing! PECL/mysqlnd_ms 1.4
 
Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011Choosing a MySQL High Availability solution - Percona Live UK 2011
Choosing a MySQL High Availability solution - Percona Live UK 2011
 
MySQL Performance Metrics that Matter
MySQL Performance Metrics that MatterMySQL Performance Metrics that Matter
MySQL Performance Metrics that Matter
 
Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015Meet MariaDB Server 10.1 London MySQL meetup December 2015
Meet MariaDB Server 10.1 London MySQL meetup December 2015
 
MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016MariaDB Server & MySQL Security Essentials 2016
MariaDB Server & MySQL Security Essentials 2016
 
Best practices for MySQL High Availability
Best practices for MySQL High AvailabilityBest practices for MySQL High Availability
Best practices for MySQL High Availability
 
The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015The Complete MariaDB Server Tutorial - Percona Live 2015
The Complete MariaDB Server Tutorial - Percona Live 2015
 
Master master vs master-slave database
Master master vs master-slave databaseMaster master vs master-slave database
Master master vs master-slave database
 
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
Webinar slides: ClusterControl 1.4: The MySQL Replication & MongoDB Edition -...
 
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
 
Galera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replicationGalera webinar migration to galera cluster from my sql async replication
Galera webinar migration to galera cluster from my sql async replication
 
Methods of Sharding MySQL
Methods of Sharding MySQLMethods of Sharding MySQL
Methods of Sharding MySQL
 

Viewers also liked

Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Pedro Gomes
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
Kenny Gryp
 
Mysql展示功能与源码对应
Mysql展示功能与源码对应Mysql展示功能与源码对应
Mysql展示功能与源码对应
zhaolinjnu
 
MySQL - checklist для новичка в Highload
MySQL - checklist для новичка в HighloadMySQL - checklist для новичка в Highload
MySQL - checklist для новичка в Highload
Sveta Smirnova
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
Giuseppe Maxia
 
Эффективная отладка репликации MySQL
Эффективная отладка репликации MySQLЭффективная отладка репликации MySQL
Эффективная отладка репликации MySQL
Sveta Smirnova
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
Nuno Carvalho
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
Frederic Descamps
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
Kenny Gryp
 
Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
Ronald Bradford
 
Mysql参数-GDB
Mysql参数-GDBMysql参数-GDB
Mysql参数-GDB
zhaolinjnu
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
Mario Beck
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
Ivan Ma
 
2010丹臣的思考
2010丹臣的思考2010丹臣的思考
2010丹臣的思考
zhaolinjnu
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
Carol McDonald
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
Kenny Gryp
 
High Availability Using MySQL Group Replication
High Availability Using MySQL Group ReplicationHigh Availability Using MySQL Group Replication
High Availability Using MySQL Group Replication
OSSCube
 
A New Architecture for Group Replication in Data Grid
A New Architecture for Group Replication in Data GridA New Architecture for Group Replication in Data Grid
A New Architecture for Group Replication in Data Grid
Editor IJCATR
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
Mydbops
 
Using Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data AnalysisUsing Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data Analysis
Sveta Smirnova
 

Viewers also liked (20)

Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication SetupsMix ‘n’ Match Async and Group Replication for Advanced Replication Setups
Mix ‘n’ Match Async and Group Replication for Advanced Replication Setups
 
Multi Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ VerisureMulti Source Replication With MySQL 5.7 @ Verisure
Multi Source Replication With MySQL 5.7 @ Verisure
 
Mysql展示功能与源码对应
Mysql展示功能与源码对应Mysql展示功能与源码对应
Mysql展示功能与源码对应
 
MySQL - checklist для новичка в Highload
MySQL - checklist для новичка в HighloadMySQL - checklist для новичка в Highload
MySQL - checklist для новичка в Highload
 
Advanced mysql replication techniques
Advanced mysql replication techniquesAdvanced mysql replication techniques
Advanced mysql replication techniques
 
Эффективная отладка репликации MySQL
Эффективная отладка репликации MySQLЭффективная отладка репликации MySQL
Эффективная отладка репликации MySQL
 
Everything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group ReplicationEverything You Need to Know About MySQL Group Replication
Everything You Need to Know About MySQL Group Replication
 
MySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group ReplicationMySQL InnoDB Cluster - Group Replication
MySQL InnoDB Cluster - Group Replication
 
Reducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQLReducing Risk When Upgrading MySQL
Reducing Risk When Upgrading MySQL
 
Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1Successful Scalability Principles - Part 1
Successful Scalability Principles - Part 1
 
Mysql参数-GDB
Mysql参数-GDBMysql参数-GDB
Mysql参数-GDB
 
MySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDBMySQL 5.7: Focus on InnoDB
MySQL 5.7: Focus on InnoDB
 
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
MySQL InnoDB Cluster and MySQL Group Replication @HKOSC 2017
 
2010丹臣的思考
2010丹臣的思考2010丹臣的思考
2010丹臣的思考
 
Mysql For Developers
Mysql For DevelopersMysql For Developers
Mysql For Developers
 
Online MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackupOnline MySQL Backups with Percona XtraBackup
Online MySQL Backups with Percona XtraBackup
 
High Availability Using MySQL Group Replication
High Availability Using MySQL Group ReplicationHigh Availability Using MySQL Group Replication
High Availability Using MySQL Group Replication
 
A New Architecture for Group Replication in Data Grid
A New Architecture for Group Replication in Data GridA New Architecture for Group Replication in Data Grid
A New Architecture for Group Replication in Data Grid
 
Galera cluster for high availability
Galera cluster for high availability Galera cluster for high availability
Galera cluster for high availability
 
Using Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data AnalysisUsing Apache Spark and MySQL for Data Analysis
Using Apache Spark and MySQL for Data Analysis
 

Similar to MHA (MySQL High Availability): Getting started & moving past quirks

Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
Chris Tankersley
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera ClusterAbdul Manaf
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
PoguttuezhiniVP
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
CloudLinux
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
Continuent
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
MariaDB plc
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
MariaDB plc
 
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Lenz Grimmer
 
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATIONEXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
Mysql User Camp
 
Alibaba patches in MariaDB
Alibaba patches in MariaDBAlibaba patches in MariaDB
Alibaba patches in MariaDBLixun Peng
 
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & TroubleshootingApache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Jayush Luniya
 
Your Inner Sysadmin - MidwestPHP 2015
Your Inner Sysadmin - MidwestPHP 2015Your Inner Sysadmin - MidwestPHP 2015
Your Inner Sysadmin - MidwestPHP 2015
Chris Tankersley
 
RubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngineRubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngine
Treasure Data, Inc.
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
Valeriy Kravchuk
 
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
Colin Charles
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDB
MariaDB plc
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
sagar junnarkar
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerkuchinskaya
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Chris Tankersley
 
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet
 

Similar to MHA (MySQL High Availability): Getting started & moving past quirks (20)

Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015Your Inner Sysadmin - LonestarPHP 2015
Your Inner Sysadmin - LonestarPHP 2015
 
MariaDB Galera Cluster
MariaDB Galera ClusterMariaDB Galera Cluster
MariaDB Galera Cluster
 
MySQL database replication
MySQL database replicationMySQL database replication
MySQL database replication
 
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OSSupercharging your PHP pages with mod_lsapi in CloudLinux OS
Supercharging your PHP pages with mod_lsapi in CloudLinux OS
 
Training Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten ClusteringTraining Slides: Basics 102: Introduction to Tungsten Clustering
Training Slides: Basics 102: Introduction to Tungsten Clustering
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
 
Choosing the right high availability strategy
Choosing the right high availability strategyChoosing the right high availability strategy
Choosing the right high availability strategy
 
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
Making MySQL Administration a Breeze - A look into a MySQL DBA's toolchest
 
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATIONEXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
EXPERIENCE WITH MYSQL HA SOLUTION AND GROUP REPLICATION
 
Alibaba patches in MariaDB
Alibaba patches in MariaDBAlibaba patches in MariaDB
Alibaba patches in MariaDB
 
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & TroubleshootingApache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
Apache Ambari: Simplified Hadoop Cluster Operation & Troubleshooting
 
Your Inner Sysadmin - MidwestPHP 2015
Your Inner Sysadmin - MidwestPHP 2015Your Inner Sysadmin - MidwestPHP 2015
Your Inner Sysadmin - MidwestPHP 2015
 
RubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngineRubyKaigi 2014: ServerEngine
RubyKaigi 2014: ServerEngine
 
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB DevroomMore on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
More on bpftrace for MariaDB DBAs and Developers - FOSDEM 2022 MariaDB Devroom
 
Best practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability TutorialBest practices for MySQL High Availability Tutorial
Best practices for MySQL High Availability Tutorial
 
Best Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDBBest Practice for Achieving High Availability in MariaDB
Best Practice for Achieving High Availability in MariaDB
 
Deployment with capistrano
Deployment with capistranoDeployment with capistrano
Deployment with capistrano
 
Buytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemakerBuytaert kris my_sql-pacemaker
Buytaert kris my_sql-pacemaker
 
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
Your Inner Sysadmin - Tutorial (SunshinePHP 2015)
 
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
Puppet Camp NYC 2014: Build a Modern Infrastructure in 45 min!
 

More from Colin Charles

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
 
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
 
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
 
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
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
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
 

More from Colin Charles (20)

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
 
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
 
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
 
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
 
Lessons from database failures
Lessons from database failuresLessons from database failures
Lessons from database failures
 
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
 

Recently uploaded

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 

Recently uploaded (20)

Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

MHA (MySQL High Availability): Getting started & moving past quirks

  • 1. MHA: Getting Started & Moving Past Quirks Colin Charles, Monty Program Ab colin@montyprogram.com | byte@bytebot.net http://montyprogram.com/ | http://mariadb.org/ http://bytebot.net/blog/ | @bytebot on Twitter Percona Live London 2012, London, United Kingdom 4 December 2012
  • 2. whoami • Chief Evangelist, MariaDB at Monty Program Ab • Formerly MySQL AB/Sun Microsystems • Past lives included Fedora Project (FESCO), OpenOffice.org
  • 3. Aims • Why MHA? • What does MHA do? • How does MHA do it? • Running MHA,VIP failover, integration, etc • Who uses MHA?
  • 4. My experience with MHA • Started November 2011 (MHA 0.52, 0.53) • NRE work to make it run on Solaris 10 environment... with no Internet access :-) • Continued deployment advice+work for data centre use • Much thanks to SkySQL for the experience
  • 5. Why this talk • High Performance MySQL, 3rd Edition • Published: March 16 2012
  • 6. Where did MHA come from? • 2011 MySQL Community Award Corporate Contributor: DeNA • MHA came shortly after the award • Written by Yoshinori Matsunobu, Oracle ACE Director
  • 7. 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/
  • 8. Why MHA? 1. Automating monitoring of your replication topology for master failover 2. Scheduled online master switching to a different host for online maintenance • switch back after OPTIMIZE/ALTER table, software or hardware upgrade 3. Interactive/non-interactive master failover (just for failover, with detection of master failure + VIP takeover to Pacemaker)
  • 9. Why is master failover hard? • When • slave2 is master fails, latest, no more slave1+3 writes till have missing failover events, complete MHA does: • MySQL • copy replication id=10 is from asynchrono master if us (MHA possible works with async + • apply all semi-sync missing replication) events
  • 10. Semi-sync replication • if master crashes (or is shutdown :P), MHA cannot save binlogs, latest data is lost • minimizes risk of binlog event existing only on crashed master • guarantees at least one slave receives binlog events at commit • http://code.google.com/p/mysql-master-ha/wiki/ UseCases#Using_together_with_Semi- Synchronous_Replication
  • 11. MHA: Typical scenario • Monitor replication topology • If failure detected on master, immediately switch a candidate master or the most current slave to become new master • CHANGE MASTER for all slaves to new master • Print (stderr)/email report, stop monitoring
  • 13. Typical timeline • Usually no more than 10-30 seconds • 0-10s: Master failover detected in around 10 seconds • (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
  • 14. 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
  • 15. Getting Started • MHA • MHA does requires no not build changes to replication your environmen application ts for you - that’s DIY • You are of course to write to a virtual IP (VIP) for your master
  • 16. 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
  • 17. What’s in MHA node • save_binary_logs - save & copy master’s binlogs • apply_diff_relay_logs - find differential relay log events & apply missing events • purge_relay_logs - purge relay log files • filter_mysqlbinlog - OBSOLETE + not used by MHA (trims ROLLBACK statements & equivalent binlog events added by mysqlbinlog)
  • 18. 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
  • 19. 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
  • 20. 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)
  • 21. app1.cnf [server default] manager_workdir=/var/log/masterha/app1 manager_log=/var/log/masterha/app1/manager.log [server1] no need to specify master as hostname=host1 MHA auto-detects this [server2] hostname=host2 sets priority, but doesn’t necessarily mean it gets promoted candidate_master=1 as a default (say its too far behind replication). But maybe this is a more powerful box, or has a better setup [server3] hostname=host3 [server4] will never be the master. RAID0 instead of RAID1+0? hostname=host4 Slave is in another data centre? no_master=1
  • 22. masterha_default.cnf [server default] check master activity from manager->remote_hostN-> user=root master (multiple hosts to password=rootpass ensure its not a network issue) 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
  • 23. 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
  • 24. 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)
  • 25. MHA Manager • masterha_manager --conf=/etc/MHA/app1.cnf • Logs are printed to stderr by default, set manager_log • Recommended running with nohup, or even daemontools • http://code.google.com/p/mysql-master- ha/wiki/Runnning_Background
  • 26. 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!
  • 27. master_ip_failover_script • Pacemaker can monitor & takeover VIP if required or you can have a catalog database • Shared VIP is easy to implement with minimal changes to master_ip_failover itself (however, use shutdown_script to power off machine)
  • 28. 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
  • 29. 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
  • 30. 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
  • 31. Handling VIPs master_ip_online_change my $vip = ‘192.168.0.1/24”; master_ip_failover 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 ”`; }
  • 32. Integration with other HA solution • Pacemaker • on RHEL6, you need some HA add-on, just use the CentOS • /etc/ha.d/haresources to configure VIP • A mostly 80% guide on how to get it going (using corosync+pacemaker): • http://www.mysqlfanboy.com/2012/02/the- full-monty-version-2-3/
  • 33. Solaris 10 • MHA tested to work on Linux and Solaris 10 & greater • Use a .pkg MySQL • Solaris 10 needs a compiler (SolarisStudio - register w/ Oracle to download) • CPAN: manual builds of dependencies • Solaris doesn’t have md5sum (call md5) • Solaris ssh isn’t OpenSSH, missing some features like ConnectionTimeout
  • 34. What about replication delay? • by default, MHA checks to see if slave is behind master. By more than 100MB, it is never a candidate slave • If you have candidate_master=1 set, consider setting check_repl_delay=0 • You can integrate it with pt-heartbeat from Percona Toolkit • http://www.percona.com/doc/percona-toolkit/2.1/ pt-heartbeat.html
  • 35. MHA deployment tips • You really should install this as • You can have a standby master, root make sure its read-only • SSH needs to work across all • By default, master1->master2- hosts >slave3 doesn’t work • If you don’t want plaintext • MHA manages master1- passwords in config files, use >master2 w/o issue init_conf_load_script • use multi_tier_slave=1 • Each monitor can monitor option multiple MHA pairs (hence app1, app2, etc.) • Make sure replication user exists on candidate master too!
  • 36. Alternative solutions • Heartbeat + DRBD • cost $$$ -> passive master • innodb_flush_log_at_trx_commit=1, sync_binlog=1 • use MariaDB/PS: https:// kb.askmonty.org/en/group-commit-for- the-binary-log/
  • 37. Alternative solutions II • MySQL NDB Cluster • its not InnoDB... • Percona Replication Manager (PRM) • Tungsten Replicator • Eventually (maybe), mysqlfailover from mysql-utilities using GTIDs in 5.6+
  • 38. Where is MHA used • DeNA • Premaccess (Swiss HA hosting company) • Ireland’s national TV & radio service • Jetair Belgium (MHA + MariaDB!) • Samsung • SK Group • DAPA • Facebook
  • 39. MHA 0.54 Just released! • MHA is being worked on & developed while Matsunobu-san is at Facebook • MHA 0.54 is released December 1 2012 • http://code.google.com/p/mysql-master-ha/ wiki/ReleaseNotes
  • 40. Roadmap • Improve examples in package (0.55 is already in works) • Make more integrations: pt-heartbeat, commit Solaris code upstream, easier packages with Pacemaker/corosync • More automated master recovery if possible • Front-end that isn’t console
  • 41. Support • SkySQL: www.skysql.com • Training from AccelerationDB • http://www.accelerationdb.com/mysql- mha-training.htm • Developer support from Monty Program Ab: http://montyprogram.com/developer- support/
  • 42. Automated tools • 4-host Vagrant setup for MySQL MHA: https://github.com/hholzgra/vagrant-mysql- mha • Palomino Cluster Tool: https://github.com/ time-palominodb/PalominoClusterTool • Ansible playbooks for MHA
  • 43. Video • 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
  • 44. 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
  • 45. Advert • Donate to the MariaDB project & help keep the ecosystem alive • https://kb.askmonty.org/en/ donations/ • Buy some merchandise: • http://www.cafepress.com/ mariadb
  • 46. Q&A colin@montyprogram.com | byte@bytebot.net http://montyprogram.com/ | http://mariadb.org/ twitter: @bytebot | url: http://bytebot.net/blog/