共用方式為


Repair-ServiceFabricPartition

讓分割區脫離仲裁遺失。

語法

Repair-ServiceFabricPartition
      [-Force]
      [-PartitionId] <Guid>
      [-TimeoutSec <Int32>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Repair-ServiceFabricPartition
      [-Service]
      [-Force]
      -ServiceName <Uri>
      [-TimeoutSec <Int32>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Repair-ServiceFabricPartition
      [-All]
      [-Force]
      [-TimeoutSec <Int32>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Repair-ServiceFabricPartition
      [-System]
      [-Force]
      [-TimeoutSec <Int32>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Repair-ServiceFabricPartition Cmdlet 會強制將具狀態保存的數據分割從仲裁遺失中帶出。 如果具狀態保存分割區的大多數複本關閉,分割區就會進入仲裁遺失的狀態。 處於此狀態時,該分割區不允許寫入作業,而且無法重新設定數據分割。 此時的預期是讓複本恢復,讓分割區能夠繼續進行。 不過,如果複本無法備份,您可以執行此 Cmdlet,讓分割區無法遺失仲裁。 如果主要複本也關閉,則會針對數據分割宣告數據遺失。

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

範例

範例 1:修復所有分割區

PS C:\> Repair-ServiceFabricPartition -All

此命令會修復處於仲裁遺失狀態的所有分割區。

範例 2:修復分割區

PS C:\> Repair-ServiceFabricPartition -PartitionId 861907d2-1c38-4cf8-8bb4-49f4fec4a2e5

此命令會使用指定的分割區標識碼來修復分割區。

範例 3:修復服務的所有分割區

PS C:\> Repair-ServiceFabricPartition -Service -ServiceName fabric:/MyApp/MyPersistedService

此命令會修復 service fabric:/MyApp/MyPersistedService 的所有分割區。

範例 4:修復系統服務的數據分割

PS C:\> Repair-ServiceFabricPartition -System

此命令會修復所有系統服務的所有分割區。

參數

-All

表示此 Cmdlet 會修復仲裁遺失的所有分割區。

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

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

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

-Force

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

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

-PartitionId

指定 Service Fabric 數據分割的識別碼。 此 Cmdlet 只會修復此參數所指定的分割區。

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

-Service

表示此 Cmdlet 只會修復服務 ServiceName 參數指定的分割區。

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

-ServiceName

指定 Service Fabric 服務的統一資源識別碼(URI)。

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

-System

表示此 Cmdlet 會修復系統服務的所有分割區。

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

-TimeoutSec

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

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

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

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

輸入

System.Uri

System.Guid

輸出

System.Object