Download - MariaDB Roadshow 2015 Helsinki case study: Migrating from MySQL master-slave to MariaDB Galera Cluster

Transcript

About me● Bachelor of Media Engineering● Joined Verkkokauppa.com Oyj 2010 as

PHP developer● Appointed DBA mid 2014

Database● Created 2001, very little cleanup, normalization● Customers, orders, purchases, warehouse,

shipments, accounting, POS etc.● ~300 tables, latin1 and UTF-8 mixer● Peaked at 100 GB, currently 70 GB● Heading for 50 GB● Separate log db 20 GB

Daily averages● IOPS 20 (peak 40) ● 0.2 MB/s (that includes binlog :-)● Average 2000 qps ● Peaks 20000 qps● 30 DML / s

S3S2S1

MDML

SELECT

• 1 old master server• 3 old binlog slaves

Old

Oh so slow...

• 1 old master server• 3 old binlog slaves• 4 node tungsten cluster

T3T2T1 T4

treplicator

S3S2S1

MDML

SELECT

tconnector

SELECT

Old + tungstenSuperfast reports!

● Tungsten Enterprise 1.5.3 (early 2013)● Very feature rich (oracle, multi-source, topologies, WAN

replication)

Some issues we had● Sudden death of M->T replicator● Latin1/UTF-8 bug● A lot of configuration files and logs, services making

troubleshooting hard● Changing master “SWITCH TO” caused outage

Tungsten

● Replication is ROW based, therefore “ALTER … ADD PRIMARY KEY”

● Only supports InnoDB, therefore “ALTER … ENGINE=InnoDB”

● OPTIMIZE tables

● Provision nodes from a backup and start replicating from current master

Galera cluster ahead!

• 1 old master server• 3 old binlog slaves• 4 node tungsten cluster• 3 node galera cluster

T3T2T1 T4

treplicator

S3S2S1

M

tconnector

MariaDB+galera

G3G2G1

Galera cluster with old and tungsten

• 1 old master• 3 old binlog slaves• 3 node galera cluster

treplicator

S3S2S1

M

tconnector

MariaDB+galera

G3G2G1

Remove tungsten

• 1 master server• 3 galera cluster• 7 binlog slaves

S3S2S1 S4

S3S2S1

M

MariaDB+galera

G3G2G1

Cleanup

• 3 galera cluster• 4 binlog slaves S3S2S1 S4

M

MariaDB+galera

G3G2G1

Cleanup

• 3 galera cluster• 4 binlog slaves S3S2S1 S4

MariaDB+galera

G3G2G1

DML

SELECT

Current

MariaDB+Galera on virtual host● Take node out of rotation at any time ● Move virtual server between our Dcs.

Triggers IST if you're on a slow link.● Redundency● Not a single connection is lost

• 3 galera cluster• 4 binlog slaves S3S2S1 S4

MariaDB+galera

G3G2G1DML

SELECTBinlogserver

MaxScale?

Future plans