cockroach node with the appropriate subcommands and flags.
The cockroach node command is also used to stop or remove nodes from the cluster. For details, see .
Subcommands
Synopsis
List the IDs of active and inactive nodes:Flags
Allnode subcommands support the following general-use and logging flags.
General
The
node ls subcommand also supports the following general flags:
The
node status subcommand also supports the following general flags:
The
node decommission subcommand also supports the following general flags. For more information, see cockroach node decommission --help.
The
node drain subcommand also supports the following general flags:
The
node recommission subcommand also supports the following general flag:
Client connection
The
node decommission, node recommission, and node drain subcommands also support the following client connection flags:
See for more details.
Logging
By default, this command logs messages tostderr. This includes events with WARNING and higher.
If you need to troubleshoot this command’s behavior, you can .
Response
Thecockroach node subcommands return the following fields for each node.
node ls
node status
node decommission
If the rebalancing stalls during decommissioning, replicas that have yet to move are printed to the and written to the with the message
possible decommission stall detected. , the OPS channel logs output to a cockroach.log file.
node recommission
Examples
Setup
To follow along with the examples, start , with defined.List node IDs
Show the status of a single node
Show the status of all nodes
Identify live nodes in an unavailable cluster
Theis_live and is_available columns give you information about a node’s current status:
is_live: The node is up and runningis_available: The node is part of the .
is_live: true and is_available: true can participate in the cluster. If either are false, check the logs so you can troubleshoot the node(s) in question.
For example, the following indicates a healthy cluster, where a majority of the nodes are up (is_live: true) and a quorum can be reached (is_available: true for live nodes):
is_live: false), and thereby quorum cannot be reached (is_available: false for all nodes):
node status command on a live node to identify the other live nodes in an unavailable cluster. Figuring out a live node to run the command is a trial-and-error process, so run the command against each node until you get one that responds.

