New-AzServiceFabricManagedClusterService
在指定的應用程式和叢集下建立新的 Service Fabric 受控服務。
語法
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-MinInstanceCount <Int32>]
[-MinInstancePercentage <Int32>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeSingleton]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-MinInstanceCount <Int32>]
[-MinInstancePercentage <Int32>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeUniformInt64]
-PartitionCount <Int32>
-LowKey <Int64>
-HighKey <Int64>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-MinInstanceCount <Int32>]
[-MinInstancePercentage <Int32>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeNamed]
-PartitionName <String[]>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-HasPersistedState]
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-ServicePlacementTimeLimit <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeSingleton]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-HasPersistedState]
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-ServicePlacementTimeLimit <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeUniformInt64]
-PartitionCount <Int32>
-LowKey <Int64>
-HighKey <Int64>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricManagedClusterService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-HasPersistedState]
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-ServicePlacementTimeLimit <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PlacementConstraint <String>]
[-Metric <PSServiceMetric[]>]
[-Correlation <PSServiceCorrelation[]>]
[-ServicePackageActivationMode <ServicePackageActivationModeEnum>]
[-Tag <Hashtable>]
[-Force]
[-AsJob]
[-PartitionSchemeNamed]
-PartitionName <String[]>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
此 Cmdlet 允許在指定的應用程式下建立無狀態或具狀態的受控服務。 服務應該會在應用程式指令清單中結束,而且類型應該與指令清單中的類型相同。 應用程式名稱應該是服務名稱的前置詞。
範例
範例 1
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testService1"
$serviceTypeName = "testStateless"
$statelessServiceMetric = New-Object -TypeName "Microsoft.Azure.Commands.ServiceFabric.Models.PSServiceMetric" -ArgumentList @("metric1", "Low", 4)
New-AzServiceFabricManagedClusterService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateless -InstanceCount -1 -PartitionSchemeSingleton -Metric @($statelessServiceMetric) -Verbose
此範例會建立新的無狀態受控服務 「testService1」,並將實例計數 -1(在所有節點上)。
範例 2
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testService2"
$serviceTypeName = "testStatefulType"
$partitionCount = 5
$partitionLowKey = 0
$partitionHighKey = 25
$statefulServiceMetric = New-Object -TypeName "Microsoft.Azure.Commands.ServiceFabric.Models.PSServiceMetric" -ArgumentList @("metric2", "Medium", 4, 2)
New-AzServiceFabricManagedClusterService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateful -TargetReplicaSetSize 5 -MinReplicaSetSize 3 -Metric @($statefulServiceMetric) -PartitionSchemeUniformInt64 -PartitionCount $partitionCount -LowKey $partitionLowKey -HighKey $partitionHighKey -Verbose
此範例會建立新的具狀態受控服務 「testService2」,且目標為 5 個節點。
範例 3
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testService3"
$serviceName2 = "testService2"
$serviceTypeName = "testStateless"
$statefulService = Get-AzServiceFabricManagedClusterService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName2
$statefulServiceCorrelation = New-Object -TypeName "Microsoft.Azure.Commands.ServiceFabric.Models.PSServiceCorrelation" -ArgumentList @("AlignedAffinity", $statefulService.Id)
New-AzServiceFabricManagedClusterService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateless -InstanceCount 3 -PartitionSchemeSingleton -Correlation @($statefulServiceCorrelation) -Verbose
此範例會建立新的無狀態受控服務 「testService3」。
參數
-ApplicationName
指定受控應用程式的名稱。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-AsJob
在背景執行 Cmdlet,並傳回作業以追蹤進度。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ClusterName
指定叢集的名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Correlation
將受控服務的位置條件約束指定為字串。
類型: | PSServiceCorrelation[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultMoveCost
指定行動的預設成本。 較高的成本使得叢集資源管理員在嘗試平衡叢集時移動復本的可能性較低
類型: | MoveCostEnum |
接受的值: | Zero, Low, Medium, High |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DefaultProfile
用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。
類型: | IAzureContextContainer |
別名: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Force
在沒有提示的情況下繼續
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-HasPersistedState
指定受控服務的目標副本集大小
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-HighKey
指定分割區索引鍵範圍的上限。
類型: | Int64 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-InstanceCount
指定受控服務的實例計數
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-LowKey
指定分割區索引鍵範圍的下限。
類型: | Int64 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Metric
將受控服務的位置條件約束指定為字串。
類型: | PSServiceMetric[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-MinInstanceCount
指定受控服務的最小實例計數
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-MinInstancePercentage
指定受控服務的最小實例百分比
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-MinReplicaSetSize
指定受控服務的最小副本集大小
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
指定受控服務的名稱。
類型: | String |
別名: | ServiceName |
Position: | 3 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PartitionCount
指定分割區數目。
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PartitionName
表示服務使用具名分割區配置。 使用此模型的服務通常會在限定集合內有可貯體化的數據。 作為具名數據分割索引鍵的一些常見數據欄位範例是區域、郵遞區編碼、客戶群組或其他商業界限。
類型: | String[] |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PartitionSchemeNamed
表示服務使用具名分割區配置。 使用此模型的服務通常會在限定集合內有可貯體化的數據。 作為具名數據分割索引鍵的一些常見數據欄位範例是區域、郵遞區編碼、客戶群組或其他商業界限。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PartitionSchemeSingleton
表示服務使用單一數據分割配置。 當服務不需要任何其他路由時,通常會使用單一分割區。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PartitionSchemeUniformInt64
表示服務使用 UniformInt64 分割區配置。 這表示每個分割區擁有一系列 int64 索引鍵。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-PlacementConstraint
將受控服務的位置條件約束指定為字串。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-QuorumLossWaitDuration
指定受控服務的仲裁遺失等候持續時間。 以 ISO 8601 格式 'hh:mm:ss' 表示的持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ReplicaRestartWaitDuration
指定受控服務的複本重新啟動等候持續時間。 以 ISO 8601 格式 'hh:mm:ss' 表示的持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
指定資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-ServicePackageActivationMode
指定行動的預設成本。 較高的成本使得叢集資源管理員在嘗試平衡叢集時移動復本的可能性較低
類型: | ServicePackageActivationModeEnum |
接受的值: | SharedProcess, ExclusiveProcess |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ServicePlacementTimeLimit
指定受控服務的服務放置時間限制。 以 ISO 8601 格式 'hh:mm:ss' 表示的持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-StandByReplicaKeepDuration
指定受控服務的待用複本持續時間。 以 ISO 8601 格式 'hh:mm:ss' 表示的持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Stateful
用於具狀態服務
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Stateless
用於無狀態服務
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Tag
將標記指定為索引鍵/值組。
類型: | Hashtable |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | True |
接受萬用字元: | False |
-TargetReplicaSetSize
指定受控服務的目標副本集大小
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Type
指定受控應用程式的服務類型名稱,應該存在於應用程式指令清單中。
類型: | String |
別名: | ServiceType |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |