共用方式為


New-ServiceFabricServiceGroupFromTemplate

從服務範本建立 Service Fabric 服務群組。

語法

New-ServiceFabricServiceGroupFromTemplate
   [-ApplicationName] <Uri>
   [-ServiceName] <Uri>
   [-ServiceTypeName] <String>
   [-Force]
   [-ServicePackageActivationMode <ServicePackageActivationMode>]
   [-TimeoutSec <Int32>]
   [<CommonParameters>]

Description

New-ServiceFabricServiceGroupFromTemplate Cmdlet 會從應用程式指令清單中定義的服務範本建立 Service Fabric 服務群組。

在 Service Fabric 叢集上執行任何作業之前,請使用 Connect-ServiceFabricCluster Cmdlet 來建立叢集的連線。

範例

範例 1:從服務群組範本建立服務群組

PS C:\> New-ServiceFabricServiceGroupFromTemplate -ApplicationName fabric:/myapp/persistenttodolist -ServiceName fabric:/myapp/persistenttodolist/svc4 -ServiceTypeName "PersistentToDoListServiceGroupType"

此命令會建立 Service Fabric 服務群組,此服務群組會針對 PersistentToDoListServiceTypeService Type 使用服務範本。 此類型定義於 fabric:/myapp/persistenttodolist Service Fabric 應用程式的應用程式指令清單中。

參數

-ApplicationName

指定 Service Fabric 應用程式的統一資源識別碼(URI)。 Cmdlet 會根據具有您指定 URI 的應用程式來建立服務群組。

類型:Uri
Position:0
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Force

強制命令執行,而不要求使用者確認。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ServiceName

指定 Service Fabric 服務群組的 URI。

類型:Uri
Position:1
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ServicePackageActivationMode

控制要用於服務的 [裝載模型][1]。 有效值為 SharedProcessExclusiveProcess。 預設值為 SharedProcess

使用 SharedProcess 啟用模式時,指定 ServiceType 之 不同服務的複本(或實例)將會共用相同的 serviceHost serviceHost。 使用 ExclusiveProcess 啟用模式,服務的每個復本或實例都會有自己的專用 ServiceHost。 如需詳細資訊,請參閱 [Service Fabric 裝載模型][1]。

類型:ServicePackageActivationMode
接受的值:SharedProcess, ExclusiveProcess
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ServiceTypeName

指定 Service Fabric 服務群組類型的名稱。

類型:String
Position:2
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-TimeoutSec

指定作業的逾時期間,以秒為單位。

類型:Int32
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

None

輸出

System.Object