Azure Service Fabric 概述Overview of Azure Service Fabric

Azure Service Fabric 是一款分布式系统平台,可方便用户轻松打包、部署和管理可缩放的可靠微服务和容器。Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices and containers. Service Fabric 还解决了开发和管理云原生应用程序面临的重大难题。Service Fabric also addresses the significant challenges in developing and managing cloud native applications. 开发人员和管理员不需解决复杂的基础结构问题,只需专注于实现具有严苛要求的任务关键型工作负荷,即那些可缩放、可靠且易于管理的工作负荷。Developers and administrators can avoid complex infrastructure problems and focus on implementing mission-critical, demanding workloads that are scalable, reliable, and manageable. Service Fabric 代表了下一代平台,用于生成和管理在容器中运行的企业级单层云规模应用程序。Service Fabric represents the next-generation platform for building and managing these enterprise-class, tier-1, cloud-scale applications running in containers.


Azure Service Fabric 资源提供程序在所有 Azure 区域中都可用,并符合 Azure 所具有的全部合规性证书;这包括以下内容:SOC、ISO、PCI DSS、HIPAA 和 GDPR。Azure Service Fabric Resource Provider is available in all Azure regions and is compliant with all compliance certs that Azure has; this includes the following: SOC, ISO, PCI DSS, HIPAA, and GDPR. 要获取合规性证书的完整列表,请查看:合规性产品Please review the following for a complete list of compliance certs: Compliance Offerings

由微服务组成的应用程序Applications composed of microservices

借助 Service Fabric,可以生成和管理由微服务构成的可缩放且可靠的应用程序。Service Fabric enables you to build and manage scalable and reliable applications composed of microservices. 这些分布式微服务在计算机的共享池上以高密度运行,它们被称为群集。These distributed microservices run at high density on a shared pool of machines, which is referred to as a cluster. Service Fabric 提供了一种复杂的轻型运行时,可支持无状态和有状态微服务。Service Fabric provides a sophisticated, lightweight runtime that supports stateless and stateful microservices. 它还提供了全面的应用程序管理功能,用于预配、部署、监视、升级/修补和删除所部署的应用程序。It also provides comprehensive application management capabilities to provision, deploy, monitor, upgrade/patch, and delete deployed applications.

Service Fabric 专为创建云原生服务而设计,这些服务可能刚开始规模很小(根据需要),随后成长为包含成百上千台计算机的大规模服务。Service Fabric is tailored to create cloud native services that can start small, as needed, and grow to massive scale with hundreds or thousands of machines. 当今的 Internet 规模的服务是使用微服务构建而成的。Today's Internet-scale services are built of microservices. 微服务的例子包括协议网关、用户配置文件、购物车,清单处理、排队和缓存等。Examples of microservices include protocol gateways, user profiles, shopping carts, inventory processing, queues, and caches.

Service Fabric 为当今很多 Azure 服务提供技术支持,包括 Azure SQL 数据库、Azure Cosmos DB、Cortana、Microsoft Power BI、Microsoft Intune、Azure 事件中心、Azure IoT 中心、Dynamics 365、Skype for Business 以及其他许多核心 Azure 服务。Service Fabric powers many Azure services today, including Azure SQL Database, Azure Cosmos DB, Cortana, Microsoft Power BI, Microsoft Intune, Azure Event Hubs, Azure IoT Hub, Dynamics 365, Skype for Business, and many core Azure services.

Service Fabric 在 Service Fabric 群集间部署和激活的容器内部托管微服务。Service Fabric hosts microservices inside containers that are deployed and activated across the Service Fabric cluster. 从虚拟机移动到容器可能使密度出现数量级增长。A move from virtual machines to containers makes possible an order-of-magnitude increase in density. 同样,如果从容器移动到这些容器中的微服务,也可能会出现另一个密度数量级。Similarly, another order of magnitude in density becomes possible when you move from containers to microservices in these containers. 例如,单个 Azure SQL 数据库群集包含数百台计算机,这些计算机运行数以万计的容器,这些容器总共托管数十万个数据库。For example, a single cluster for Azure SQL Database comprises hundreds of machines running tens of thousands of containers that host a total of hundreds of thousands of databases. 每个数据库都是一个 Service Fabric 有状态微服务。Each database is a Service Fabric stateful microservice.

有关微服务方法的详细信息,请阅读为什么使用微服务方法生成应用程序?For more on the microservices approach, read Why a microservices approach to building applications?

容器部署和业务流程Container deployment and orchestration

Service Fabric 是 21Vianet 推出的跨计算机群集部署微服务的容器业务流程协调程序Service Fabric is 21Vianet's container orchestrator deploying microservices across a cluster of machines. 微服务的开发方法有多种,从使用 Service Fabric 编程模型ASP.NET Core 到部署任意选定代码Microservices can be developed in many ways from using the Service Fabric programming models, ASP.NET Core, to deploying any code of your choice. 重要的是,可以在同一个应用程序中将进程中的服务和容器中的服务混用。Importantly, you can mix both services in processes and services in containers in the same application. 如果只需要部署和管理容器,那么 Service Fabric 是容器业务流程协调程序的理想选择。If you just want to deploy and manage containers, Service Fabric is a perfect choice as a container orchestrator.

不限 OS 和云Any OS, any cloud

Service Fabric 可以在所有环境中运行。Service Fabric runs everywhere. 可以在许多环境中(包括:在 Azure 中或本地、在 Windows Server 中或在 Linux 中)创建 Service Fabric 群集。You can create clusters for Service Fabric in many environments, including Azure or on premises, on Windows Server, or on Linux. 甚至可以在其他公有云上创建群集。You can even create clusters on other public clouds. 此外,SDK 中的开发环境与生产环境完全相同 ,都不涉及模拟器。In addition, the development environment in the SDK is identical to the production environment, with no emulators involved. 也就是说,在本地开发群集上运行的内容会部署到其他环境中的群集。In other words, what runs on your local development cluster deploys to the clusters in other environments.

Service Fabric 平台

为了便于 Windows 开发,Service Fabric .NET SDK 已与 Visual Studio 和 Powershell 集成。For Windows development, the Service Fabric .NET SDK is integrated with Visual Studio and Powershell. 请参阅在 Windows 上准备开发环境See Prepare your development environment on Windows. 为了便于 Linux 开发,Service Fabric Java SDK 已与 Eclipse 集成,并且 Yeoman 被用来为 Java、.NET Core 和容器应用程序生成模板。For Linux development, the Service Fabric Java SDK is integrated with Eclipse, and Yeoman is used to generate templates for Java, .NET Core, and container applications. 请参阅在 Linux 上准备开发环境See Prepare your development environment on Linux

有关创建群集的详细信息,请阅读在 Windows Server 或 Linux 上创建群集;有关在 Azure 中创建群集的详细信息,请阅读通过 Azure 门户创建群集For more information on creating clusters, read creating a cluster on Windows Server or Linux or for Azure creating a cluster via the Azure portal.

无状态和有状态 Service Fabric 微服务Stateless and stateful microservices for Service Fabric

使用 Service Fabric,可以生成包含微服务或容器的应用程序。Service Fabric enables you to build applications that consist of microservices or containers. 无状态微服务(例如协议网关和 Web 代理)不在请求以及服务对请求的响应之外维持可变状态。Stateless microservices (such as protocol gateways and web proxies) do not maintain a mutable state outside a request and its response from the service. Azure 云服务辅助角色是无状态服务的一个示例。Azure Cloud Services worker roles are an example of a stateless service. 有状态微服务(例如,用户帐户、数据库、设备、购物车、队列)维护除请求及其响应之外的可变、授权状态。Stateful microservices (such as user accounts, databases, devices, shopping carts, and queues) maintain a mutable, authoritative state beyond the request and its response. 当今的 Internet 规模的应用程序包含无状态和有状态微服务的组合。Today's Internet-scale applications consist of a combination of stateless and stateful microservices.

Service Fabric 的关键区别在于非常注重使用内置编程模型或容器化有状态服务生成有状态服务。A key differentiation with Service Fabric is its strong focus on building stateful services, either with the built-in programming models or with containerized stateful services. 应用程序方案介绍了可使用有状态服务的方案。The application scenarios describe the scenarios where stateful services are used.

应用程序生命周期管理Application lifecycle management

Service Fabric 为包含容器的云应用程序的完整生命周期和 CI/CD 提供支持。Service Fabric provides support for the full application lifecycle and CI/CD of cloud applications including containers. 生命周期包括从开发到部署、到日常管理和维护,再到最终解除授权。This lifecycle includes development through deployment, daily management, and maintenance to eventual decommissioning.

借助 Service Fabric 应用程序生命周期管理功能,应用程序管理员和 IT 操作人员能够使用低接触的简单工作流预配、部署、修补和监视应用程序。Service Fabric application lifecycle management capabilities enable application administrators and IT operators to use simple, low-touch workflows to provision, deploy, patch, and monitor applications. 这些内置的工作流极大地减少了 IT 操作人员在保持应用程序持续可用这一方面的负担。These built-in workflows greatly reduce the burden on IT operators to keep applications continuously available.

大多数应用程序都由无状态微服务、有状态微服务、容器以及与它们一起部署的其他可执行文件组合而成。Most applications consist of a combination of stateless and stateful microservices, containers, and other executables that are deployed together. Service Fabric 在应用程序上采用强类型,因此可用于部署多个应用程序实例。By having strong types on the applications, Service Fabric enables the deployment of multiple application instances. 每个实例将单独进行管理和升级。Each instance is managed and upgraded independently. 重点是,Service Fabric 能够部署容器或任何可执行文件,并确保它们的可靠性。Importantly, Service Fabric can deploy containers or any executables and make them reliable. 例如,Service Fabric 可部署 .NET、ASP.NET Core、Python、Node.js、Windows 容器、Linux 容器、Java 虚拟机、脚本、Angular 或应用程序的其他任何组成部分。For example, Service Fabric can deploy .NET, ASP.NET Core, Python, Node.js, Windows containers, Linux containers, Java virtual machines, scripts, Angular, or literally anything that makes up your application.

Service Fabric 与 Azure PipelinesJenkinsOctopus Deploy 等 CI/CD 工具集成,并可与其他任何常用 CI/CD 工具配合使用。Service Fabric is integrated with CI/CD tools such as Azure Pipelines, Jenkins, and Octopus Deploy and can be used with any other popular CI/CD tool.

有关应用程序生命周期管理的详细信息,请参阅应用程序生命周期For more information about application lifecycle management, read Application lifecycle. 若要详细了解如何部署任意代码,请参阅部署来宾可执行文件For more about how to deploy any code, see deploy a guest executable.

关键功能Key capabilities

通过使用 Service Fabric,可以:By using Service Fabric, you can:

  • 部署到 Azure 或部署到运行 Windows 或 Linux 的本地数据中心,而无需改变任何代码。Deploy to Azure or to on-premises datacenters that run Windows or Linux with zero code changes. 只需编写一次,即可部署到任意位置的任意 Service Fabric 群集。Write once, and then deploy anywhere to any Service Fabric cluster.
  • 使用 Service Fabric 编程模型、容器或任意代码,开发由微服务组成的可缩放应用程序。Develop scalable applications that are composed of microservices by using the Service Fabric programming models, containers, or any code.
  • 开发高度可靠的无状态和有状态微服务。Develop highly reliable stateless and stateful microservices. 使用有状态微服务,简化应用程序设计。Simplify the design of your application by using stateful microservices.
  • 使用新 Reliable Actors 编程模型,创建具有独立式代码和状态的云对象。Use the novel Reliable Actors programming model to create cloud objects with self contained code and state.
  • 部署和安排容器,包括 Windows 容器和 Linux 容器。Deploy and orchestrate containers that include Windows containers and Linux containers. Service Fabric 是可感知数据的有状态容器 Orchestrator。Service Fabric is a data aware, stateful, container orchestrator.
  • 几秒内就可以高密度部署应用程序,即每台计算机部署成百上千个应用程序或容器。Deploy applications in seconds, at high density with hundreds or thousands of applications or containers per machine.
  • 以并行方式部署同一应用程序的不同版本,且可以单独升级每个应用程序。Deploy different versions of the same application side by side, and upgrade each application independently.
  • 无需停机,即可管理应用程序生命周期,包括中断升级和非中断升级。Manage the lifecycle of your applications without any downtime, including breaking and nonbreaking upgrades.
  • 缩放群集中的节点数。Scale out or scale in the number of nodes in a cluster. 缩放节点数的同时,应用程序也会随之自动缩放。As you scale nodes, your applications automatically scale.
  • 监视并诊断应用程序的运行状况,并设置用来执行自动修复的策略。Monitor and diagnose the health of your applications and set policies for performing automatic repairs.
  • 观察资源均衡器如何安排应用程序在群集中的重新分布。Watch the resource balancer orchestrate the redistribution of applications across the cluster. Service Fabric 可从故障中恢复,并基于可用资源优化负载分布。Service Fabric recovers from failures and optimizes the distribution of load based on available resources.

后续步骤Next steps