Sunteți pe pagina 1din 21

www.fromdual.

com
1 / 21
High-availability with
Galera Cluster
for MySQ
!rom"ual Com#a$y Meeti$g
1%. Se#tember 2%1&' (arcelo$a
by oli.se$$hauser)fromdual.com
www.fromdual.com
www.fromdual.com
2 / 21
*bout !rom"ual GmbH

!rom"ual #rovides $eutral a$d i$de#e$de$t+

Co$sulti$g for MySQ' Galera Cluster' Maria"( a$d


,erco$a Server

Su##ort for all MySQ a$d Galera Cluster

-emote-"(* Services for all MySQ

MySQ .rai$i$g

/#e$ Source (usi$ess *llia$ce 0/S(*1

Member of S/2G' "/*G' /ch/o#e$


www.fromdual.com
www.fromdual.com
3 / 21
High-*vailability +-0

4ho loves $ight-shifts5

4ho loves wee6e$d-wor65

4ho does regular u#grade 0"(' 6er$el'


etc.15

4ho does regular reboots 0after 6er$el


u#grade15

4hy are you $ot doi$g it i$ your office


hours5
www.fromdual.com
& / 21
.he Galera Cluster for MySQ
www.fromdual.com
7 / 21
Mai$te$a$ce time...
*##
oad bala$ci$g 0(1
8ode 2 8ode 1
wsre#
Galera re#licatio$
wsre#
8ode 3
wsre#
2#grade
-*M/H4
//S
"(5
www.fromdual.com
9 / 21
*dva$tages / "isadva$tages
(ased o$ :$$o"( S;
Sy$chro$ous re#licatio$ < 8o lost tra$sactio$
*ctive-active multi-master Cluster
< -ead a$d write to a$y cluster $ode 0$o r/w s#lit a$y more=1
-ead scalability a$d higher write through#ut 0!lash-Cache51
*utomatic $ode membershi# co$trol
-olli$g -estart 02#grade of Hardware' //S' "( release' etc.1
.rue #arallel re#licatio$' o$ row level
< 8o slave lag
* bit more com#licated tha$ $ormal MySQ' but similar
com#le>ity as M/S -e#licatio$=
8o origi$al MySQ bi$aries < Codershi# MySQ bi$aries
(e aware of Hot S#ots o$ rows+ Higher #robability of deadloc6s
www.fromdual.com
? / 21
Quorum a$d s#lit-brai$

4hat is the #roblem5

S#lit-brai$ < bad=

Galera is a #essimistic Cluster < good=

Quorum+ FLOOR(n/2+1)
< more tha$ half= < 3-$ode Cluster 0or 2@11
5
www.fromdual.com
A / 21
Quorum
www.fromdual.com
B / 21
:$stallatio$ a$d Co$figuratio$
www.fromdual.com
1% / 21
:$stallatio$

Galera Cluster co$sists of+

* #atched Codershi# MySQ 0mysqld1

/r Maria"( Galera Cluster

/r ,erco$a Ctra"( Cluster

.he Galera ,lugi$ 0libgalera_smm.so1

4ays of i$stallatio$

,ac6ets 0-,M' ";(1

(i$ary tar-ball

,atch MySQ source a$d com#ile both

"ow$load htt#+//galeracluster.com/dow$loads/
www.fromdual.com
11 / 21
MySQ Co$figuratio$
my.cnf
[mysqld]
default_storage_engine = InnoDB
binlog_format = row
innodb_autoinc_lock_mode = 2 # parallel applying
innodb_flush_log_at_trx_commit = 0 # performance only!
query_cache_size = 0 # Galera 3 experimental
query_cache_type = 0 # Mutex! Consistency!
www.fromdual.com
12 / 21
Galera Co$figuratio$
my.cnf 0conf.d/wsrep.cnf1
[mysqld]
# wsrep_provider = none
wsrep_provider = /lib/plugin/libgalera_smm.so
# wsrep_cluster_address = "gcomm://"
wsrep_cluster_address = "gcomm://ip_node!ip_node""
wsrep_cluster_name = #$alera %luster#
wsrep_node_name = #&ode '#
wsrep_sst_met(od = mysqldump
wsrep_sst_aut( = sst:secret
www.fromdual.com
13 / 21
/#eratio$s
www.fromdual.com
1& / 21
:$itial Cluster start

Start very 1
st
$ode with+
wsrep_cluster_address = "gcomm://"
or
mysqld_safe --wsrep-cluster-address="gcomm://"

< this tells the $ode to be the first o$e=

*ll other $odes $ormal+


service mysqld start
www.fromdual.com
17 / 21
-olli$g -estart

Sce$ario+

Hardware-' //S-' "(- a$d Galera-2#grade

MySQ co$figuratio$ cha$ge

"uri$g full o#eratio$=== 0BB.BBBD H*' 7>B H*1

< -olli$g -estart

Start o$e $ode after the other i$ a cycle

8ew features or setti$gs are used after -olli$g


-estart is com#leted
www.fromdual.com
19 / 21
oad (ala$ci$g

Co$$ectors

Co$$ector/E

,H,+ MySQ$d re#licatio$ a$d load bala$ci$g


#lug-i$

S4 oad (ala$cer

G(' FS/:,FS/director' H*,ro>y

H4 oad (ala$cer
www.fromdual.com
1? / 21
ocatio$ of oad (ala$ci$g
www.fromdual.com
1A / 21
/$li$e Schema 2#grade 0/S21

Schema 2#grade G "" ru$ agai$st the "(

Cha$ge "( structure

8o$ tra$sactio$al

2 Methods+

.otal /rder :solatio$ 0./:1 0default1

-olli$g Schema 2#grade 0-S21

wsrep_osu_method = {TOI|RSU}
www.fromdual.com
1B / 21
/$li$e Schema 2#grade

.otal /rder :solatio$ 0./:1 0default1

,art of the database is loc6ed for the duratio$ of the "".

@ Sim#le' #redictable a$d guara$teed data co$siste$cy.

- oc6i$g o#eratio$

Good for fast "" o#eratio$s

-olli$g Schema 2#grade 0-S21

"" will be o$ly #rocessed locally at the $ode.

8ode is desy$chro$iHed for the duratio$ of the "" #rocessi$g.

*fter "" com#letio$' delayed write sets are a##lied 0similar to :S.1.

"" should be ma$ually e>ecuted at each $ode.

@ o$ly bloc6i$g o$e $ode at a time

- #ote$tially u$safe a$d may fail if $ew a$d old schema are i$com#atible

Good for slow "" o#eratio$s


www.fromdual.com
2% / 21
4e wa$t you=

"atabase e$thusiast for su##ort /


remote-"(* / co$sulti$g
www.fromdual.com
21 / 21
Q I *
Questio$s 5
"iscussio$5
4e have time for some face-to-face tal6s...

!rom"ual #rovides $eutral a$d i$de#e$de$t+

Co$sulti$g

-emote-"(*

Su##ort for MySQ' Galera' ,erco$a Server a$d Maria"(

.rai$i$g
www.fromdual.com

S-ar putea să vă placă și