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 Mesh 的協調器。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). 節點具有各種特性,如 placement 屬性。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 Mesh 應用程式:Service Fabric Mesh 應用程式是由資源模型 (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 Mesh 中執行。Service Fabric Native Applications cannot run in Service Fabric Mesh.

Service Fabric Mesh 應用程式概念Service Fabric Mesh Application concepts

應用程式:應用程式是 Mesh 應用程式的部署、版本設定及存留期的單位。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 Database 或 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. 通常,無狀態具名服務只會有 1 個分割,因為它們有沒有內部狀態。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 ServicesRead 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. 您可以管理服務名稱與屬性,類似叢集的網際網路網域名稱系統 (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 適用於:Repair manager is used in:

部署和應用程式模型Deployment and application models

若要部署您的服務,需要說明服務的執行方式。To deploy your services, you need to describe how they should run. Service Fabric 支援三種不同的部署模型: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 Mesh,會使用 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 Mesh 環境中不支援原生模型。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:可透過虛擬的 Actor 程式設計模型建置無狀態和具狀態物件的 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 支援將 Docker 容器部署至 Linux,也支援將 Windows Server 容器部署至 Windows Server 2016,並支援 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 中執行任何類型的程式碼, 例如 node.js、Python、JAVA 或C++ , Service Fabric 即服務。Guest executables: You can run any type of code, such as Node.js, Python, 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 Mesh:一個受到完整管理的服務,可用來在 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 MeshAzure Service Fabric Mesh Azure Service Fabric 叢集 (任何 OS)Azure Service Fabric Clusters (any OS) 本機叢集Local cluster 獨立叢集Standalone cluster
Service Fabric Mesh 應用程式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 Mesh 應用程式Service Fabric Mesh Applications 資源模型 (YAML & JSON)Resource Model (YAML & JSON) VS 2017VS 2017 不支援Not supported 不支援Not supported 支援 - 僅限 Mesh 環境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 Mesh:To learn more about Service Fabric Mesh: