亚马逊AWS 云计算环境中的Microservices 架构

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

MicroserviceArchitectureonAmazonWebServices费良宏TechnicalEvangelist为什么需要Microservices?软件项目发展到复杂阶段的必然小,且专注于做一件事情运行在独立的进程中轻量级的通信机制松耦合Micrososervices的特征一体化(Monolithic)应用vsMicroservices分布式系统在本质上是复杂的服务的操作开销(100年代;DevOps模型绝对必需)服务接口版本不匹配?测试(需要整个生态系统测试)扇型增加的请求-增加n/w流量隔离带来更好的可用性独立的交付速度(由不同的团队)去中心化的管理(DevOps)康威定律(Conway'sLaw)Organizationswhichdesignsystems...areconstrainedtoproducedesignswhicharecopiesofthecommunicationstructuresoftheseorganizations.任何设计系统的组织……必然会产生以下设计结果,即其结构就是该组织沟通结构的写照。—M.ConwaySILOs的组织形式SILOs的组织形式DevOpsisaRe-Org!如何设计smaller的服务?业务领域+松散耦合+有边界上下文Microservices独立部署Microservices选择争取的工具Microservices应用新的技术Microservices自动化的文化如何让小做到小?Howsmallissmall?“能在两周内重写的东西”两张比萨的团队架构DevOpsMicroservices的实践-NetflixIPCStack1.0ApacheHTTPClientEureka(ServiceRegistry)Server(Karyon)ApacheTomcatClientHystrixEVCacheRibbonLoadBalancingEurekaIntegrationMetrics(Servo)Bootstrapping(Governator)Metrics(Servo)AdminConsoleHTTPEurekaIntegrationRegistrationFetchRegistryMicroservices的实践-NetflixIPCStack1.0Client(Ribbon2.0)Eureka(ServiceRegistry)Server(Karyon)RibbonTransportLoadBalancingEurekaIntegrationMetrics(Servo)Bootstrapping(Governator)Metrics(Servo)AdminConsoleHTTPEurekaIntegrationRegistrationFetchRegistryRibbonHystrixEVCacheRxNettyRxNettyUDPTCPWebSocketsSSE容器&事件驱动的计算架构虚拟机容器在AWS上的DockerAmazonLinuxAsupportedandmaintainedLinuximageprovidedbyAmazonWebServicesAmazonEC2ContainerServiceHighlyscalable,highperformancecontainermanagementserviceAWSElasticBeanstalkFordeployingandscalingwebapplicationsandservicesAmazonEC2ContainerService关键组件机群容器实例任务任务定义任务调度RegionalResourcepoolGroupingofContainerInstancesStartempty,dynamicallyscalableAmazonEC2instancesDockerdaemonAmazonECSagentAmazonEC2ContainerService关键组件机群容器实例任务任务定义任务调度关键组件机群容器实例任务任务定义任务调度[{image:mysql,name:db,cpu:10,memory:500,…AmazonEC2ContainerService关键组件机群容器实例任务任务定义任务调度任务定义[{image:tutum/wordpress-stackable,name:wordpress,cpu:10,memory:500,essential:true,links:[db],entryPoint:[/bin/sh,-c],environment:[…],portMappings:[{containerPort:80,hostPort:80}]},{image:mysql,name:db,cpu:10,memory:500,essential:true,entryPoint:[/entrypoint.sh],environment:[{name:MYSQL_ROOT_PASSWORD,value:pass}],portMappings:[]}][{image:tutum/wordpress-stackable,name:wordpress,cpu:10,memory:500,essential:true,links:[db],entryPoint:[/bin/sh,-c],environment:[…],portMappings:[{containerPort:80,hostPort:80}]},]{image:mysql,name:db,cpu:10,memory:500,essential:true,entryPoint:[/entrypoint.sh],environment:[{name:MYSQL_ROOT_PASSWORD,value:pass}],portMappings:[]}]FromDockerHub10CPUUnits(1024isfullCPU),500MegabytesofMemory环境变量没有暴露外部端口任务定义[{image:tutum/wordpress-stackable,name:wordpress,cpu:10,memory:500,essential:true,links:[db],entryPoint:[/bin/sh,-c],environment:[…],portMappings:[{containerPort:80,hostPort:80}]},[{image:mysql,name:db,cpu:10,memory:500,essential:true,entryPoint:[/entrypoint.sh],environment:[{name:MYSQL_ROOT_PASSWORD,value:pass}],portMappings:[]}]EssentialtoourTaskDockerlinktomysqlcontainerExposeport80incontainertoport80onhost任务定义Long-runningservicesRunTaskforbatchjobsIntegratewith3rdpartyschedulersAmazonEC2ContainerService关键组件机群容器实例任务任务定义任务调度ECS的实践-CourseraCoursera做了什么MassiveOpenOnlineCourses14millionlearners120partners1000courses2.2millioncoursecompletionsECS的实践-Coursera的技术架构Coursera需要什么?Reliability●Saturn/Cascadewereflaky●DevelopersbecamefrustratedwithjobsnotrunningproperlyCoursera需要什么?EasyDevelopment●Developing&testinglocallywasdifficult●LittleornoboilerplateshouldberequiredEasyDeployment●Deploymentwasdifficultandnon-deterministic●“Otherserviceshaveone-clicktools,whycan’tyourservicehavethattoo?”flickr.com/derelllicht,ccby-nd2.0Coursera需要什么?HighEfficiency●Cost-conscious●Mostjobscomplete20minutesoEC2roundscostsuptofullhour●StartuptimeofindividualinstancestoolongforbatchprocessingCoursera需要什么?LowOpsLoad●Onlyonedev-opsengineer--can’tmanageeverything●Developersowntheirservices●Developersshouldn’thavetoactivelymonitorservicesflickr.com/reynermedia,ccby2.0Coursera需要什么?Coursera可以选择的技术方向Home-grownTech●Tried,butprovedtobeunreliable●Difficulttohandlecoordinationandsynchronization●Verypowerful,buthardtoproductionize●NeedsactualDevOpsteam●GCEfirst-class,everythingelsesecond-class●Low-to-nomaintenancesolution●IntegratedwithAWSinfrastructure●EasytounderstandandprogramforCoursera的选择-AWSECSServicesServicesIguazúAdminIguazúfrontendIguazúbackendAmazonSQSCassandraWorkerMachinesWorkerWorkerschedulerdeveloperslearnersECSAPIsCourseraIguazú架构●Frontend+ScheduleroGeneratesrequests(eitherviaAPIcallsorinternallyfromthescheduler)oPutsnewrequestsinSQSqueuesoHandlesrequestsforstatusfromotherservices●BackendoAttemptstoruntasksviaECSAPIFailure(e.g.lackofresources)meanstaskgoesbackintoqueuetotryagainlateroKeepstrackoftaskstatusandupdatesCassandraCourseraIguazú设计AWSLambda零管理事件驱动计算平台AWSLambda专注业务逻辑,而不是基础架构用户上传代码

1 / 60
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功