New-AzServiceFabricService
在指定的應用程式和叢集下建立新的 Service Fabric 服務。
語法
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeSingleton]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeUniformInt64]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateless]
-InstanceCount <Int32>
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeNamed]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeSingleton]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeUniformInt64]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
New-AzServiceFabricService
[-ResourceGroupName] <String>
[-ClusterName] <String>
[-ApplicationName] <String>
[-Name] <String>
-Type <String>
[-Stateful]
-TargetReplicaSetSize <Int32>
-MinReplicaSetSize <Int32>
[-ReplicaRestartWaitDuration <TimeSpan>]
[-QuorumLossWaitDuration <TimeSpan>]
[-StandByReplicaKeepDuration <TimeSpan>]
[-DefaultMoveCost <MoveCostEnum>]
[-PartitionSchemeNamed]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
此 Cmdlet 允許在指定的應用程式下建立無狀態或具狀態服務。 服務應該會在應用程式指令清單中結束,而且類型應該與指令清單中的類型相同。 應用程式名稱應該是服務名稱的前置詞。
範例
範例 1
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testApp~testService1"
$serviceTypeName = "testStateless"
New-AzServiceFabricService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateless -InstanceCount -1 -PartitionSchemeSingleton -Verbose
此範例會建立新的無狀態服務 「testApp~testService1」。,並將實例計數 -1(在所有節點上)。
範例 2
$resourceGroupName = "testRG"
$clusterName = "testCluster"
$appName = "testApp"
$serviceName = "testApp~testService2"
$serviceTypeName = "testStatefulType"
New-AzServiceFabricService -ResourceGroupName $resourceGroupName -ClusterName $clusterName -ApplicationName $appName -Name $serviceName -Type $serviceTypeName -Stateful -TargetReplicaSetSize 3 -MinReplicaSetSize 5
此範例會建立新的具狀態服務 「testApp~testService2」,且目標為 5 個節點。
參數
-ApplicationName
指定應用程式的名稱。
類型: | String |
Position: | 2 |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ClusterName
指定叢集的名稱。
類型: | String |
Position: | 1 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Confirm
在執行 Cmdlet 之前,提示您進行確認。
類型: | SwitchParameter |
別名: | cf |
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 |
-InstanceCount
指定服務的實例計數
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-MinReplicaSetSize
指定服務的最小副本集大小
類型: | Int32 |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
指定服務的名稱。
類型: | String |
別名: | ServiceName |
Position: | 3 |
預設值: | 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 |
-QuorumLossWaitDuration
指定服務的仲裁遺失等候持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ReplicaRestartWaitDuration
指定服務的複本重新啟動等候持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
指定資源群組的名稱。
類型: | String |
Position: | 0 |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-StandByReplicaKeepDuration
指定服務的待用復本持續時間
類型: | TimeSpan |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Stateful
用於具狀態服務
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Stateless
用於無狀態服務
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | 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 |