Your SlideShare is downloading. ×
0
Migrating to MySQL, MariaDB
Galera, and/or Percona XtraDB
Cluster
March 2014
Johan Andersson
Severalnines AB
johan@several...
Online Migration
!  Existing MySQL Server
!  E.g Master – Slave setup
!  Single server
!  Tired of slave lag and data loss...
Online Migration
3
Copyright 2014 Severalnines AB
Master – Slave
RW R
Galera Cluster
m1 s1 gm1 gm2 gm3
Setup with
http://w...
Online Migration
!  On s1:
!  Enable
log-bin=binlog
log-slave-updates=1
!  GRANT
REPLICATION_SLAVE ON
*.* TO ‘repl’@’gm1’
...
Online Migration
!  On gm1:
!  Load in converted schema
!  Load in data
!  CHANGE MASTER TO
MASTER_HOST=‘s1’,
MASTER_USER=...
Online Migration
6
Copyright 2014 Severalnines AB
Master – Slave Galera Cluster
RW R
R/W
Online Migration
7
Copyright 2014 Severalnines AB
Master – Slave Galera Cluster
RW R
90% R/W 10% Reads
Cut Off
8
Copyright 2014 Severalnines AB
Master – Slave Galera Cluster
RW R
R/W
Demo Time!
!  Setting up Replication from Master to Galera Cluster
(acting as a slave cluster).
!  Master – Percona Server...
Operational Checklist
!  Are queues building up?
!  Slow queries? Tune queries in the Query Monitor.
!  Are backups workin...
Belt and Suspenders
!  Apply your backup procedures as normal
!  mysqldump –single-transaction
!  s9s_backup, front-end to...
Q & A
12
Copyright 2014 Severalnines AB
Thank you.
13
Copyright 2014 Severalnines AB
For further questions please contact John-Jerome Schmidt:
jj@severalnines.com
Upcoming SlideShare
Loading in...5
×

Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Cluster

4,726

Published on

Galera is slowly but surely establishing itself as a credible replacement for traditional MySQL master-slave architectures.

The benefits are clear - a true multi-master InnoDB setup with built-in fail-over, potentially across data centers.

But how do you migrate? Does the schema or application change? What are the limitations? Can migration be done online, without service interruption? What are the potential risks, and how to address those?

AGENDA

Application use cases for Galera
Schema design
Events and Triggers
Query design
Migrating the schema
Loading initial data into the cluster
Limitations
Performing Online Migration to Galera
Operational management checklist
Belts and suspenders: Plan B
Demo

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
4,726
On Slideshare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
12
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Transcript of "Webinar Slides : Migrating to MySQL, MariaDB Galera and/or Percona XtraDB Cluster"

  1. 1. Migrating to MySQL, MariaDB Galera, and/or Percona XtraDB Cluster March 2014 Johan Andersson Severalnines AB johan@severalnines.com Mobile +46 73 073 60 99
  2. 2. Online Migration !  Existing MySQL Server !  E.g Master – Slave setup !  Single server !  Tired of slave lag and data loss? !  Easy scaling w/o read/write splits? !  Feasibility - Data set, queries, suits Galera 2 Copyright 2014 Severalnines AB
  3. 3. Online Migration 3 Copyright 2014 Severalnines AB Master – Slave RW R Galera Cluster m1 s1 gm1 gm2 gm3 Setup with http://www.severalnines.com/galera-configurator Existing setup (examples based on 5.5)
  4. 4. Online Migration !  On s1: !  Enable log-bin=binlog log-slave-updates=1 !  GRANT REPLICATION_SLAVE ON *.* TO ‘repl’@’gm1’ IDENTIFIED BY ‘repl’ !  Dump schema and data into two separate files. !  Easier to convert the schema !  Best: convert schema already on slave Copyright 2014 Severalnines AB 4 Master – Slave RW R m1 s1
  5. 5. Online Migration !  On gm1: !  Load in converted schema !  Load in data !  CHANGE MASTER TO MASTER_HOST=‘s1’, MASTER_USER=‘repl’, MASTER_PASSWORD=‘repl’; !  START SLAVE; Copyright 2014 Severalnines AB 5 Galera Cluster gm1 gm2 gm3
  6. 6. Online Migration 6 Copyright 2014 Severalnines AB Master – Slave Galera Cluster RW R R/W
  7. 7. Online Migration 7 Copyright 2014 Severalnines AB Master – Slave Galera Cluster RW R 90% R/W 10% Reads
  8. 8. Cut Off 8 Copyright 2014 Severalnines AB Master – Slave Galera Cluster RW R R/W
  9. 9. Demo Time! !  Setting up Replication from Master to Galera Cluster (acting as a slave cluster). !  Master – Percona Server 5.5 !  Slave - 3 Node Galera Cluster – PXC 5.6 9 Copyright 2014 Severalnines AB Master Galera Cluster
  10. 10. Operational Checklist !  Are queues building up? !  Slow queries? Tune queries in the Query Monitor. !  Are backups working? !  Reporting queries? !  Latency issue? !  Do you have random node restarts and failures? Time to upgrade. !  Did you test new code before putting in production? You worst enemy is the network administrator! 10 Copyright 2014 Severalnines AB
  11. 11. Belt and Suspenders !  Apply your backup procedures as normal !  mysqldump –single-transaction !  s9s_backup, front-end to xtrabackup http://johanandersson.blogspot.se/2012/10/hotbackup-of-galera-cluster-for- mysql.html !  http://www.severalnines.com/blog/full-restore-mysql-galera-cluster-backup !  You may still want to have an async slave connected to the cluster !  Reporting !  Disaster Recovery !  http://www.severalnines.com/blog/asynchronous-replication-galera-cluster- mysql-server-gtid’ !  Point in time recovery !  http://www.severalnines.com/blog/point-time-recovery-galera-cluster 11 Copyright 2014 Severalnines AB
  12. 12. Q & A 12 Copyright 2014 Severalnines AB
  13. 13. Thank you. 13 Copyright 2014 Severalnines AB For further questions please contact John-Jerome Schmidt: jj@severalnines.com
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×