+ All Categories
Home > Engineering > MySQL Failover and Orchestrator

MySQL Failover and Orchestrator

Date post: 22-Jan-2018
Category:
Upload: simon-j-mudd
View: 317 times
Download: 6 times
Share this document with a friend
26
Barcelona MySQL Meetup MySQL Failover and Orchestrator Simon Mudd [email protected] 5 th July 2017
Transcript
Page 1: MySQL Failover and Orchestrator

BarcelonaMySQLMeetup

MySQLFailoverandOrchestratorSimonMudd [email protected]

5thJuly2017

Page 2: MySQL Failover and Orchestrator

Content

• HandlingfailoverwithMySQL• Downtime&Requirements• MySQLClusteringsolutions• Non-clusteringsolutionsandconsiderations

• Orchestrator• Questions

105/07/2017 BarcelonaMySQLMeetup

Page 3: MySQL Failover and Orchestrator

IsDowntimeAcceptable?

• Doyouhaveasystemthatneedstorun24x7?• Noteveryonedoes• Ifyouhaveawebsitethengenerallydowntimeisnotacceptable

205/07/2017 BarcelonaMySQLMeetup

Page 4: MySQL Failover and Orchestrator

Requirements

Goal:Run24x7x365withno downtime• Isthisreallynecessary?• Ifyouaskmanagementthey’llalwayssayyes…• Whatisthecost?• Shorterdowntimerequirementsmeanmoreeffortspenttoachievethat• Howdoyoureliably detectfailure?Hardproblemtosolve

Ifyouacceptdowntimehowmuchcanyoureallytolerate?• 1s,5s,30s,1min?

305/07/2017 BarcelonaMySQLMeetup

Page 5: MySQL Failover and Orchestrator

Whatoptionsareavailable?

• MySQLCluster• carriergrade• veryhighuptime• NotInnoDB – specialised workloads

• Galera• Oftenwithasynchronousreplicationbetweendatacentres

• InnoDB Cluster• Verynew

• Allrequireclientstotakeactiononfailureofanode• Ifyouuseaproxythatcanfailtoo…

405/07/2017 BarcelonaMySQLMeetup

Page 6: MySQL Failover and Orchestrator

Whatoptionsareavailable?

“Clustersolutions”• Donotworkwellcross-DCduetolatency• Ifyouacceptwritesintomultiplemastersthere’sachanceofconflict• Slowsthingsdown• InnoDB Clusternowdoesnotrecommendthisbehaviour – requirescare

• Onlysmallsetupsworkinasingledata-centre soadaptationhereisalsoneeded• Clustersetupsdonotscaleeasilyto10ormoreservers

505/07/2017 BarcelonaMySQLMeetup

Page 7: MySQL Failover and Orchestrator

Whatoptionsareavailable?

• StandardMySQL,MariaDB,AmazonRDS,GoogleCloudSQL,…• Readscale-out• Asynchronousreplication• Semi-synchelpsimproveperformanceandensuredatais“somewhereelse”whenacknowledgingatransaction

• Ifyouareoutofthecloudthen:differentsetups• SBRorRBR?• NoGTID,OracleorMySQLGTID?• Optionalsemi-sync?

• Ifyouareoutofthecloudthen:doityourself• MHA• MariaDB ReplicationManager• Orchestrator

605/07/2017 BarcelonaMySQLMeetup

Page 8: MySQL Failover and Orchestrator

Orchestrator

705/07/2017 BarcelonaMySQLMeetup

Page 9: MySQL Failover and Orchestrator

Orchestrator

• Handlesmasterfailover,butmore…• GUItomanageandvisualise topology– veryhandy• CLItodothesamethings– goodforscripting• APIcallstorunatadistance(moregenericinterface)• NeedsaDBbackendtostorestate.• NormallyMySQLbutcanbeSQLite

805/07/2017 BarcelonaMySQLMeetup

Page 10: MySQL Failover and Orchestrator

Orchestrator

• WrittenbyShlomi Noach whoworksatgithub• Heworkedpreviouslyatbooking.com andintroducedustoorchestrator,previouslyworkingatoutbrain.

905/07/2017 BarcelonaMySQLMeetup

Page 11: MySQL Failover and Orchestrator

Orchestrator

Whatfailuresdoesithandle?• Masterfailures– needstotalktoexternalsystems• Intermediatemasterfailures– canhandleonitsown• Doesnot careaboutslavesorapplications• WorkswithGTID:OracleorMariaDB• WorkswithoutusingGTID:CanaddPseudo-GTID (eventsinjectedonthemasterareusedtofindamatch)sononeedtomigratetoGTIDifnotwanted• Handlesmulti-leveltopologies

1005/07/2017 BarcelonaMySQLMeetup

Page 12: MySQL Failover and Orchestrator

OrchestratorGUI

1105/07/2017 BarcelonaMySQLMeetup

Page 13: MySQL Failover and Orchestrator

OrchestratorGUI

1205/07/2017 BarcelonaMySQLMeetup

Page 14: MySQL Failover and Orchestrator

OrchestratorGUI

1305/07/2017 BarcelonaMySQLMeetup

Page 15: MySQL Failover and Orchestrator

OrchestratorCLI

Over100commandsyoucanuse• E.g.

• relocate• discover• begin-downtime,end-downtime• topology

1405/07/2017 BarcelonaMySQLMeetup

Page 16: MySQL Failover and Orchestrator

OrchestratorCLI

05/07/2017 BarcelonaMySQLMeetup 15

Page 17: MySQL Failover and Orchestrator

FailureNotifications

• Usingthehookscantalktojabberoremailtoadviseoftheactionstaken:

05/07/2017 BarcelonaMySQLMeetup 16

Page 18: MySQL Failover and Orchestrator

FailureAuditing

05/07/2017 BarcelonaMySQLMeetup 17

Page 19: MySQL Failover and Orchestrator

OrchestratorSetup

• Sourceatgithub.com/github/orchestrator• Binarieswritteningo• Daemonrunswebserviceanddiscovery,clientoneachMySQLserver• StatestoredinMySQL/SQLite• Singlejson configurationfile:/etc/orchestrator.conf.json

• Howtoreachbackenddatabase(storesstate)• Howtorecognise delay• Mostdefaultsaregoodtogetyougoing• Whichsystemsyouwanttotriggerrecoveryon• Hookstohandlerecovery(talkingtoexternalsystems)• Ifyouneedhelppleaseask

1805/07/2017 BarcelonaMySQLMeetup

Page 20: MySQL Failover and Orchestrator

OrchestratorCharacteristics

• Discover oneserverinyourclusterandorchestratorwillfindtheothers• Detectsnewserversintheclusterautomatically• Notifiesyouofproblemsseen• Recoveryisoptional(percluster)• Optionalselectionofcandidatemastersorserverstoblacklist• GlobalON /OFF switch– handyifseveralfailureshappenatonce• ForparanoidDBAs,sofarorchestratorhasalwaysdonetherightthing

1905/07/2017 BarcelonaMySQLMeetup

Page 21: MySQL Failover and Orchestrator

OrchestratorHA?

OrchestratorcanberuninHAmode• Multipledaemonswillco-operatesoifonefailsanotheronetakesover(theysharethedatabasebackend)• UsealoadbalancertoprovideanHAGUIservice• Usenginx (orsimilar)forauthenticationandTLSifneeded• Upgradesareeasier• ReplicatetheorchestratorMySQLbackendtonotlosedata

2005/07/2017 BarcelonaMySQLMeetup

Page 22: MySQL Failover and Orchestrator

DoesitScale?

Yes• Booking.com hasalargeinstallationwithasingleclustermonitoringthousandsofMySQLservers• RecommendedbyYouTubeformanagingVitess servers• Quiteanumberofotherusersbuttheyarenotveryvisible

2105/07/2017 BarcelonaMySQLMeetup

Page 23: MySQL Failover and Orchestrator

Futurework

• Simplifyconfigurationandsetupsomorepeoplecanuseit• Improvescalability• MakeitworkonAmazonRDS• Spreadtheword…

05/07/2017 BarcelonaMySQLMeetup 22

Page 24: MySQL Failover and Orchestrator

Furtherhelpneeded?

• github.com/github/orchestrator• forIssues(Problems/Questions)andPullRequests(patches)

• GoogleGroup:OrchestratorMySQL• https://groups.google.com/forum/#!forum/orchestrator-mysql

• FeelfreetocontactmeandIwilltrytohelpprovidepointers

2305/07/2017 BarcelonaMySQLMeetup

Page 25: MySQL Failover and Orchestrator

Oh,andBooking.com ishiring!

• Almostanyrole:• MySQLEngineer/DBA• SystemAdministrator• SystemEngineer• SiteReliabilityEngineer• Developer• Designer• TechnicalTeamLead• ProductOwner• DataScientist• Andmanymore…

• https://workingatbooking.com/

05/07/2017 BarcelonaMySQLMeetup 24

Page 26: MySQL Failover and Orchestrator

Questions

?

05/07/2017 BarcelonaMySQLMeetup 25


Recommended