2014-02-08 00:41:03 +00:00
|
|
|
---
|
2020-09-01 15:14:13 +00:00
|
|
|
layout: commands
|
2020-04-07 18:55:19 +00:00
|
|
|
page_title: 'Commands: Members'
|
2020-04-13 18:40:26 +00:00
|
|
|
sidebar_title: members
|
2020-04-07 18:55:19 +00:00
|
|
|
description: >-
|
|
|
|
The `members` command outputs the current list of members that a Consul agent
|
|
|
|
knows about, along with their state. The state of a node can only be alive,
|
|
|
|
left, or failed.
|
2014-02-08 00:41:03 +00:00
|
|
|
---
|
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
# Consul Members
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
Command: `consul members`
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-10-19 23:40:10 +00:00
|
|
|
The `members` command outputs the current list of members that a Consul
|
2014-02-08 00:41:03 +00:00
|
|
|
agent knows about, along with their state. The state of a node can only
|
2014-02-19 01:32:13 +00:00
|
|
|
be "alive", "left", or "failed".
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
Nodes in the "failed" state are still listed because Consul attempts to
|
2014-02-08 00:41:03 +00:00
|
|
|
reconnect with failed nodes for a certain amount of time in the case
|
|
|
|
that the failure is actually just a network partition.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2014-02-19 01:32:13 +00:00
|
|
|
Usage: `consul members [options]`
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2017-02-09 22:12:47 +00:00
|
|
|
#### API Options
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
@include 'http_api_options_client.mdx'
|
2017-02-09 22:12:47 +00:00
|
|
|
|
|
|
|
#### Command Options
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-detailed` - If provided, output shows more detailed information
|
2014-06-06 23:00:02 +00:00
|
|
|
about each node.
|
2014-02-08 00:41:03 +00:00
|
|
|
|
2020-04-23 22:13:18 +00:00
|
|
|
- `-segment` <EnterpriseAlert inline /> - The segment to show members in. If not provided, members
|
2017-08-31 18:19:08 +00:00
|
|
|
in all segments visible to the agent will be listed.
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-status` - If provided, output is filtered to only nodes matching
|
2014-02-08 00:41:03 +00:00
|
|
|
the regular expression for status
|
|
|
|
|
2020-04-07 18:55:19 +00:00
|
|
|
- `-wan` - For agents in Server mode, this will return the list of nodes
|
2014-02-19 01:32:13 +00:00
|
|
|
in the WAN gossip pool. These are generally all the server nodes in
|
|
|
|
each datacenter.
|