mesos and the state of application deploys
TRANSCRIPT
![Page 1: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/1.jpg)
MESOSANDTHESTATEOFAPPLICATION
DEPLOYS
![Page 2: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/2.jpg)
WHOAMI?KoryBrown.DevOpsEngineerFromTexas.SiteOperationsEngineeratFitbit.
![Page 3: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/3.jpg)
WHATISTHISTALKABOUT?
![Page 4: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/4.jpg)
MESOS!
![Page 5: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/5.jpg)
APPLICATIONDEPLOYMENTS!
![Page 6: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/6.jpg)
MORESPECIFICALLYHowwe,asanindustry,usedtohandleapplicationdeployments.Howwe,asanindustry,currentlyhandleapplicationdeployments.HowIthinkwe'llhandleapplicationdeploymentsinthefuture.
![Page 7: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/7.jpg)
WAIT,WHATABOUTMESOS?We'llgetthere.
![Page 8: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/8.jpg)
ButtounderstandtheproblemsMesossolvesfordeployswemustfirst:
Understandwhatwedotoday.Understandhowwegothere.
Mesos,inthiscase,isanimplementationdetail.
![Page 9: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/9.jpg)
WHYSHOULDYOUCARE?It'ssuperfreakingcoolAndyouknow...DevOps
![Page 10: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/10.jpg)
WHATISDEVOPS?ThisisnotatalkonDevOps......butit'simportantforustohaveacommondefinition.
![Page 11: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/11.jpg)
"DevOpsisaboutrecognizingthatthebackinginfrastructureisnotseparatefromyourapplication,butratheravitalpartof
it."--Me
![Page 12: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/12.jpg)
HOWTHINGSUSEDTOBE
![Page 13: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/13.jpg)
YOUWANTTODEPLOY1. GetaServer.
![Page 14: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/14.jpg)
GETASERVERPutinarequest.Ahumanallocatesaserver.Ahumaninstallsanoperatingsystem.Ahumanensuresthenetworkingiscorrect.Ahumaninstallsallspecifieddependencies.etc,etc,etc
![Page 15: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/15.jpg)
YOUWANTTODEPLOY1. GetaServer.2. Deployyourapplication.
![Page 16: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/16.jpg)
DEPLOYYOURAPPLICATIONAnOpsguylogsintotheserver.
Downloadsyourapplication.Installsyourapplication.Configuresyourapplication.
![Page 17: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/17.jpg)
DEPLOYYOURAPPLICATIONTheapplicationdoesn'tstart.
Theycallyou(probablyinthemiddleofthenight).Afteranhouroftroubleshooting,yourealizetheytypoedtheconfig.Youhateeverything.
![Page 18: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/18.jpg)
YOUWANTTODEPLOY1. GetaServer.2. Deployyourapplication.3. Repeatntimesforscale.
Eachtimeslightlydifferently
![Page 19: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/19.jpg)
SOMETHINGGOESWRONG(Hardwarefailure/OSissues/Maintenance/etc)
GodHelpYou.
![Page 20: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/20.jpg)
SOMETHINGGOESWRONG(Hardwarefailure/OSissues/Maintenence/etc)
Fileaticket.Datacentertechfindsthemachine.Theypulltheharddrive.
Whichisweird,becauseIsaidtheRAMtestedbad.Twoweekslaterthemachineislostinaseaoftickets.Everythingisterrible.
![Page 21: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/21.jpg)
THISSUCKEDNotuncommontomeasureturnaroundinweeks.Littletonoautomation.Incrediblyerrorprone.Requiresapersonatmosteverystep.Generallyleadstofinelycraftedartisanalmachines.
TL;DR:
Horrificallyinefficient,errorprone,andtimeconsuming.
![Page 22: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/22.jpg)
HOWTHINGSARETODAY
![Page 23: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/23.jpg)
YOUWANTTODEPLOY1. Spinupanewcloudinstance.2. Runyourautomationtoolofchoice
(Puppet/Ansible/Chef/etc).3. Repeatntimes.
![Page 24: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/24.jpg)
SOMETHINGGOESWRONG(Hardwarefailure/OSissues/Maintenance/etc)
Spinupanewinstance!
Turnaroundtimesaresolow,whocares?
Birthofthe"TreatserverslikeCattle,notpets"thoughtprocess.
![Page 25: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/25.jpg)
SUCKSWAYLESSTurnaroundmeasuredinminutes.Almostentirelyautomated.Fairlydeterministic.Doesn'thavetoinvolvepeopleatall!
![Page 26: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/26.jpg)
BUTNOTPERFECTStillmanageanentireOSforeachapplication.Thisincludes:
Updates!(BothOSandanyapplications/libraries)Backups!Monitoring/Metrics!etc,etc,etc
![Page 27: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/27.jpg)
BUTNOTPERFECTNotfullyutilizingtheavailablehardware.
Unlessyourapplicationrunsconstantlyat100%CPUandRAM,youarewastingcyclesandmoney!
![Page 28: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/28.jpg)
BUTNOTPERFECTTL;DR:
Good,butnotgreatpastacertainscale.
![Page 29: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/29.jpg)
ENTERMESOS
![Page 30: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/30.jpg)
WHATISMESOS?Opensourcedistributedclustermanagementtool.
![Page 31: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/31.jpg)
WHATISMESOS?Anabstractionlayerforcomputingresources(CPU/RAM/Disk/etc)containedwithinapoolofservers.
![Page 32: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/32.jpg)
MESOSISADISTRIBUTEDKERNEL
AtraditionalKernel(likeLinux!)providesasetofAPIsforinteractingwithavailablehardwareonalocalmachine.
AdistributedKernel(likeMesos!)providesasetofAPIsforinteractingwithavailablehardwareonapoolofservers.
![Page 33: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/33.jpg)
THEDATACENTEROSTheKernelitselfisasmallpartofanOperatingSystem.Manyothercomponentsthatmakeitsomethinguseful.Mostrelevantforusrightnow:
Initsystem--Someprocesstomanagethelifecycleofotherprocesses.Cron--Someprocesstoruntasksonsomespecifiedinterval
Mesosimplementsthisfunctionalitywith"Frameworks".
![Page 34: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/34.jpg)
WHAT'SAFRAMEWORK?AMesos"Application".Mustcontain2components:
Ascheduler,whichregisterswiththeMaster,andreceivesresourceoffers.OneormoreExecutors,whichlaunchestasksonslaves.
![Page 35: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/35.jpg)
MESOSFRAMEWORKSInitSystem:
MarathonAurora
Cron:
ChronosAurora
![Page 36: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/36.jpg)
AQUICKASIDEONFRAMEWORKSTheFrameworkslistedarejustonesthatarerelevantinthe
contextofapplicationdeploys.
![Page 37: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/37.jpg)
AQUICKASIDEONFRAMEWORKSMesosismeanttobeusedasagenericcomputingclustermanager,whichmeansyoucanalsouse,asaframework:
JenkinsHadoopSparkStormKafkaManymorethingsprobably!
Perhapsmoreimportantly,alloftheseframeworkscansharethesameclusterofmachines!
![Page 38: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/38.jpg)
MESOSOFFERSAlistofanagentnode'savailableresources(CPU/RAM/Disk/etc).Two-TierSchedulingSystem.
AgentNodesendsresourcestoMasternode.Masternodeusesanalgorithmcalled"DominantResourceFairness"tofairlypassthatresourceoffertoit'sregisteredFrameworks.
![Page 39: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/39.jpg)
OTHERMESOSRELATEDWORDS
MasterService:RunsonamachinethathasbeendesignatedasaMesosMaster.Managesagents.
Agent:Runstasksthatbelongtoframeworks.
PreviouslyreferredtoasaSlave,butthisisbeingchangedinnewerversions.
Task:AunitofworkscheduledbytheFramework,andexecutedontheAgent.
ZooKeeper:Distributedconsensusframework.
Masterusesforleaderelection.Frameworksusetosharestate.
![Page 40: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/40.jpg)
MESOSARCHITECTURE
![Page 41: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/41.jpg)
Quorumofmasters,keptinsyncbyZooKeeper.
![Page 42: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/42.jpg)
Slavessendresourceofferstotheelectedmaster.
![Page 43: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/43.jpg)
Mastersofferthoseresourcestoit'sregisteredframeworks.
![Page 44: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/44.jpg)
Iftheofferisaccepted,frameworksexecutetasksonslaves.
![Page 45: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/45.jpg)
![Page 46: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/46.jpg)
SHOULDMYAPPRUNONMESOS?
![Page 47: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/47.jpg)
STATELESSAPPLICATIONWebApp(Rails,Django,Play,etc)JenkinsBuildSlavesMemcachedAny12factor-ishapplication
Yes
![Page 48: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/48.jpg)
STATEFULAPPLICATIONSMySQLPostgresSQLJenkinsMaster
No
![Page 49: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/49.jpg)
DOESITADDRESSCURRENTPROBLEMS?ManagingfewerOperatingSystems.Betterutilization.
![Page 50: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/50.jpg)
MANAGINGFEWEROPERATINGSYSTEMS
ManageanOSforeachphysicalhost,NOTeachapplication.
![Page 51: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/51.jpg)
BETTERUTILIZATIONInsteadofoneapplicationrunningperhost...
...webinpackthemalltogether!
Anyresourcesyourapplicationisn'tusingcanbesharedasneeded!
![Page 52: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/52.jpg)
BONUS:REDUNDANCYBAKEDIN!Sincewehavethisbigpoolofsharedresources,ifan
instanceorhostdies,wejustrescheduleitsomewhereelse.
![Page 53: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/53.jpg)
STATICALLYPROVISIONEDCLUSTER
![Page 54: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/54.jpg)
STATICALLYPROVISIONEDCLUSTER
Railsappnowat1/3rdcapacity!
![Page 55: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/55.jpg)
DYNAMICALLYPROVISIONEDCLUSTER
![Page 56: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/56.jpg)
DYNAMICALLYPROVISIONEDCLUSTER
Twonodesdown!
Whocares?
![Page 57: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/57.jpg)
DEPLOYINGWITHMESOS
![Page 58: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/58.jpg)
YOUWANTTODEPLOY1. WriteaJobConfigforyourFrameworkofChoice.
WeuseAurora--it'sprettysweet.2. TellAuroratorunit.
![Page 59: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/59.jpg)
SOMETHINGGOESWRONG(Hardwarefailure/OSissues/Maintenance/etc)
Aurorareschedulesyourapplicationtoanothernode.
![Page 60: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/60.jpg)
HARDLYSUCKSATALL!Turnaroundmeasuredinseconds!Entirelyautomated!Deterministic!FaultTolerant!
![Page 61: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/61.jpg)
DEVELOPERPERSPECTIVE
![Page 62: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/62.jpg)
TESTINGMesoscanbeyourdev,qa,staging,andproductionenvironments.
Aurorasplitspermissionsandallocationsbetweenconfiguredenvironments.Prioritizesproduction.Meaningitwillpreemptjobsrunningin"lesser"environments.
BecomeseasytotestinaProdlikeenvironmentbecauseitISthesameenvironment!
![Page 63: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/63.jpg)
SELF-MANAGEMENTNomorewaitingonOpsforhardware!Easilyautomate-able!
WantHerokustyleddeploys?ThisishowHerokudoesit.
![Page 64: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/64.jpg)
TL;DRWe'vecomealonglongway.Thing'ssuckwaylessnow.Suckinglessandlesseveryday.
![Page 65: Mesos and the State of Application Deploys](https://reader034.vdocuments.net/reader034/viewer/2022042906/58aba7211a28abdf3c8b5817/html5/thumbnails/65.jpg)
QUESTIONS?