您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

Service Fabric 术语概述Service Fabric terminology overview

Azure Service Fabric 是一种分布式系统平台,适用于打包、部署和管理可缩放的可靠微服务。Azure Service Fabric is a distributed systems platform that makes it easy to package, deploy, and manage scalable and reliable microservices. 可以在任何位置托管 Service Fabric 群集:Azure、本地数据中心或任何云提供程序。You can host Service Fabric clusters anywhere: Azure, in an on-premises datacenter, or on any cloud provider. Service Fabric 是支持 Azure Service Fabric 网格的业务流程协调程序。Service Fabric is the orchestrator that powers Azure Service Fabric Mesh. 可以使用任何框架编写服务,并从多个环境选项中选择运行应用程序的位置。You can use any framework to write your services and choose where to run the application from multiple environment choices. 本文详细介绍 Service Fabric 所使用的术语,帮助了解文档中使用的术语。This article details the terminology used by Service Fabric to understand the terms used in the documentation.

基础结构概念Infrastructure concepts

群集:一组通过网络连接在一起的虚拟机或物理计算机,微服务会在其中部署和管理。Cluster: A network-connected set of virtual or physical machines into which your microservices are deployed and managed. 群集可以扩展到成千上万台计算机。Clusters can scale to thousands of machines.

节点:属于群集一部分的计算机或 VM 称为节点。Node: A machine or VM that's part of a cluster is called a node. 需为每个节点分配节点名称(字符串)。Each node is assigned a node name (a string). 节点具有各种特征,如放置属性。Nodes have characteristics, such as placement properties. 每个计算机或 VM 都有一个自动启动 Windows 服务 FabricHost.exe,此服务在引导时开始运行,并启动两个可执行文件:Fabric.exeFabricGateway.exeEach machine or VM has an auto-start Windows service, FabricHost.exe, that starts running upon boot and then starts two executables: Fabric.exe and FabricGateway.exe. 这两个可执行文件构成了节点。These two executables make up the node. 在测试方案中,可以通过运行 Fabric.exeFabricGateway.exe 的多个实例,在单台计算机或 VM 上托管多个节点。For testing scenarios, you can host multiple nodes on a single machine or VM by running multiple instances of Fabric.exe and FabricGateway.exe.

应用程序和服务概念Application and service concepts

Service Fabric 网格应用程序:Service Fabric 网格应用程序由资源模型(YAML 和 JSON 资源文件)描述,可以部署到运行 Service Fabric 的任何环境中。Service Fabric Mesh Application: Service Fabric Mesh Applications are described by the Resource Model (YAML and JSON resource files) and can be deployed to any environment where Service Fabric runs.

Service Fabric 本机应用程序:Service Fabric 本机应用程序由本机应用程序模型(基于 XML 的应用程序和服务清单)描述。Service Fabric Native Application: Service Fabric Native Applications are described by the Native Application Model (XML-based application and service manifests). Service Fabric 本机应用程序无法在 Service Fabric 网格中运行。Service Fabric Native Applications cannot run in Service Fabric Mesh.

Service Fabric 网格应用程序概念Service Fabric Mesh Application concepts

应用程序:应用程序是网格应用程序的部署、版本控制和生存期的单位。Application: An application is the unit of deployment, versioning, and lifetime of a Mesh application. 可以独立管理每个应用程序实例的生命周期。The lifecycle of each application instance can be managed independently. 应用程序由一个或多个服务代码包和设置组成。Applications are composed of one or more service code packages and settings. 应用程序是使用 Azure 资源模型 (RM) 架构定义的。An application is defined using the Azure Resource Model (RM) schema. 服务被描述为 RM 模板中的应用程序资源的属性。Services are described as properties of the application resource in a RM template. 应用程序使用的网络和卷由应用程序引用。Networks and volumes used by the application are referenced by the application. 创建应用程序时,应用程序、服务、网络和卷均使用 Service Fabric 资源模型建模。When creating an application, the application, service(s), network, and volume(s) are modeled using the Service Fabric Resource Model.

服务:应用程序中的服务代表微服务并执行完整且独立的功能。Service: A service in an application represents a microservice and performs a complete and standalone function. 每个服务由一个或多个代码包组成,这些代码包描述运行与代码包关联的容器映像所需的所有内容。Each service is composed of one, or more, code packages that describe everything needed to run the container image associated with the code package. 应用程序中的服务数量可以增大和减小。The number of services in an application can be scaled up and down.

网络:网络资源为应用程序创建专用网络,并独立于可能引用它的应用程序或服务。Network: A network resource creates a private network for your applications and is independent of the applications or services that may refer to it. 同一网络可以包含来自不同应用程序的多个服务。Multiple services from different applications can be part of the same network. 网络是应用程序引用的可部署资源。Networks are deployable resources that are referenced by applications.

代码包:代码包描述运行与代码包关联的容器映像所需的所有内容,包括以下内容:Code package: Code packages describe everything needed to run the container image associated with the code package, including the following:

  • 容器名称、版本和注册表Container name, version, and registry
  • 每个容器所需的 CPU 和内存资源CPU and memory resources required for each container
  • 网络终结点Network endpoints
  • 要在引用单独卷资的源容器中装载的卷。Volumes to mount in the container, referencing a separate volume resource.

若代码包被定义为应程序资源的一部分,则所有此类代码包都作为一组一起进行部署和激活。All the code packages defined as part of an application resource are deployed and activated together as a group.

:卷是装载在可用于保留状态的容器实例内的目录。Volume: Volumes are directories that get mounted inside your container instances that you can use to persist state. Azure 文件卷驱动程序将 Azure 文件共享安装到容器,并通过支持文件存储的任何 API 提供可靠的数据存储。The Azure Files volume driver mounts an Azure Files share to a container and provides reliable data storage through any API which supports file storage. 卷是应用程序引用的可部署资源。Volumes are deployable resources that are referenced by applications.

Service Fabric 本机应用程序概念Service Fabric Native Application concepts

应用程序:应用程序是由执行一个或多个特定功能的成分服务组成的集合。Application: An application is a collection of constituent services that perform a certain function or functions. 可以独立管理每个应用程序实例的生命周期。The lifecycle of each application instance can be managed independently.

服务:服务执行完整且独立的功能,可以独立于其他服务启动和运行。Service: A service performs a complete and standalone function and can start and run independently of other services. 服务由代码、配置和数据组成。A service is composed of code, configuration, and data. 对于每个服务,代码由可执行二进制文件组成,配置由可在运行时加载的服务设置组成,数据则由可供该服务使用的任意静态数据组成。For each service, code consists of the executable binaries, configuration consists of service settings that can be loaded at run time, and data consists of arbitrary static data to be consumed by the service.

应用程序类型:分配给服务类型集合的名称/版本。Application type: The name/version assigned to a collection of service types. ApplicationManifest.xml 文件中定义并嵌入到应用程序包目录。It is defined in an ApplicationManifest.xml file and embedded in an application package directory. 然后将目录复制到 Service Fabric 群集的映像存储。The directory is then copied to the Service Fabric cluster's image store. 然后,可以基于此应用程序类型,在群集内创建命名的应用程序。You can then create a named application from this application type within the cluster.

有关详细信息,请阅读应用程序模型一文。Read the Application model article for more information.

应用程序包:一个磁盘目录,其中包含应用程序类型的 ApplicationManifest.xml 文件。Application package: A disk directory containing the application type's ApplicationManifest.xml file. 引用构成应用程序类型的每个服务类型的服务包。References the service packages for each service type that makes up the application type. 应用程序包目录中的文件将复制到 Service Fabric 群集的映像存储。The files in the application package directory are copied to Service Fabric cluster's image store. 例如,电子邮件应用程序类型的应用程序包可能包含对队列服务包、前端服务包和数据库服务包的引用。For example, an application package for an email application type might contain references to a queue-service package, a frontend-service package, and a database-service package.

命名应用程序:将应用程序包复制到映像存储后,在群集中创建应用程序实例。Named application: After you copy an application package to the image store, you create an instance of the application within the cluster. 当你指定应用程序包的应用程序类型时,通过使用其名称或版本来创建一个实例。You create an instance when you specify the application package's application type, by using its name or version. 将为每个应用程序类型实例分配一个类似如下的统一资源标识符 (URI) 名称:"fabric:/MyNamedApp"Each application type instance is assigned a uniform resource identifier (URI) name that looks like: "fabric:/MyNamedApp". 在群集中,可以从单个应用程序类型创建多个命名应用程序。Within a cluster, you can create multiple named applications from a single application type. 还可以从不同的应用程序类型创建命名应用程序。You can also create named applications from different application types. 可单独管理每个命名应用程序并设置其版本。Each named application is managed and versioned independently.

服务类型:分配给服务的代码包、数据包、配置包的名称/版本。Service type: The name/version assigned to a service's code packages, data packages, and configuration packages. 服务类型在 ServiceManifest.xml 文件中定义,并嵌入到服务包目录中。The service type is defined in the ServiceManifest.xml file and embedded in a service package directory. 然后,服务包目录由应用程序包的 ApplicationManifest.xml 文件引用。The service package directory is then referenced by an application package's ApplicationManifest.xml file. 在群集中创建命名应用程序后,可以从应用程序类型的服务类型之一创建命名服务。Within the cluster, after creating a named application, you can create a named service from one of the application type's service types. 服务类型的 ServiceManifest.xml 文件描述该服务。The service type's ServiceManifest.xml file describes the service.

有关详细信息,请阅读应用程序模型一文。Read the Application model article for more information.

有两种类型的服务:There are two types of services:

  • 无状态:服务的持久状态存储在 Azure 存储、Azure SQL 数据库、Azure Cosmos DB 等外部存储服务中时,请使用无状态服务。Stateless: Use a stateless service when the service's persistent state is stored in an external storage service, such as Azure Storage, Azure SQL Database, or Azure Cosmos DB. 当服务没有永久性存储时,请使用无状态服务。Use a stateless service when the service has no persistent storage. 以计算器服务为例,首先要将值传递给该服务,然后服务使用这些值执行计算并返回结果。For example, for a calculator service where values are passed to the service, a computation is performed that uses these values, and then a result is returned.
  • 有状态:如果要让 Service Fabric 通过其 Reliable Collections 或 Reliable Actors 编程模型管理服务状态,请使用有状态服务。Stateful: Use a stateful service when you want Service Fabric to manage your service's state via its Reliable Collections or Reliable Actors programming models. 创建命名服务时,请指定要将状态分布于其中的分区数量,以实现伸缩性。When you create a named service, specify how many partitions you want to spread your state over for scalability. 此外,指定跨节点复制状态的次数,以实现可靠性。Also specify how many times to replicate your state across nodes, for reliability. 每个命名服务都有一个主副本和多个辅助副本。Each named service has a single primary replica and multiple secondary replicas. 在写入主要副本时修改命名服务的状态。You modify your named service's state when you write to the primary replica. 然后,Service Fabric 会将此状态复制到所有次要副本以使状态保持同步。当主要副本失败时,Service Fabric 会自动检测到此状态,并将现有的次要副本升级为主要副本。Service Fabric then replicates this state to all the secondary replicas to keep your state in sync. Service Fabric automatically detects when a primary replica fails and promotes an existing secondary replica to a primary replica. 然后,Service Fabric 会创建新的次要副本。Service Fabric then creates a new secondary replica.

副本或实例是指已部署或运行中的服务的代码(和有状态服务的状态)。Replicas or instances refer to code (and state for stateful services) of a service that's deployed and running. 请参阅副本和实例See Replicas and instances.

重新配置是指服务副本集中任何更改的过程。Reconfiguration refers to the process of any change in the replica set of a service. 请参阅重新配置See Reconfiguration.

服务包:一个磁盘目录,其中包含服务类型的 ServiceManifest.xml 文件。Service package: A disk directory containing the service type's ServiceManifest.xml file. 此文件引用服务类型的代码、静态数据和配置包。This file references the code, static data, and configuration packages for the service type. 应用程序类型的 ApplicationManifest.xml 文件引用服务包目录中的文件。The files in the service package directory are referenced by the application type's ApplicationManifest.xml file. 例如,服务包可能引用构成数据库服务的代码、静态数据和配置包。For example, a service package might refer to the code, static data, and configuration packages that make up a database service.

命名服务:创建命名应用程序后,可以在群集中创建它的其中一个服务类型的实例。Named service: After you create a named application, you can create an instance of one of its service types within the cluster. 通过使用其名称/版本指定服务类型。You specify the service type by using its name/version. 需为每个服务类型实例分配一个 URI 名称,该名称归并到实例的命名应用程序的 URI 之下。Each service type instance is assigned a URI name scoped under its named application's URI. 例如,如果在命名应用程序“MyNamedApp”中创建命名服务“MyDatabase”,则 URI 将类似于:"fabric:/MyNamedApp/MyDatabase"For example, if you create a "MyDatabase" named service within a "MyNamedApp" named application, the URI looks like: "fabric:/MyNamedApp/MyDatabase". 在一个命名应用程序中可以创建多个命名服务。Within a named application, you can create several named services. 每个命名服务可以有自身的分区方案和实例或副本计数。Each named service can have its own partition scheme and instance or replica counts.

代码包:一个磁盘目录,其中包含服务类型的可执行文件,通常是 EXE/DLL 文件。Code package: A disk directory containing the service type's executable files, typically EXE/DLL files. 服务类型的 ServiceManifest.xml 文件引用代码包目录中的文件。The files in the code package directory are referenced by the service type's ServiceManifest.xml file. 创建命名服务后,会将代码包复制到选定来运行命名服务的一个或多个节点。When you create a named service, the code package is copied to the node or nodes selected to run the named service. 然后代码将开始运行。Then the code starts to run. 有两种类型的代码包可执行文件:There are two types of code package executables:

  • 来宾可执行文件:在主机操作系统(Windows 或 Linux)上按原样运行的可执行文件。Guest executables: Executables that run as-is on the host operating system (Windows or Linux). 这些可执行文件不会链接到或引用任何 Service Fabric 运行时文件,因此不会使用任何 Service Fabric 编程模型。These executables don't link to or reference any Service Fabric runtime files and therefore don't use any Service Fabric programming models. 这些可执行文件不能使用某些 Service Fabric 功能,例如终结点发现的命名服务。These executables are unable to use some Service Fabric features, such as the naming service for endpoint discovery. 来宾可执行文件无法报告特定于每个服务实例的负载指标。Guest executables can't report load metrics that are specific to each service instance.
  • 服务主机可执行文件:通过链接到 Service Fabric 运行时文件、启用 Service Fabric 功能来使用 Service Fabric 编程模型的可执行文件。Service host executables: Executables that use Service Fabric programming models by linking to Service Fabric runtime files, enabling Service Fabric features. 例如,命名服务实例可在 Service Fabric 命名服务中注册终结点,还可以报告负载指标。For example, a named service instance can register endpoints with Service Fabric's Naming Service and can also report load metrics.

数据包:一个磁盘目录,其中包含服务类型的静态只读数据文件,通常是照片、音频和视频文件。Data package: A disk directory that contains the service type's static, read-only data files, typically photo, sound, and video files. 服务类型的 ServiceManifest.xml 文件引用数据包目录中的文件。The files in the data package directory are referenced by the service type's ServiceManifest.xml file. 创建命名服务后,会将数据包复制到选定来运行命名服务的一个或多个节点。When you create a named service, the data package is copied to the node or nodes selected to run the named service. 代码开始运行,现在即可访问数据文件。The code starts running and can now access the data files.

配置包:一个磁盘目录,其中包含服务类型的静态只读配置文件,通常是文本文件。Configuration package: A disk directory that contains the service type's static, read-only configuration files, typically text files. 服务类型的 ServiceManifest.xml 文件引用配置包目录中的文件。The files in the configuration package directory are referenced by the service type's ServiceManifest.xml file. 创建命名服务后,会将配置包中的文件复制到选定运行命名服务的一个或多个节点。When you create a named service, the files in the configuration package are copied one or more nodes selected to run the named service. 然后,代码开始运行,现在即可访问配置文件。Then the code starts to run and can now access the configuration files.

容器:默认情况下,Service Fabric 以进程形式部署和激活这些服务。Containers: By default, Service Fabric deploys and activates services as processes. Service Fabric 还可以部署容器映像中的服务。Service Fabric can also deploy services in container images. 容器是在应用程序中将基础操作系统虚拟化的一种虚拟化技术。Containers are a virtualization technology that virtualizes the underlying operating system from applications. 应用程序及其运行时、依赖项和系统库在一个容器内运行。An application and its runtime, dependencies, and system libraries run inside a container. 容器对自己的操作系统构造隔离视图具有全部专有访问权限。The container has full, private access to the container's own isolated view of the operating system constructs. Service Fabric 支持 Linux 上的 Docker 容器和 Windows Server 容器。Service Fabric supports Docker containers on Linux and Windows Server containers. 有关详细信息,请参阅 Service Fabric 和容器For more information, read Service Fabric and containers.

分区方案:创建命名服务时,需要指定一个分区方案。Partition scheme: When you create a named service, you specify a partition scheme. 包含大量状态的服务跨分区拆分数据,将状态分散在群集的节点上。Services with substantial amounts of state split the data across partitions, which spreads the state across the cluster's nodes. 通过在分区之间拆分数据,可以扩展命名服务的状态。By splitting the data across partitions, your named service's state can scale. 在分区中,无状态命名服务具有实例,而有状态命名服务具有副本。Within a partition, stateless named services have instances, whereas stateful named services have replicas. 通常,无状态命名服务只有一个分区,因为它们没有内部状态。Usually, stateless named services have only one partition, because they have no internal state. 分区实例提供可用性。The partition instances provide for availability. 如果一个实例失败,其他实例可继续正常运行,然后 Service Fabric 将创建新的实例。If one instance fails, other instances continue to operate normally, and then Service Fabric creates a new instance. 有状态命名服务在副本中保持其状态,每个分区都有自身的副本集,以便状态保持同步。如果某个副本失败,Service Fabric 将从现有副本创建新副本。Stateful named services maintain their state within replicas and each partition has its own replica set so the state is kept in sync. Should a replica fail, Service Fabric builds a new replica from the existing replicas.

有关详细信息,请阅读 Service Fabric Reliable Services 分区一文。Read the Partition Service Fabric reliable services article for more information.

系统服务System services

系统在每个群集中创建了一些系统服务,用于提供 Service Fabric 的平台功能。There are system services that are created in every cluster that provide the platform capabilities of Service Fabric.

命名服务:每个 Service Fabric 群集均有一个命名服务,该服务将服务名称解析到群集中的某个位置。Naming Service: Each Service Fabric cluster has a Naming Service, which resolves service names to a location in the cluster. 使用类似于管理群集的 Internet 域名系统 (DNS) 的方式管理服务名称和属性。You manage the service names and properties, like an internet Domain Name System (DNS) for the cluster. 客户端可以使用命名服务安全地与群集中的任何节点进行通信,以解析服务名称及其位置。Clients securely communicate with any node in the cluster by using the Naming Service to resolve a service name and its location. 应用程序在群集内移动。Applications move within the cluster. 例如,原因可以是故障、资源平衡或重设群集大小。For example, this can be due to failures, resource balancing, or the resizing of the cluster. 可开发解析当前网络位置的服务和客户端。You can develop services and clients that resolve the current network location. 客户端会获得实际计算机 IP 地址及其当前运行位置所在的端口。Clients obtain the actual machine IP address and port where it's currently running.

有关使用搭配命名服务运行的客户端与服务通信 API 的详细信息,请阅读与服务通信Read Communicate with services for more information on the client and service communication APIs that work with the Naming Service.

映像存储服务:每个 Service Fabric 群集都有一个映像存储服务,其中保存已部署且版本化的应用程序包。Image Store service: Each Service Fabric cluster has an Image Store service where deployed, versioned application packages are kept. 将应用程序包复制到映像存储,并注册该应用程序包内包含的应用程序类型。Copy an application package to the Image Store and then register the application type contained within that application package. 预配应用程序类型后,根据它创建命名应用程序。After the application type is provisioned, you create a named application from it. 在删除某个应用程序类型的所有命名应用程序之后,可以从映像存储服务中注销该应用程序类型。You can unregister an application type from the Image Store service after all its named applications have been deleted.

有关映像存储服务的详细信息,请参阅了解 ImageStoreConnectionString 设置Read Understand the ImageStoreConnectionString setting for more information about the Image Store service.

有关将应用程序部署到映像存储服务的详细信息,请阅读部署应用程序一文。Read the Deploy an application article for more information on deploying applications to the Image Store service.

故障转移管理器服务:每个 Service Fabric 群集都具有一个故障转移管理器服务,负责执行以下操作:Failover Manager service: Each Service Fabric cluster has a Failover Manager service that is responsible for the following actions:

  • 执行与服务的高可用性和一致性相关的功能。Performs functions related to high availability and consistency of services.
  • 协调应用程序和群集升级。Orchestrates application and cluster upgrades.
  • 与其他系统组件交互。Interacts with other system components.

修复管理器服务:这是一项可选的系统服务,可在集群上实现自动、透明、安全的修复操作。Repair Manager service: This is an optional system service that allows repair actions to be performed on a cluster in a way that is safe, automatable, and transparent. 修复管理器可用于:Repair manager is used in:

部署和应用程序模型Deployment and application models

若要部署服务,需要描述服务的运行方式。To deploy your services, you need to describe how they should run. Service Fabric 支持 3 种不同的部署模型:Service Fabric supports three different deployment models:

资源模型(预览版)Resource model (preview)

Service Fabric 资源是可以单独部署到 Service Fabric 的任何内容,包括应用程序、服务、网络和卷。Service Fabric Resources are anything that can be deployed individually to Service Fabric; including applications, services, networks, and volumes. 资源是使用可以部署到集群终结点的 JSON 文件定义的。Resources are defined using a JSON file, which can be deployed to a cluster endpoint. 对于 Service Fabric 网格,使用 Azure 资源模型架构。For Service Fabric Mesh, the Azure Resource Model schema is used. YAML 文件架构还可用于更轻松地创作定义文件。A YAML file schema can also be used to more easily author definition files. 可将资源部署到 Service Fabric 运行的任何位置。Resources can be deployed anywhere Service Fabric runs. 资源模型是用来描述 Service Fabric 应用程序的最简单方法。The resource model is the simplest way to describe your Service Fabric applications. 其主要重点在于容器化服务的简单部署和管理。Its main focus is on simple deployment and management of containerized services. 要了解详细信息,请参阅 Service Fabric 资源模型简介To learn more, read Introduction to the Service Fabric Resource Model.

本机模块Native model

本机应用程序模型为应用程序提供对 Service Fabric 的完整低级别访问权限。The native application model provides your applications with full low-level access to Service Fabric. 应用程序和服务被定义为 XML 清单文件中的已注册类型。Applications and services are defined as registered types in XML manifest files.

本机模型支持 Reliable Services 和 Reliable Actors 框架,该框架提供对 C# 和 Java 中 Service Fabric 运行时 API 和群集管理 API 的访问权限。The native model supports the Reliable Services and Reliable Actors frameworks, which provides access to the Service Fabric runtime APIs and cluster management APIs in C# and Java. 本机模型还支持任意容器和可执行文件。The native model also supports arbitrary containers and executables. Service Fabric 网格环境中不支持本机模型。The native model is not supported in the Service Fabric Mesh environment.

Reliable Services:用于构建无状态和有状态服务的 API。Reliable Services: An API to build stateless and stateful services. 有状态服务将其状态存储在 Reliable Collections(例如字典或队列)中。Stateful services store their state in Reliable Collections, such as a dictionary or a queue. 也可插入各种通信堆栈,如 Web API 和 Windows Communication Foundation (WCF)。You can also plug in various communication stacks, such as Web API and Windows Communication Foundation (WCF).

Reliable Actors:用于通过虚拟执行组件编程模型构建无状态和有状态对象的 API。Reliable Actors: An API to build stateless and stateful objects through the virtual Actor programming model. 如果有大量的独立计算或状态单位,此模型可能十分有用。This model is useful when you have lots of independent units of computation or state. 此模型使用基于轮次的线程模型,因此最好避免使用向外调用其他执行组件或服务的代码,原因是只有在单个执行组件的所有出站请求都已完成后,该执行组件才能处理其他传入请求。This model uses a turn-based threading model, so it's best to avoid code that calls out to other actors or services because an individual actor can't process other incoming requests until all its outbound requests are finished.

还可以在 Service Fabric 上运行现有应用程序:You can also run your existing applications on Service Fabric:

容器:Service Fabric 支持在 Linux 上部署 Docker 容器,在 Windows Server 2016 上部署 Windows Server 容器,同时支持 Hyper-V 隔离模式。Containers: Service Fabric supports the deployment of Docker containers on Linux and Windows Server containers on Windows Server 2016, along with support for Hyper-V isolation mode. 在 Service Fabric 应用程序模型中,容器表示放置多个服务副本的应用程序主机。In the Service Fabric application model, a container represents an application host in which multiple service replicas are placed. Service Fabric 可运行任何容器,该方案类似于来宾可执行的方案,可在容器内打包现有应用程序。Service Fabric can run any containers, and the scenario is similar to the guest executable scenario, where you package an existing application inside a container. 此外,也可在容器内运行 Service Fabric 服务In addition, you can run Service Fabric services inside containers as well.

来宾可执行文件:可以在 Azure Service Fabric 中运行任何类型的代码(如 Node.js、Java 或 C++)作为服务。Guest executables: You can run any type of code, such as Node.js, Java, or C++ in Azure Service Fabric as a service. Service Fabric 将这些类型的服务称为来宾可执行文件,视其为无状态服务。Service Fabric refers to these types of services as guest executables, which are treated as stateless services. 在 Service Fabric 群集中运行来宾可执行文件的优点包括高可用性、运行状况监视、应用程序生命周期管理、高密度和可发现性。The advantages to running a guest executable in a Service Fabric cluster include high availability, health monitoring, application lifecycle management, high density, and discoverability.

有关详细信息,请阅读为服务选择编程模型一文。Read the Choose a programming model for your service article for more information.

Docker ComposeDocker Compose

Docker Compose 是 Docker 项目的一部分。Docker Compose is part of the Docker project. Service Fabric 对使用 Docker Compose 模型部署应用程序提供有限支持。Service Fabric provides limited support for deploying applications using the Docker Compose model.

环境Environments

Service Fabric 是一种开放源平台技术,多种不同的服务和产品都以它为基础。Service Fabric is an open-source platform technology that several different services and products are based on. Microsoft 提供以下选项:Microsoft provides the following options:

  • Azure Service Fabric 网格:一种完全托管服务,用于在 Microsoft Azure 中运行 Service Fabric 应用程序。Azure Service Fabric Mesh: A fully managed service for running Service Fabric applications in Microsoft Azure.
  • Azure Service Fabric:Azure 托管的 Service Fabric 群集服务/产品。Azure Service Fabric: The Azure hosted Service Fabric cluster offering. 它提供 Service Fabric 和 Azure 基础结构之间的集成,以及 Service Fabric 群集的升级和配置管理。It provides integration between Service Fabric and the Azure infrastructure, along with upgrade and configuration management of Service Fabric clusters.
  • Service Fabric 独立:一组安装和配置工具,可在任何位置部署 Service Fabric 群集(在本地或任何云提供程序)。Service Fabric standalone: A set of installation and configuration tools to deploy Service Fabric clusters anywhere (on-premises or on any cloud provider). 不由 Azure 管理。Not managed by Azure.
  • Service Fabric 开发群集:在 Windows、Linux 或 Mac 上提供本地开发经验,用于开发 Service Fabric 应用程序。Service Fabric development cluster: Provides a local development experience on Windows, Linux, or Mac for development of Service Fabric applications.

环境、框架和部署模型支持矩阵Environment, framework, and deployment model support matrix

不同的环境对框架和部署模型提供不同级别的支持。Different environments have different level of support for frameworks and deployment models. 下表介绍了支持的框架和部署模型组合。The following table describes the supported framework and deployment model combinations.

应用程序类型Type of Application 介绍依据Described By Azure Service Fabric 网格Azure Service Fabric Mesh Azure Service Fabric 群集(任何 OS)Azure Service Fabric Clusters (any OS) 本地群集Local cluster 独立群集Standalone cluster
Service Fabric 网格应用程序Service Fabric Mesh Applications 资源模型(YAML 和 JSON)Resource Model (YAML & JSON) 支持Supported 不支持Not supported Windows - 支持,Linux 和 Mac - 不支持Windows- supported, Linux and Mac- not supported Windows - 不支持Windows- not supported
Service Fabric 本机应用程序Service Fabric Native Applications 本机应用程序模型 (XML)Native Application Model (XML) 不支持Not Supported 支持Supported 支持Supported Windows - 支持Windows- supported

下表介绍了不同的应用模型以及针对 Service Fabric 为它们提供的工具。The following table describes the different application models and the tooling that exists for them against Service Fabric.

应用程序类型Type of Application 介绍依据Described By Visual StudioVisual Studio EclipseEclipse SFCTLSFCTL AZ CLIAZ CLI PowershellPowershell
Service Fabric 网格应用程序Service Fabric Mesh Applications 资源模型(YAML 和 JSON)Resource Model (YAML & JSON) VS 2017VS 2017 不支持Not supported 不支持Not supported 支持 - 仅网格环境Supported - Mesh environment only 不支持Not Supported
Service Fabric 本机应用程序Service Fabric Native Applications 本机应用程序模型 (XML)Native Application Model (XML) VS 2017 和 VS 2015VS 2017 and VS 2015 支持Supported 支持Supported 支持Supported 支持Supported

后续步骤Next steps

了解有关 Service Fabric 的详细信息:To learn more about Service Fabric:

了解有关 Service Fabric 网格的详细信息:To learn more about Service Fabric Mesh: