Skip to content

Commit

Permalink
agent: Support -advertise cli flag. Fixes #156.
Browse files Browse the repository at this point in the history
  • Loading branch information
armon committed May 16, 2014
1 parent bae3c16 commit 246ad6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions command/agent/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ func (c *Command) readConfig() *Config {

cmdFlags.StringVar(&cmdConfig.ClientAddr, "client", "", "address to bind client listeners to (DNS, HTTP, RPC)")
cmdFlags.StringVar(&cmdConfig.BindAddr, "bind", "", "address to bind server listeners to")
cmdFlags.StringVar(&cmdConfig.AdvertiseAddr, "advertise", "", "address to advertise instead of bind addr")

cmdFlags.IntVar(&cmdConfig.Protocol, "protocol", -1, "protocol version")

Expand Down Expand Up @@ -467,6 +468,7 @@ Usage: consul agent [options]
Options:
-advertise=addr Sets the advertise address to use
-bootstrap Sets server to bootstrap mode
-bind=0.0.0.0 Sets the bind address for cluster communication
-client=127.0.0.1 Sets the address to bind for client access.
Expand Down
14 changes: 8 additions & 6 deletions website/source/docs/agent/options.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ are documented below.

The options below are all specified on the command-line.

* `-advertise` - The advertise address is used to change the address that we
advertise to other nodes in the cluster. By default, the `-bind` address is
advertised. However, in some cases, there may be a routable address that cannot
be bound to. This flag enables gossiping a different address to support this.
If this address is not routable, the node will be in a constant flapping state,
as other nodes will treat the non-routability as a failure.

* `-bootstrap` - This flag is used to control if a server is in "bootstrap" mode. It is important that
no more than one server *per* datacenter be running in this mode. The initial server **must** be in bootstrap
mode. Technically, a server in bootstrap mode is allowed to self-elect as the Raft leader. It is important
Expand Down Expand Up @@ -150,12 +157,7 @@ definitions support being updated during a reload.

* `ui_dir` - Equivalent to the `-ui-dir` command-line flag.

* `advertise_addr` - The advertise address is used to change the address that we
advertise to other nodes in the cluster. By default, the `-bind` address is
advertised. However, in some cases, there may be a routable address that cannot
be bound to. This flag enables gossiping a different address to support this.
If this address is not routable, the node will be in a constant flapping state,
as other nodes will treat the non-routability as a failure.
* `advertise_addr` - Equivalent to the `-advertise` command-line flag.

* `ca_file` - This provides a the file path to a PEM encoded certificate authority.
The certificate authority is used to check the authenticity of client and server
Expand Down

0 comments on commit 246ad6c

Please sign in to comment.