Skip to main content
To view details for each node in the cluster, use the 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:
Show status details for active and inactive nodes:
Show status and range/replica details for active and inactive nodes:
Show status and disk usage details for active and inactive nodes:
Show status and decommissioning details for active and inactive nodes:
Show complete status details for active and inactive nodes:
Show status details for a specific node:
Decommission nodes:
Recommission nodes:
Drain nodes:
View help:

Flags

All node 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 to stderr. This includes events with WARNING and higher. If you need to troubleshoot this command’s behavior, you can .

Response

The cockroach 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

The is_live and is_available columns give you information about a node’s current status:
  • is_live: The node is up and running
  • is_available: The node is part of the .
Only nodes that are both 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):
The following indicates an unhealthy cluster, where a majority of nodes are down (is_live: false), and thereby quorum cannot be reached (is_available: false for all nodes):
You need to run the 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.

Drain nodes

See .

Decommission nodes

See .

Recommission nodes

See .

See also