Remove-ServiceFabricNodeState

Notifies Service Fabric that the state on a node has been removed by an external mechanism.

Syntax

Remove-ServiceFabricNodeState
      [-NodeName] <String>
      [-Force]
      [-TimeoutSec <Int32>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

The Remove-ServiceFabricNodeState cmdlet notifies Service Fabric that for a particular node in a cluster which is down, that any services or state on that node are lost and unrecoverable, and because of that, it has been removed. For instance, this can happen if a hard disk crashes. This command is also useful for downscaling without automatic node removal.

For stateful services, Service Fabric will wait for state and services on a down node to be recovered. In some cases, the administrator knows that a node (and its state) has been permanently lost. In these cases, this operation should be called in order to get Service Fabric to stop waiting for that node to recover.

Warning: Do not run this cmdlet if the node is expected to come back up with its state intact.

The process to remove a node consists of deactivating the node, removing node configurations, and then, finally, removing the node state. In the case of a crash, the first two steps have already happened.

To manage Service Fabric clusters, start Windows PowerShell by using the Run as administrator option.

Before you perform any operation on a Service Fabric cluster, establish a connection to the cluster by using the Connect-ServiceFabricCluster cmdlet.

Note: Starting from Service Fabric 6.5, in order to use this cmdlet for seed nodes, please change the seed nodes to regular (non-seed) nodes and then invoke this cmdlet to remove the node state. If the cluster is running on Azure, after the seed node goes down, Service Fabric will try to change it to a non-seed node automatically. To make this happen, make sure the number of non-seed nodes in the primary node type is no less than the number of Down seed nodes. If necessary, add more nodes to the primary node type to achieve this. For standalone cluster, if the Down seed node is not expected to come back up with its state intact, please remove the node from the cluster, see remove nodes from Service Fabric standalone cluster

Examples

Example 1: Inform Service Fabric about node state removal

PS C:\> Remove-ServiceFabricNodeState -NodeName "DB.41"

This command informs Service Fabric that node state for DB.41 has been removed.

Example 2: Inform Service Fabric about node state removal with options

PS C:\> Remove-ServiceFabricNodeState -NodeName "DB.41" -Confirm

This command ensures that a confirmation window specific to this operation pops up when run.

Parameters

-Confirm

Prompts you for confirmation before running the cmdlet. By default, PowerShell asks for confirmation before running this operation. This switch adds an additional confirmation. Do not select "Force" if selecting this switch parameter.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation. Do not select "Confirm" if selecting this switch parameter.

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

-NodeName

Specifies the name of a Service Fabric node. The cmdlet removes the node state for the node that you specify.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-TimeoutSec

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

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

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not actually run. This is a PowerShell standard parameter. Selecting this option does not check for the success or result of this operation.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

System.String

Outputs

System.Object