Restart-ServiceFabricReplica

Restart-ServiceFabricReplica

Restarts a Service Fabric replica.

Syntax

Parameter Set: ByNodeName
Restart-ServiceFabricReplica [-NodeName] <String> [-PartitionId] <Guid> [-ReplicaOrInstanceId] <Int64]> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: PartitionId
Restart-ServiceFabricReplica -PartitionId <Guid> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: PartitionIdReplicaId
Restart-ServiceFabricReplica -PartitionId <Guid> -ReplicaOrInstanceId <Int64]> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: PartitionIdReplicaPrimary
Restart-ServiceFabricReplica -PartitionId <Guid> -ReplicaKindPrimary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: PartitionIdReplicaRandomSecondary
Restart-ServiceFabricReplica -PartitionId <Guid> -ReplicaKindRandomSecondary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceName
Restart-ServiceFabricReplica -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionNamed
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindNamed -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionNamedReplicaId
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindNamed -ReplicaOrInstanceId <Int64]> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionNamedReplicaPrimary
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindNamed -ReplicaKindPrimary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionNamedReplicaRandomSecondary
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindNamed -ReplicaKindRandomSecondary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionSingleton
Restart-ServiceFabricReplica -PartitionKindSingleton -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionSingletonReplicaId
Restart-ServiceFabricReplica -PartitionKindSingleton -ReplicaOrInstanceId <Int64]> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionSingletonReplicaPrimary
Restart-ServiceFabricReplica -PartitionKindSingleton -ReplicaKindPrimary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionSingletonReplicaRandomSecondary
Restart-ServiceFabricReplica -PartitionKindSingleton -ReplicaKindRandomSecondary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionUniformedInt
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindUniformInt64 -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionUniformedIntReplicaId
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindUniformInt64 -ReplicaOrInstanceId <Int64]> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionUniformedIntReplicaPrimary
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindUniformInt64 -ReplicaKindPrimary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNamePartitionUniformedIntReplicaRandomSecondary
Restart-ServiceFabricReplica -PartitionKey <System.String> -PartitionKindUniformInt64 -ReplicaKindRandomSecondary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNameReplicaId
Restart-ServiceFabricReplica -ReplicaOrInstanceId <Int64]> -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]

Parameter Set: ServiceNameReplicaPrimary
Restart-ServiceFabricReplica -ReplicaKindPrimary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]

Parameter Set: ServiceNameReplicaRandomSecondary
Restart-ServiceFabricReplica -ReplicaKindRandomSecondary -ServiceName <System.Uri> [-CommandCompletionMode <Nullable [System.Fabric.Testability.CompletionMode]> ] [ <CommonParameters>]




Detailed Description

The Restart-ServiceFabricReplica cmdlet simulates a service replica failure by restarting a persisted service replica, closing the replica, and then reopening it. Use this cmdlet to test your service for problems along the replica reopen path. This cmdlet helps simulate the report fault temporary path through client APIs. This cmdlet is only valid for replicas that belong to stateful persisted services.

Before using this cmdlet, connect to the Service Fabric cluster.

Parameters

-CommandCompletionMode<Nullable [System.Fabric.Testability.CompletionMode]>

Specifies whether the action waits for the Restart operation to complete.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NodeName<String>

Specifies the name of a Service Fabric node. The cmdlet restarts a replica deployed on the node that you specify.


Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionId<Guid>

Specifies the ID of the partition for which to restart the replica.


Aliases

none

Required?

true

Position?

2

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKey<System.String>

Specifies the key of the partition for which the replica is restarted.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKindNamed

Indicates that this cmdlet restarts a replica on a named partition.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKindSingleton

Indicates that this cmdlet restarts a replica on a singleton partition.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-PartitionKindUniformInt64

Indicates that this cmdlet restarts a replica on a UniformInt64 partition.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ReplicaKindPrimary

Indicates that this cmdlet restarts the replica for the primary replica.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ReplicaKindRandomSecondary

Indicates that this cmdlet restarts a replica for a random secondary replica.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ReplicaOrInstanceId<Int64]>

Specifies a Service Fabric service replica or instance ID.


Aliases

none

Required?

true

Position?

3

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-ServiceName<System.Uri>

Specifies the name of a Service Fabric service.


Aliases

none

Required?

true

Position?

named

Default Value

none

Accept Pipeline Input?

true(ByPropertyName)

Accept Wildcard Characters?

false

-TimeoutSec<Int32]>

Specifies the time-out period, in seconds, for the operation.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see    about_CommonParameters.

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • System.Uri

    Represents the name of a Service Fabric service.


  • System.Guid

    Represents the ID of a Service Fabric partition.


  • string

    Specifies the name of a Service Fabric node.


Outputs

The output type is the type of the objects that the cmdlet emits.

Examples

Example 1: Restart a replica

This command restarts the replica on Node07 on the specified partition.


PS C:\> Restart-ServiceFabricReplica -NodeName "Node07" -PartitionId 869dd2e9-fdda-42a5-ad96-4b71c795dfd3 -ReplicaOrInstanceId 12345098480948

Example 2: Restart a primary replica

This command restarts a primary replica on the specified partition.


PS C:\> Restart-ServiceFabricReplica -ReplicaKindPrimary –PartitionKindNamed -PartitionKey "Partition1" –ServiceName fabric:/App/Service

Related topics

Show: