从服务框架到服务网格,网易轻舟双引擎多模式服务治理演进实践

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在分布式体系下,微服务技术在经历多年发展之后渐趋成熟。进入云原生时代,微服务技术在云原生理念的驱动下被赋予了新的使命。在 InfoQ 2020 年微服务技术年终盘点文章中,我们对传统的服务框架和云原生的服务网格分别进行了分析,指出了服务框架的进化与困局,服务网格的进步、分化、落地,并给出了企业微服务架构的演进方向。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"本文将延续微服务架构演进这个话题,结合网易数帆旗下轻舟微服务团队在诸多企业业务落地的微服务治理实践,阐述企业应用在不同阶段采用不同的微服务治理策略,以及从服务框架到服务网格实现架构平滑演进的思路与方法。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"服务框架:无侵入 Agent 服务治理"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"服务框架是传统微服务技术的核心所在。早期微服务技术中的服务注册、发现、调用、治理、观测都离不开服务框架。这也带来了一些问题,比如业务研发者需要明显感知服务框架并掌握其中各项非业务相关技术,框架版本升级困难,框架越来越重难于维护等等。网易的互联网业务比较多元,早期各业务没有统一的微服务技术规范和框架,大部分业务选型了 SpringCloud、Dubbo、gRPC 等开源框架,也有少数业务选择自研 RPC 框架。服务框架在微服务架构下的问题随着业务、团队规模的扩大日益凸显,这也催生了 "},{"type":"text","marks":[{"type":"strong"}],"text":"网易新一代微服务平台 —— 轻舟"},{"type":"text","text":" 的建设落地。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"2018 年,我们以 "},{"type":"text","marks":[{"type":"strong"}],"text":"业务无侵入"},{"type":"text","text":" 为核心理念构建了轻舟微服务平台,核心数据面 "},{"type":"text","marks":[{"type":"strong"}],"text":"基于字节码增强技术实现无侵入 Agent 服务治理能力"},{"type":"text","text":","},{"type":"text","marks":[{"type":"strong"}],"text":"业务无需修改代码"},{"type":"text","text":" 即可 "},{"type":"text","marks":[{"type":"strong"}],"text":"一键接入微服务治理全家桶"},{"type":"text","text":" 能力,大幅提高了用户业务微服务化改造效率,降低了业务进行服务治理相关能力的研发成本。轻舟微服务平台目前已在网易集团内外诸多企业业务落地。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/aa\/aa1a104a14629015b980723bd1752a01.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"相较于传统服务框架,无侵入 Agent 服务治理有如下 "},{"type":"text","marks":[{"type":"strong"}],"text":"核心优势"},{"type":"text","text":":"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"代码无侵入、业务无感知引入。"},{"type":"text","text":" 业务无需对程序代码任何修改,只需在应用启动项添加 Agent 参数即可。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"一键接入微服务治理全家桶(Spring Cloud\/Sentinel\/Apollo\/Skywalking)。"},{"type":"text","text":" 业务无需感知框架、版本等实现细节,快捷获得微服务治理 All-In-One 能力。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"接管主流注册中心(Eureka\/Nacos\/Consul\/Zookeeper\/Kubernetes)。"},{"type":"text","text":" 业务无需更换注册中心,服务注册与发现全托管。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"兼容全系 Java 应用。"},{"type":"text","text":" 基础框架无限制,支持任意 Java 应用快捷接入。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"模块化设计,可按需热插拔、升级。"},{"type":"text","text":" 业务可按需加载、卸载功能模块,组件灵活演进、升级。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/d9\/d915a6dd120b93cd307e6b70a15d4cf4.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"无侵入 Agent 服务治理方式一定程度上对传统服务框架的组织与接入方式进行了重新定义,为单体应用、初步微服务化的应用提供了便捷的微服务治理套件落地方案。最近我们注意到一些大型互联网企业也开始使用无侵入 Agent 方式进行微服务治理落地,让我们更加坚定了这种设计的有效性与长期性。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"总结:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"无侵入 Agent 服务治理技术可以帮助企业业务高效完成微服务化改造,也为后续微服务架构的持续演进提供了技术基础。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"服务网格:低门槛高性能推动企业级落地"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"服务网格(Service Mesh)"},{"type":"text","text":" 是将无侵入服务治理定义的更为彻底的微服务架构方案。通过将微服务治理能力以独立组件(Sidecar)整合并下沉到基础设施,服务网格可以实现应用业务逻辑与服务治理逻辑完全分离,这也使支持多语言、热升级等高阶特性变得顺理成章。网易服务网格建设 是随着严选、新闻等互联网业务容器化上云开始的。轻舟微服务平台与业务部门采用合作共建的方式,制定以 "},{"type":"text","marks":[{"type":"strong"}],"text":"业务无感知、平滑稳定"},{"type":"text","text":" 为服务网格落地的最高宗旨。我们选择由 Google、IBM 背书的 "},{"type":"text","marks":[{"type":"strong"}],"text":"Istio"},{"type":"text","text":" 作为服务网格基座进行扩展、增强,为实现业务无感知、平滑稳定接入进行了深入设计与反复论证,已经帮助多个企业核心业务大规模生产环境落地服务网格。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/28\/286a4aaf91565fd7aa1717a24f8cda3e.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"服务网格建设思路方面,我们主要从“"},{"type":"text","marks":[{"type":"strong"}],"text":"低门槛"},{"type":"text","text":"”与“"},{"type":"text","marks":[{"type":"strong"}],"text":"高性能"},{"type":"text","text":"”两个维度进行设计。"}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"低门槛:业务平滑落地的支撑能力"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"真正意义上支撑不同业务的平滑接入是我们在服务网格平台建设初期的主要挑战,具体体现在:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不同业务有着不同的微服务架构现状:不同的框架、协议、注册中心"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"不同业务有着相同的要求:不希望业务有任何修改或感知"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"原生 Istio 易用性偏弱"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"为此,我们在支撑业务平滑落地方面做了大量工作,主要可以归纳为以下几个方面:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"业务平滑接入"},{"type":"text","text":":业务 "},{"type":"text","marks":[{"type":"strong"}],"text":"无需修改代码、框架或注册中心"},{"type":"text","text":",由基础层与平台层适配业务架构、框架"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"多协议支持"},{"type":"text","text":":HTTP 、gRPC 、Dubbo、Thrift 等协议的完整流量管理与精细化治理能力,并沉淀了更多协议扩展能力"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"流量动态拦截"},{"type":"text","text":":按需对流量协议、端口动态拦截配置,降低企业 mesh 化门槛"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"核心组件热升级"},{"type":"text","text":":Sidecar 升级无需业务重启,助力服务框架升级效率提升 4 倍以上"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"治理能力增强"},{"type":"text","text":":面向业务场景的熔断降级(动态、缓存降级),限流(全局、单机、自适应),接口级鉴权"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"流量染色 & 穿梭"},{"type":"text","text":":零配置实现请求流量染色、穿梭,快速实现多套测试环境部署与回收"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"复杂场景统一管控"},{"type":"text","text":":支持容器 & 非容器、多集群、多种组件部署模式(Sidecar、SDK)、 多协议等复杂场景统一管控,支持业务迁移过程平滑、可观测"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"Envoy API 网关"},{"type":"text","text":" :基于 Envoy 与 Istio Gateway CRD 扩展实现具备全生态治理能力与高性能的 API 网关,平滑接管业务原有南北向流量,实现了 "},{"type":"text","marks":[{"type":"strong"}],"text":"微服务 API 网关全面向云原生化升级"},{"type":"text","text":",达成了 "},{"type":"text","marks":[{"type":"strong"}],"text":"微服务集群南北向与东西向核心基础设施统一与共同演进"}]}]}]},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"高性能:大规模微服务集群的支撑能力"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"业务平滑迁移是服务网格落地的基本条件,而支撑大规模微服务集群则是生产环境下对服务网格平台的\"必考项\"。早期 Istio 的设计更多着眼于模型的通用型、灵活性,对大规模生产及微服务集群的支撑能力比较弱,主要体现在:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"请求多两跳带来的延时退化"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"全量配置分发带来的流量\"洪峰\""}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"控制平面无自我保护能力"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"无兜底降级能能力"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"为此我们在支持大规模微服务集群支撑能力方面做了大量工作,主要归纳为以下几个方面:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"数据面性能、稳定性提升"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"基于 "},{"type":"text","marks":[{"type":"strong"}],"text":"用户态协议栈"},{"type":"text","text":" 以及 "},{"type":"text","marks":[{"type":"strong"}],"text":"SRIOV 容器网络"},{"type":"text","text":" 的性能优化,"},{"type":"text","marks":[{"type":"strong"}],"text":"时延性能较原生提升 2 倍以上"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"配置懒加载,实现配置的增量、按需分发"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"连接退避,避免对控制面带来集中\"打击\""}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"延时与启动速度优化"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"控制面支撑大规模集群"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"应对大规模集群变更"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"限流 & 熔断"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"主动断连"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"自我观测与监控报警"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"多级容灾"},{"type":"text","text":":多级兜底降级,保障线上不掉流量"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"总结:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"适应不同的业务架构、框架,提供相同的低门槛、高性能平台能力,是服务网格企业级落地的必备条件"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"双引擎多模式:从服务框架到服务网格的最后一公里"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我们在顺利完成基于无侵入 Agent 服务治理、低门槛高性能服务网格平台在企业业务落地后,业务对我们提出了更高的要求:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"无侵入 Agent 技术已经帮助业务快速落地微服务架构与治理,接下来如何平滑演进到服务网格?"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"服务网格架构虽然完美,但似乎部分应用进程内治理能力无法覆盖,如何解决?"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我们自身在建设无侵入 Agent 服务治理、低门槛高性能服务网格过程中,也沉淀了一些可以支撑业务架构演进的技术方案:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"无侵入 Agent 应用进程内服务治理能力,可以成为服务网格架构下缺失能力的补充"},{"type":"text","text":"。在彻底的服务网格架构下,无法实现进程内服务治理,如方法级的熔断、限流、容错、应用内监控等,可以通过 Agent 的 All-In-One 套件快速补齐。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"无侵入 Agent 的字节码增强机制,可以为业务演进到服务网格提供工具支持"},{"type":"text","text":"。存量业务为引入一些特性而不得不修改代码时,如传递调用链上下文、寻址拦截、调用兜底等等,可以通过 Agent 在应用中”织入“逻辑进行增强。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"无侵入 Agent 具备的模块化、可插拔设计,可以实现服务框架自身到服务网格的“蜕变”"},{"type":"text","text":"。业务在微服务化改造时接入 Agent 的主要治理特性,在演进到服务网格的过程中可以对一些与服务网格能力重叠的功能逐步”卸载“,逐步完成框架与架构的演进。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"带着业务的需求,以及已经独立闭环的无侵入 Agent、服务网格技术能力,轻舟微服务平台在 2020 年开启了新一轮 "},{"type":"text","marks":[{"type":"strong"}],"text":"从服务框架到服务网格\"最后一公里\"能力"},{"type":"text","text":" 的探索,即\""},{"type":"text","marks":[{"type":"strong"}],"text":"双引擎多模式"},{"type":"text","text":"\"服务治理能力。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/e3\/e3fed7f0c4f08be34e874e5a603070e9.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"定义"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"双引擎"},{"type":"text","text":" —— 狭义是指 Agent、Sidecar 两种服务治理引擎(组件);广义是以 Agent、Sidecar 为核心的整体微服务平台能力。围绕 "},{"type":"text","marks":[{"type":"strong"}],"text":"双引擎"},{"type":"text","text":" 分别 "},{"type":"text","marks":[{"type":"strong"}],"text":"垂直构建的微服务治理能力"},{"type":"text","text":",旨在使平台基于 "},{"type":"text","marks":[{"type":"strong"}],"text":"每种引擎都具备独立支撑业务服务治理场景能力"},{"type":"text","text":"。长期演进上来讲,后续可能有更多引擎引入(比如多运行时 Dapr,传统 SDK 等),这在垂直构建引擎能力设计上长期支持。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"多模式"},{"type":"text","text":" —— 狭义是指服务 + 不同引擎的多种治理模式,包括基于 Agent 的服务治理模式、基于 Sidecar 的服务治理模式、整合 Agent+Sidecar 的服务治理模式等;广义上可结合业务情况将服务以不同模式接入平台,服务可以包含多种接入模式的实例,"},{"type":"text","marks":[{"type":"strong"}],"text":"支持不同接入模式的服务实例互相发现、统一治理与平滑演进"},{"type":"text","text":"。围绕“多模式”"},{"type":"text","marks":[{"type":"strong"}],"text":"水平构建"},{"type":"text","text":" 以 "},{"type":"text","marks":[{"type":"strong"}],"text":"业务应用服务为核心"},{"type":"text","text":"、以 "},{"type":"text","marks":[{"type":"strong"}],"text":"引擎驱动业务架构平滑演进"},{"type":"text","text":" 的平台能力与解决方案。长期演进上来讲,可以支撑更多治理模式下应用服务的统一纳管、治理、演进,如 Agent 模式、Sidecar 模式、Agent+Sidecar 模式、多运行时模式、SDK 模式等等。"}]}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/59\/59e56b78c165c59c30d879529c179dc7.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"核心能力"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"为了完整支撑微服务的治理纳管与演进迁移,我们对双引擎多模式的核心能力进行梳理与分级(从基础 L0 到高阶 L3),用以指导平台建设能力完整性与落地优先级。整体如下:"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"平台支持 Agent、Sidecar 分别独立闭环的服务治理能力 L0"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"微服务平台的基础能力,平台具备每种引擎(Agent、Sidecar)相关的整体能力。业务可以选择一种长期使用。对平台来说,即具备:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"无侵入 Agent 服务治理体系与平台"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"服务网格治理体系与平台"}]}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"多种治理模式下服务管理统一视图 L0"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"采用不同治理模式的服务可以在平台上统一展现,包括服务、实例列表,调用拓扑,全平台服务概览等功能。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"平台具备业务的服务、实例在 "},{"type":"text","marks":[{"type":"strong"}],"text":"演进迁移过程可视化能力"},{"type":"text","text":",如观测迁移过程中的调用情况(包含跨集群、环境信息)、服务列表、实例列表、监控数据等。"}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"多种治理模式下服务互相发现、调用 L1"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"采用不同治理模式的服务可以实现互相调用和发现,具备演进 "},{"type":"text","marks":[{"type":"strong"}],"text":"迁移过程服务的可达性"},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"具体来说,具备几方面能力:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"服务在 Agent、Sidecar、Agent+Sidecar 多种模式下互相发现、调用"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"多注册中心打通,实现服务在注册中心随架构迁移时可发现"}]}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"多种治理模式服务平滑迁移 L2"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"迁移过程的平滑,具体来说主要包括:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"治理模式切换"},{"type":"text","text":"。Agent、Sidecar 支持平滑迁入、迁出。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"注册中心切换"},{"type":"text","text":"。多注册中心打通,支持迁移过程平滑切换注册中心。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"跨环境、集群、网络的服务发现"},{"type":"text","text":"。支持业务跨环境、集群、网络迁移过程的调用可达。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"存量治理策略迁移"},{"type":"text","text":"。业务已有治理策略的迁移。"}]}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"多种治理模式的服务治理统一、互补 L2"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"服务处在 Agent、Sidecar、Agent+Sidecar 等不同治理模式下,治理能力需要形成统一、互补。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"统一"},{"type":"text","text":" 是指相同治理功能在不同治理模式下行为一致,各项治理能力不因模式不同对业务产生差异,进而保障迁移过程的 "},{"type":"text","marks":[{"type":"strong"}],"text":"平滑性"},{"type":"text","text":"。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"互补"},{"type":"text","text":" 是指 Agent、Sidecar 分别具备的治理能力,在 "},{"type":"text","marks":[{"type":"strong"}],"text":"代码、方法级"},{"type":"text","text":" 与 "},{"type":"text","marks":[{"type":"strong"}],"text":"服务、进程级"},{"type":"text","text":" 形成互补,加强服务治理的 "},{"type":"text","marks":[{"type":"strong"}],"text":"完整性"},{"type":"text","text":"。"}]}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"多种治理模式的服务治理用户无感知技术选型 L3"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"应用微服务托管 \/ 治理平台在治理方面的高阶设计目标,是用户无需感知底层使用 SDK、Agent、Sidecar,仅在平台层按功能需求配置、管控。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"目前,经过一年多努力,轻舟微服务平台已经主体实现上述 L0-L2 的能力,并在 L3 持续探索,提升平台易用性。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/6b\/6be61877fd1c7945a50850b2469716ec.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"场景覆盖"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/c0\/c0b8cb1130bd59272e7c37a35dceab5a.png","alt":null,"title":null,"style":null,"href":null,"fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"在打通已有 Agent 和服务网格能力、形成多模式治理后,"},{"type":"text","marks":[{"type":"strong"}],"text":"微服务平台可以覆盖比较完整的业务场景"},{"type":"text","text":":无论 "},{"type":"text","marks":[{"type":"strong"}],"text":"业务现有技术栈是基础框架,或是增强过的 SDK"},{"type":"text","text":",都可以选择自己的演进路线,通过 Agent、Sidecar 完成 "},{"type":"text","marks":[{"type":"strong"}],"text":"长期的微服务架构平滑演进、升级"},{"type":"text","text":"。"}]},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/47\/e2\/475a855cf69d4c394cbf447afd8b3ae2.jpg","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"总结:双引擎多模式服务治理能力可以充分利用已有的微服务平台能力,比较好地填补从服务框架到服务网格平滑演进过程的技术空白,提供更整体、更平台化的微服务架构演进支撑能力。"}]},{"type":"heading","attrs":{"align":null,"level":2},"content":[{"type":"text","text":"未来展望"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"轻舟微服务平台未来会沿着双引擎多模式架构路线持续建设,主要包括:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"垂直平台引擎之深耕"},{"type":"text","text":":无侵入 Agent 服务治理、低门槛高性能服务网格等垂直方向持续深耕,继续夯实无侵入 Agent、Sidecar 的能力"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"水平业务模式之演进"},{"type":"text","text":":多种治理模式平滑迁移覆盖更完整的业务场景,能力高度平台化,继续降低企业微服务架构演进的成本,保证平滑与稳定"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"与未来同行,历久弥新"},{"type":"text","text":":深度整合多运行时、Spring Native 等技术,保持架构先进性,持续为业务带来价值"}]}]}]},{"type":"heading","attrs":{"align":null,"level":4},"content":[{"type":"text","text":"参考资料"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/mp.weixin.qq.com\/s\/Eb2TDqxs69300S-RTGH0Jg","title":"xxx","type":null},"content":[{"type":"text","text":"网易轻舟从微服务框架到服务网格架构平滑演进最佳实践(详见内文第 4 部分)"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.cn\/article\/4Zog2lMBqKjAeMTc8Add","title":"xxx","type":null},"content":[{"type":"text","text":"解读微服务的 2020:框架在左网格在右,云原生时代的微服务路在何方"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.cn\/article\/bLVkRO09oZT1hB53SkfJ","title":"xxx","type":null},"content":[{"type":"text","text":"落地三年,两次架构升级,网易 Service Mesh 实践之路"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.cn\/article\/SF5sl4IlUtUxuED3Musl","title":"xxx","type":null},"content":[{"type":"text","text":"云原生时代的流量入口:Envoy Gateway"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"作者简介"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"裴斐,网易数帆云计算技术专家、资深架构师。10 余年企业级平台架构和开发经验,目前主要负责网易轻舟微服务治理团队,专注于企业微服务架构及云原生技术的研究与落地工作。带领团队完成网易轻舟 Service Mesh、微服务框架 NSF、API 网关等多个项目在网易集团落地及商业化产品输出。"}]}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章