Move-​Service​Fabric​Primary​Replica

Moves the Service Fabric primary replica of a stateful service partition.

Syntax

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

Description

The Move-ServiceFabricPrimaryReplica cmdlet moves the Service Fabric primary replica of a stateful service partition from the current primary node to a specified node. You can also perform this operation on system services. You cannot use this cmdlet for stateless services.

The Move-ServiceFabricPrimaryReplica cmdlet moves the primary replica to a new Service Fabric node location after the command is accepted. However, the load balancer may move the primary 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 primary replica of a stateful service partition to a specified node

PS C:\> Move-ServiceFabricPrimaryReplica -PartitionId 93838f53-f1d9-4b99-8492-b802ee807d03 -NodeName "N0050" -ServiceName fabric:/SampleApp/SampleService

This command moves the primary replica of the specified stateful service partition to the node named N0050.

Example 2: Move the primary replica of a stateful service partition to a random node

PS C:\> Move-ServiceFabricPrimaryReplica -ServiceName fabric:/SampleApp/SampleService -PartitionId 93838f53-f1d9-4b99-8492-b802ee807d03

This command moves the primary replica of the specified stateful service partition to a random node because the NodeName parameter is not specified.

Example 3: Move the primary replica of a stateful service partition to a random node

PS C:\> Move-ServiceFabricPrimaryReplica -ServiceName fabric:/SampleApp1/PersistServ

This command moves the primary replica of the specified stateful service partition to a random node because the NodeName parameter is not specified. A random partition for the specified service is selected.

Required Parameters

-PartitionId

Specifies the ID of the partition to move.

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

Specifies the key of the partition to move.

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.

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

Indicates that this cmdlet moves a singleton partition.

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

-IgnoreConstraints

Indicates whether the cmdlet ignores constraints.

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

Specifies the name of a Service Fabric node. The cmdlet moves the primary replica to the node that you specify.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
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

Inputs

System.Uri

Inputs

string

Outputs

System.Object