Start-ServiceFabricNodeTransition
起始啟動或停止 Service Fabric 叢集節點的作業。
Syntax
Start-ServiceFabricNodeTransition
[-Stop]
-OperationId <Guid>
-NodeName <String>
-NodeInstanceId <BigInteger>
-StopDurationInSeconds <Int32>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Start-ServiceFabricNodeTransition
[-Start]
-OperationId <Guid>
-NodeName <String>
-NodeInstanceId <BigInteger>
[-TimeoutSec <Int32>]
[<CommonParameters>]
Description
Start-ServiceFabricNodeTransition Cmdlet 會起始非同步作業,以啟動或停止 Service Fabric 叢集節點。
指定 Stop 參數會將 Service Fabric 叢集節點置於停止狀態。 節點是進程,而不是虛擬機器或電腦。 虛擬機器或電腦會在節點停止之後繼續執行。 處於停止狀態,節點不是叢集的成員,而且無法裝載服務。 停止的節點會模擬已關閉或離線的節點。
指定 Start 參數會啟動已停止的節點。
當此 Cmdlet 成功傳回時,系統已接受此作業。 不過,這並不表示作業已完成。 若要取得作業目前狀態的相關資訊,請執行 Get-ServiceFabricNodeTransitionProgress Cmdlet。
Start-ServiceFabricNodeTransition Cmdlet 優先于Start-ServiceFabricNode和Stop-ServiceFabricNode Cmdlet,這些 Cmdlet 已過時。 請避免將此 Cmdlet 與 Start-ServiceFabricNode 和 Stop-ServiceFabricNode混用。 如果已使用 Stop-ServiceFabricNode停止節點,請先使用 Start-ServiceFabricNode 啟動 它,再使用 Start-ServiceFabricNodeTransition。 接著,使用 Start-ServiceFabricNodeTransition 。
如需詳細資訊,請參閱 以節點轉換 API 取代啟動節點和停止節點 API。
範例
範例 1:停止 Service Fabric 節點
PS C:\> Start-ServiceFabricNodeTransition -Stop -OperationId 097b03e3-760a-419c-9fce-e83f8cc0894b -NodeName N0050 -NodeInstanceId 131242467532403195 -StopDurationInSeconds 3600
此命令會起始作業,以停止 Service Fabric 節點一小時。 在一小時後,節點會自動啟動本身。 追蹤 OperationId 值。 您可以使用它來執行 Get-ServiceFabricNodeTransitionProgress。
範例 2:啟動 Service Fabric 節點
PS C:\> Start-ServiceFabricNodeTransition -Start -OperationId 6d1bf9a1-9733-4d83-be59-0acea3be57a7 -NodeName N0050 -NodeInstanceId 131242467532403195
此命令會起始作業,以啟動已停止的 Service Fabric 節點。
參數
-NodeInstanceId
指定這個 Cmdlet 啟動或停止之節點實例的識別碼。
若要取得節點實例識別碼,請針對目標節點執行 Get-ServiceFabricNode 。
例如,針對節點 N0050,命令 Get-ServiceFabricNode -NodeName "N0050"
會傳回包含節點實例識別碼的 Node 物件。
Type: | BigInteger |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-NodeName
指定此 Cmdlet 啟動或停止的 Service Fabric 節點名稱。 若要取得叢集中的 Service Fabric 節點,請執行 Get-ServiceFabricNode Cmdlet。
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-OperationId
指定識別作業的唯一識別碼。 針對起始作業的這個 Cmdlet 使用相同的值,以及取得作業進度 的 Get-ServiceFabricNodeTransitionProgress。
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Start
表示此 Cmdlet 會啟動已停止的節點。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-Stop
表示此 Cmdlet 會停止執行中的節點。
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-StopDurationInSeconds
指定持續時間,以秒為單位,讓停止的節點在作業完成之後停止。 此時,節點會自動啟動。
最小值為 600。 最大值為 14400。
您必須指定 Stop 參數,才能指定停止持續時間。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TimeoutSec
指定此 Cmdlet 的逾時值,以秒為單位。
這不是停止節點維持停止的時間長度。 若要控制節點停止的時間長度,請使用 StopDurationInSeconds 參數。
Type: | Int32 |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
輸入
None
輸出
System.Object