2014-02-08 00:41:03 +00:00
---
layout: "docs"
page_title: "Commands: Join"
sidebar_current: "docs-commands-join"
2014-10-19 23:40:10 +00:00
description: |-
The `join` command tells a Consul agent to join an existing cluster. A new Consul agent must join with at least one existing member of a cluster in order to join an existing cluster. After joining that one member, the gossip layer takes over, propagating the updated membership state across the cluster.
2014-02-08 00:41:03 +00:00
---
2014-02-19 01:32:13 +00:00
# Consul Join
2014-02-08 00:41:03 +00:00
2014-02-19 01:32:13 +00:00
Command: `consul join`
2014-02-08 00:41:03 +00:00
2014-10-19 23:40:10 +00:00
The `join` command tells a Consul agent to join an existing cluster.
2014-02-19 01:32:13 +00:00
A new Consul agent must join with at least one existing member of a cluster
2014-02-08 00:41:03 +00:00
in order to join an existing cluster. After joining that one member,
the gossip layer takes over, propagating the updated membership state across
the cluster.
If you don't join an existing cluster, then that agent is part of its own
isolated cluster. Other nodes can join it.
Agents can join other agents multiple times without issue. If a node that
is already part of a cluster joins another node, then the clusters of the
two nodes join to become a single cluster.
## Usage
2014-02-19 01:32:13 +00:00
Usage: `consul join [options] address ...`
2014-02-08 00:41:03 +00:00
You may call join with multiple addresses if you want to try to join
2014-02-19 01:32:13 +00:00
multiple clusters. Consul will attempt to join all addresses, and the join
command will fail only if Consul was unable to join with any.
2014-02-08 00:41:03 +00:00
2017-02-08 22:14:02 +00:00
#### API Options
<%= partial "docs/commands/http_api_options_client" %>
#### Command Options
2014-02-08 00:41:03 +00:00
2014-02-19 01:32:13 +00:00
* `-wan` - For agents running in server mode, the agent will attempt to join
other servers gossiping in a WAN cluster. This is used to form a bridge between
multiple datacenters.
2014-02-08 00:41:03 +00:00