Stop-ServiceFabricNode

Stop-ServiceFabricNode

Stops a Service Fabric node.

Syntax

Parameter Set: Default
Stop-ServiceFabricNode [-NodeName] <String> [[-NodeInstanceId] <BigInteger]> ] [-CommandCompletionMode <CompletionMode]> ] [-TimeoutSec <Int32]> ] [ <CommonParameters>]




Detailed Description

The Stop-ServiceFabricNode cmdlet stops the node that you specify with the NodeName parameter by stopping the Fabric.exe process, which stops all of the system service and user service replicas hosted on that Service Fabric node. If the command succeeds the intent is recorded, but the node may not stop immediately.

Safety checks are not performed when using this cmdlet.

If you specify the NodeInstanceId parameter, only the node with that ID is stopped. If you specify a value for NodeInstanceId that does not match the active node, an error occurs.

Use this command to test the failover recovery paths by simulating stopped nodes in a cluster. Unlike the Restart-ServiceFabricNode cmdlet, Stop-ServiceFabricNode keeps the node stopped until you run the Start-ServiceFabricNode cmdlet to start the node. If you stop a node with the Stop-ServiceFabricNode cmdlet, you should only start the node with the Start-ServiceFabricNode cmdlet.

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

Parameters

-CommandCompletionMode<CompletionMode]>

Specifies whether the action waits for the restart to complete.


Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-NodeInstanceId<BigInteger]>

Specifies a node instance ID. Unless you specify 0, the node instance ID is matched against the current node before the node is stopped. The default value is 0.


Aliases

none

Required?

false

Position?

2

Default Value

none

Accept Pipeline Input?

true (ByPropertyName)

Accept Wildcard Characters?

false

-NodeName<String>

Specifies the name of a Service Fabric node. The cmdlet stops the node that you specify.


Aliases

none

Required?

true

Position?

1

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.

  • string

    Specifies the name of a Service Fabric node.


Outputs

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

  • System.Object

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


Examples

Example 1: Stop a node

This command stops the node named Node01 and does not wait for the restart to complete.


PS C:\> Stop-ServiceFabricNode -NodeName "Node01" -CommandCompletionMode DoNotVerify

Example 2: Stop a node by instance ID

This command stops the node named Node02 and with the node instance ID of 1234. If the value of the NodeInstanceID parameter does not match the node instance ID of the currently running node, an error occurs.


PS C:\> Stop-ServiceFabricNode -NodeName "Node02" –NodeInstanceId 1234 -CommandCompletionMode DoNotVerify

Related topics

Show: