Move-​Service​Fabric​Secondary​Replica

Moves the Service Fabric secondary replica of a stateful service.

Syntax

Move-ServiceFabricSecondaryReplica
    [-CurrentSecondaryNodeName <String>]
    [-IgnoreConstraints <Boolean>]
    [-NewSecondaryNodeName <String>]
    -PartitionId <Guid>
    -ServiceName <Uri>
    [-TimeoutSec <Int32>]
    [<CommonParameters>]
Move-ServiceFabricSecondaryReplica
    [-CurrentSecondaryNodeName <String>]
    [-IgnoreConstraints <Boolean>]
    [-NewSecondaryNodeName <String>]
    -PartitionKey <String>
    [-PartitionKindNamed]
    -ServiceName <Uri>
    [-TimeoutSec <Int32>]
    [<CommonParameters>]
Move-ServiceFabricSecondaryReplica
    [-CurrentSecondaryNodeName <String>]
    [-IgnoreConstraints <Boolean>]
    [-NewSecondaryNodeName <String>]
    -PartitionKey <String>
    [-PartitionKindUniformInt64]
    -ServiceName <Uri>
    [-TimeoutSec <Int32>]
    [<CommonParameters>]
Move-ServiceFabricSecondaryReplica
    [-CurrentSecondaryNodeName <String>]
    [-IgnoreConstraints <Boolean>]
    [-NewSecondaryNodeName <String>]
    [-PartitionKindSingleton]
    -ServiceName <Uri>
    [-TimeoutSec <Int32>]
    [<CommonParameters>]

Description

The Move-ServiceFabricSecondaryReplica cmdlet moves the Service Fabric stateful service active secondary replica from the current active secondary node to a specified node location. You can also perform this operation on system services. You cannot use this cmdlet for stateless services.

The Move-ServiceFabricSecondaryReplica cmdlet moves the secondary replica to a new Service Fabric node location after the command is accepted. However, the load balancer may move the secondary replica again based on load balancer constraints or on the load balancer balancing algorithm.

To use this cmdlet, you must be a member of the Administrators group.

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

Examples

Example 1: Move the secondary replica of a stateful service by node name

PS C:\> Move-ServiceFabricSecondaryReplica -CurrentSecondaryNodeName "N0020" -NewSecondaryNodeName "N0010" -PartitionId 93838f53-f1d9-4b99-8492-b802ee807d03 -ServiceName fabric:/SampleApp/SampleService

This command moves the specified secondary replica from node N0020 to node N0010 for the specified partition that belongs to the service named fabric:/SampleApp/SampleService.

Example 2: Move a random secondary replica of a stateful service by service name to a new node

PS C:\> Move-ServiceFabricSecondaryReplica -ServiceName fabric:/myApp/MyPersistedService

This command moves a random secondary replica to a new node. A random partition is selected for the specified service.

Required Parameters

-PartitionId

Specifies the ID of the partition for which the replica is moved.

Type:Guid
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PartitionKey

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

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-PartitionKindNamed

Indicates that this cmdlet moves a named partition service.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartitionKindSingleton

Indicates that this cmdlet moves a singleton partitioned service.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-PartitionKindUniformInt64

Indicates that this cmdlet moves a UniformInt64 partitioned service.

Type:SwitchParameter
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-ServiceName

Specifies the service name of the replica to move.

Type:Uri
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-CurrentSecondaryNodeName

Specifies the current node name for the secondary node.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-IgnoreConstraints

Indicates whether the cmdlet ignores constraints.

Type:Boolean
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-NewSecondaryNodeName

Specifies the new node name for the secondary node.

Type:String
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False
-TimeoutSec

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

Type:Int32
Position:Named
Default value:None
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.Guid

Represents the ID of a Service Fabric partition.

Inputs

System.Uri

Represents the name of a Service Fabric service.

Outputs

System.Object

This cmdlet returns a System.Fabric.Testability.MoveSecondaryResult object that represents the operation result.