2014-02-07 16:41:03 -08:00
|
|
|
---
|
2020-09-01 10:14:13 -05:00
|
|
|
layout: commands
|
2020-04-07 14:55:19 -04:00
|
|
|
page_title: 'Commands: Members'
|
|
|
|
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-07 16:41:03 -08:00
|
|
|
---
|
|
|
|
|
2014-02-18 17:32:13 -08:00
|
|
|
# Consul Members
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2014-02-18 17:32:13 -08:00
|
|
|
Command: `consul members`
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2022-01-11 08:26:58 -05:00
|
|
|
Corresponding HTTP API Endpoint: [\[GET\] /v1/agent/members](/api-docs/agent#list-members)
|
2022-01-10 12:40:11 -05:00
|
|
|
|
2014-10-19 19:40:10 -04:00
|
|
|
The `members` command outputs the current list of members that a Consul
|
2014-02-07 16:41:03 -08:00
|
|
|
agent knows about, along with their state. The state of a node can only
|
2014-02-18 17:32:13 -08:00
|
|
|
be "alive", "left", or "failed".
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2014-02-18 17:32:13 -08:00
|
|
|
Nodes in the "failed" state are still listed because Consul attempts to
|
2014-02-07 16:41:03 -08:00
|
|
|
reconnect with failed nodes for a certain amount of time in the case
|
|
|
|
that the failure is actually just a network partition.
|
|
|
|
|
2022-01-10 16:44:56 -05:00
|
|
|
The table below shows this command's [required ACLs](/api#authentication). Configuration of
|
2022-03-30 16:16:26 -05:00
|
|
|
[blocking queries](/api-docs/features/blocking) and [agent caching](/api-docs/features/caching)
|
2022-01-10 16:44:56 -05:00
|
|
|
are not supported from commands, but may be from the corresponding HTTP endpoint.
|
|
|
|
|
|
|
|
| ACL Required |
|
|
|
|
| ------------ |
|
|
|
|
| `node:read` |
|
|
|
|
|
2014-02-07 16:41:03 -08:00
|
|
|
## Usage
|
|
|
|
|
2014-02-18 17:32:13 -08:00
|
|
|
Usage: `consul members [options]`
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2017-02-09 17:12:47 -05:00
|
|
|
#### Command Options
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2020-04-07 14:55:19 -04:00
|
|
|
- `-detailed` - If provided, output shows more detailed information
|
2014-06-06 16:00:02 -07:00
|
|
|
about each node.
|
2014-02-07 16:41:03 -08:00
|
|
|
|
2020-04-23 15:13:18 -07:00
|
|
|
- `-segment` <EnterpriseAlert inline /> - The segment to show members in. If not provided, members
|
2017-08-31 11:19:08 -07:00
|
|
|
in all segments visible to the agent will be listed.
|
|
|
|
|
2020-04-07 14:55:19 -04:00
|
|
|
- `-status` - If provided, output is filtered to only nodes matching
|
2014-02-07 16:41:03 -08:00
|
|
|
the regular expression for status
|
|
|
|
|
2020-04-07 14:55:19 -04:00
|
|
|
- `-wan` - For agents in Server mode, this will return the list of nodes
|
2014-02-18 17:32:13 -08:00
|
|
|
in the WAN gossip pool. These are generally all the server nodes in
|
|
|
|
each datacenter.
|
2022-07-26 23:17:11 -07:00
|
|
|
|
|
|
|
#### Enterprise Options
|
|
|
|
|
|
|
|
@include 'http_api_partition_options.mdx'
|
|
|
|
|
|
|
|
#### API Options
|
|
|
|
|
|
|
|
@include 'http_api_options_client.mdx'
|