website: Documentation cleanup

This commit is contained in:
Armon Dadgar 2014-04-11 16:23:16 -07:00
parent 04583cad86
commit 3758f235b2
5 changed files with 95 additions and 143 deletions

View File

@ -30,19 +30,15 @@ $ consul agent -data=/tmp/consul
==> Starting Consul agent...
==> Starting Consul agent RPC...
==> Consul agent running!
Node name: 'Armons-MacBook-Air.local'
Node name: 'Armons-MacBook-Air'
Datacenter: 'dc1'
Advertise addr: '10.1.10.12'
RPC addr: '127.0.0.1:8400'
HTTP addr: '127.0.0.1:8500'
DNS addr: '127.0.0.1:8600'
Encrypted: false
Server: false (bootstrap: false)
Client Addr: 127.0.0.1 (HTTP: 8500, DNS: 8600, RPC: 8400)
Cluster Addr: 192.168.1.43 (LAN: 8301, WAN: 8302)
==> Log data will now stream in as it occurs:
2014/02/18 14:25:02 [INFO] serf: EventMemberJoin: Armons-MacBook-Air.local 10.1.10.12
2014/02/18 14:25:02 [ERR] agent: failed to sync remote state: No known Consul servers
[INFO] serf: EventMemberJoin: Armons-MacBook-Air.local 192.168.1.43
...
```
@ -58,27 +54,6 @@ There are several important components that `consul agent` outputs:
can be used to set the datacenter. For single-DC configurations, the agent
will default to "dc1".
* **Advertise addr**: This is the address and port used for communication between
Consul agents in a cluster. Every Consul agent in a cluster does not have to
use the same port, but this address **MUST** be reachable by all other nodes.
* **RPC addr**: This is the address and port used for RPC communications
for other `consul` commands. Other Consul commands such as `consul members`
connect to a running agent and use RPC to query and control the agent.
By default, this binds only to localhost on the default port. If you
change this address, you'll have to specify an `-rpc-addr` to commands
such as `consul members` so they know how to talk to the agent. This is also
the address other applications can use over [RPC to control Consul](/docs/agent/rpc.html).
* **HTTP/DNS addr**: This is the addresses the agent is listening on for the
HTTP and DNS interfaces respectively. These are bound to localhost for security,
but can be configured to listen on other addresses or ports.
* **Encrypted**: This shows if Consul is encrypting all traffic that it
sends and expects to receive. It is a good sanity check to avoid sending
non-encrypted traffic over any public networks. You can read more about
[encryption here](/docs/agent/encryption.html).
* **Server**: This shows if the agent is running in the server or client mode.
Server nodes have the extra burden of participating in the consensus quorum,
storing cluster state, and handling queries. Additionally, a server may be
@ -86,6 +61,19 @@ There are several important components that `consul agent` outputs:
servers to join the cluster. Multiple servers cannot be in bootstrap mode,
otherwise the cluster state will be inconsistent.
* **Client Addr**: This is the addressused for client interfaces to the agent.
This includes the ports for the HTTP, DNS, and RPC interfaces. The RPC
address is used for other `consul` commands. Other Consul commands such
as `consul members` connect to a running agent and use RPC to query and
control the agent. By default, this binds only to localhost. If you
change this address or port, you'll have to specify an `-rpc-addr` to commands
such as `consul members` so they know how to talk to the agent. This is also
the address other applications can use over [RPC to control Consul](/docs/agent/rpc.html).
* **Cluster Addr**: This is the address and ports used for communication between
Consul agents in a cluster. Every Consul agent in a cluster does not have to
use the same port, but this address **MUST** be reachable by all other nodes.
## Stopping an Agent
An agent can be stoped in two ways: gracefully or forcefully. To gracefully

View File

@ -26,24 +26,23 @@ are documented below.
The options below are all specified on the command-line.
* `-serf-bind` - The address that the underlying Serf library will bind to.
* `-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 boostrap mode is allowed to self-elect as the Raft leader. It is important
that only a single node is in this mode, because otherwise consistency cannot be guarenteed if multiple
nodes are able to self-elect. Once there are multiple servers in a datacenter, it is generally a good idea
to disable bootstrap mode on all of them.
* `-bind` - The address that should be bound to for internal cluster communications.
This is an IP address that should be reachable by all other nodes in the cluster.
By default this is "0.0.0.0", meaning Consul will use the first available private
IP address. Consul uses both TCP and UDP and use the same port for both, so if you
have any firewalls be sure to allow both protocols.
* `-server-addr` - The address that the agent will bind to for handling RPC calls
if running in server mode. This does not affect clients running in client mode.
By default this is "0.0.0.0:8300". This port is used for TCP communications so any
firewalls must be configured to allow this.
* `-advertise` - The advertise flag is used to change the address that we
advertise to other nodes in the cluster. By default, the `-serf-bind` address is
advertised. However, in some cases (specifically NAT traversal), 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.
* `-client` - The address that Consul will bind to client interfaces. This
includes the HTTP, DNS, and RPC servers. By default this is "127.0.0.1"
allowing only loopback connections. The RPC address is used by other Consul
commands, such as `consul members`, in order to query a running Consul agent.
* `-config-file` - A configuration file to load. For more information on
the format of this file, read the "Configuration Files" section below.
@ -57,10 +56,15 @@ The options below are all specified on the command-line.
in alphabetical order. For more information on the format of the configuration
files, see the "Configuration Files" section below.
* `-encrypt` - Specifies the secret key to use for encryption of Consul
network traffic. This key must be 16-bytes that are base64 encoded. The
easiest way to create an encryption key is to use `consul keygen`. All
nodes within a cluster must share the same encryption key to communicate.
* `-data-dir` - This flag provides a data directory for the agent to store state.
This is required for all agents. The directory should be durable across reboots.
This is especially critical for agents that are running in server mode, as they
must be able to persist the cluster state.
* `-dc` - This flag controls the datacenter the agent is running in. If not provided
it defaults to "dc1". Consul has first class support for multiple data centers but
it relies on proper configuration. Nodes in the same datacenter should be on a single
LAN.
* `-log-level` - The level of logging to show after the Consul agent has
started. This defaults to "info". The available log levels are "trace",
@ -72,32 +76,9 @@ The options below are all specified on the command-line.
* `-node` - The name of this node in the cluster. This must be unique within
the cluster. By default this is the hostname of the machine.
* `-rpc-addr` - The address that Consul will bind to for the agent's RPC server.
By default this is "127.0.0.1:8400", allowing only loopback connections.
The RPC address is used by other Consul commands, such as `consul members`,
in order to query a running Consul agent. It is also used by other applications
to control Consul using it's [RPC protocol](/docs/agent/rpc.html).
* `-data-dir` - This flag provides a data directory for the agent to store state.
This is required for all agents. The directory should be durable across reboots.
This is especially critical for agents that are running in server mode, as they
must be able to persist the cluster state.
* `-dc` - This flag controls the datacenter the agent is running in. If not provided
it defaults to "dc1". Consul has first class support for multiple data centers but
it relies on proper configuration. Nodes in the same datacenter should be on a single
LAN.
* `-recursor` - This flag provides an address of an upstream DNS server that is used to
recursively resolve queries if they are not inside the service domain for consul. For example,
a node can use Consul directly as a DNS server, and if the record is outside of the "consul." domain,
the query will be resolved upstream using this server.
* `-http-addr` - This flag controls the address the agent listens on for HTTP requests.
By default it is bound to "127.0.0.1:8500". This port must allow for TCP traffic.
* `-dns-addr` - This flag controls the address the agent listens on for DNS requests.
By default it is bound to "127.0.0.1:8600". This port must allow for UDP and TCP traffic.
* `-protocol` - The Consul protocol version to use. This defaults to the latest
version. This should be set only when [upgrading](/docs/upgrading.html).
You can view the protocol versions supported by Consul by running `serf -v`.
* `-server` - This flag is used to control if an agent is in server or client mode. When provided,
an agent will act as a Consul server. Each Consul cluster must have at least one server, and ideally
@ -107,21 +88,6 @@ The options below are all specified on the command-line.
participate in a WAN gossip pool with server nodes in other datacenters. Servers act as gateways
to other datacenters and forward traffic as appropriate.
* `-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 boostrap mode is allowed to self-elect as the Raft leader. It is important
that only a single node is in this mode, because otherwise consistency cannot be guarenteed if multiple
nodes are able to self-elect. Once there are multiple servers in a datacenter, it is generally a good idea
to disable bootstrap mode on all of them.
* `-statsite` - This flag provides the address of a statsite instance. If provided Consul will stream
various telemetry information to that instance for aggregation. This can be used to capture various
runtime information.
* `-protocol` - The Consul protocol version to use. This defaults to the latest
version. This should be set only when [upgrading](/docs/upgrading.html).
You can view the protocol versions supported by Consul by running `serf -v`.
## Configuration Files
In addition to the command-line options, configuration can be put into
@ -155,55 +121,69 @@ definitions support being updated during a reload.
* `bootstrap` - Equivalent to the `-bootstrap` command-line flag.
* `bind_addr` - Equivalent to the `-bind` command-line flag.
* `client_addr` - Equivalent to the `-client` command-line flag.
* `datacenter` - Equivalent to the `-dc` command-line flag.
* `data_dir` - Equivalent to the `-data-dir` command-line flag.
* `dns_addr` - Equivalent to the `-dns-addr` command-line flag.
* `recursor` - Equivalent to the `-recursor` command-line flag.
* `domain` - By default, Consul responds to DNS queries in the "consul." domain.
This flag can be used to change that domain. All queries in this domain are assumed
to be handled by Consul, and will not be recursively resolved.
* `encrypt` - Equivalent to the `-encrypt` command-line flag.
* `http_addr` - Equivalent to the `-http-addr` command-line flag.
* `log_level` - Equivalent to the `-log-level` command-line flag.
* `node_name` - Equivalent to the `-node` command-line flag.
* `rpc_addr` - Equivalent to the `-rpc-addr` command-line flag.
* `serf_bind_addr` - Equivalent to the `-serf-bind` command-line flag.
* `serf_lan_port` - This configures which port Serf listens on to communicate
with nodes on the local LAN. By default this is 8301. All nodes in the datacenter
should be able to reach this port over TCP and UDP.
* `serf_wan_port` - This configures which port Serf listens on to communicate
with nodes on the remote WAN. By default this is 8302. All nodes in the WAN gossip
pool should be able to reach this port over TCP and UDP. This only applies to
agents running in server mode.
* `server_addr` - Equivalent to the `-server-addr` command-line flag.
* `advertise_addr` - Equivalent to the `-advertise` command-line flag.
* `protocol` - Equivalent to the `-protocol` command-line flag.
* `server` - Equivalent to the `-server` 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.
* `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
connections with the appropriate `verify_incoming` or `verify_outgoing` flags.
* `cert_file` - This provides a the file path to a PEM encoded certificate.
The certificate is provided to clients or servers to verify the agents authenticity.
Must be provided along with the `key_file`.
* `domain` - By default, Consul responds to DNS queries in the "consul." domain.
This flag can be used to change that domain. All queries in this domain are assumed to be handled by Consul, and will not be recursively resolved.
* `enable_debug` - When set, enables some additional debugging features. Currently,
only used to set the runtime profiling HTTP endpoints.
* `encrypt` - Specifies the secret key to use for encryption of Consul
network traffic. This key must be 16-bytes that are base64 encoded. The
easiest way to create an encryption key is to use `consul keygen`. All
nodes within a cluster must share the same encryption key to communicate.
* `key_file` - This provides a the file path to a PEM encoded private key.
The key is used with the certificate to verify the agents authenticity.
Must be provided along with the `cert_file`.
* `leave_on_terminate` - If enabled, when the agent receives a TERM signal,
it will send a Leave message to the rest of the cluster and gracefully
leave. Defaults to false.
* `recursor` - This flag provides an address of an upstream DNS server that is used to
recursively resolve queries if they are not inside the service domain for consul. For example,
a node can use Consul directly as a DNS server, and if the record is outside of the "consul." domain,
the query will be resolved upstream using this server.
* `skip_leave_on_interrupt` - This is the similar to`leave_on_terminate` but
only affects interrupt handling. By default, an interrupt causes Consul to
gracefully leave, but setting this to true disables that. Defaults to false.
Interrupts are usually from a Control-C from a shell.
* `statsite_addr` - Equivalent to the `-statsite` command-line flag.
* `statsite_addr` - This provides the address of a statsite instance. If provided
Consul will stream various telemetry information to that instance for aggregation.
This can be used to capture various runtime information.
* `verify_incoming` - If set to True, Consul requires that all incoming
connections make use of TLS, and that the client provides a certificate signed
@ -217,15 +197,3 @@ definitions support being updated during a reload.
will not make use of TLS for outgoing connections. This applies to clients and servers,
as both will make outgoing connections.
* `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
connections with the appropriate `verify_incoming` or `verify_outgoing` flags.
* `cert_file` - This provides a the file path to a PEM encoded certificate.
The certificate is provided to clients or servers to verify the agents authenticity.
Must be provided along with the `key_file`.
* `key_file` - This provides a the file path to a PEM encoded private key.
The key is used with the certificate to verify the agents authenticity.
Must be provided along with the `cert_file`.

View File

@ -28,17 +28,13 @@ $ ./bin/consul agent -server -bootstrap -data-dir /tmp/consul
==> Consul agent running!
Node name: 'Armons-MacBook-Air'
Datacenter: 'dc1'
Advertise addr: '10.1.10.38'
RPC addr: '127.0.0.1:8400'
HTTP addr: '127.0.0.1:8500'
DNS addr: '127.0.0.1:8600'
Encrypted: false
Server: true (bootstrap: true)
Client Addr: 127.0.0.1 (HTTP: 8500, DNS: 8600, RPC: 8400)
Cluster Addr: 10.1.10.38 (LAN: 8301, WAN: 8302)
==> Log data will now stream in as it occurs:
[INFO] serf: EventMemberJoin: Armons-MacBook-Air 10.1.10.38
[INFO] serf: EventMemberJoin: Armons-MacBook-Air 10.1.10.38
[INFO] serf: EventMemberJoin: Armons-MacBook-Air.local 10.1.10.38
[INFO] raft: Node at 10.1.10.38:8300 [Follower] entering Follower state
[INFO] consul: adding server for datacenter: dc1, addr: 10.1.10.38:8300
[ERR] agent: failed to sync remote state: rpc error: No cluster leader

View File

@ -30,7 +30,7 @@ and it *must* be accessible by all other nodes in the cluster. The first node
will act as our server in this cluster.
```
$ consul agent -server -bootstrap -data-dir /tmp/consul -node=agent-one -serf-bind=172.20.20.10 -server-addr=172.20.20.10:8300 -advertise=172.20.20.10
$ consul agent -server -bootstrap -data-dir /tmp/consul -node=agent-one -bind=172.20.20.10
...
```
@ -40,7 +40,7 @@ as specified in the Vagrantfile. In production, you will generally want
to provide a bind address or interface as well.
```
$ consul agent -data-dir /tmp/consul -node=agent-two -serf-bind=172.20.20.11 -server-addr=172.20.20.11:8300 -advertise=172.20.20.11
$ consul agent -data-dir /tmp/consul -node=agent-two -bind=172.20.20.11
...
```

View File

@ -28,7 +28,7 @@ We now restart the second agent, providing the configuration directory as well a
first node to re-join:
```
$ consul agent -data-dir /tmp/consul -node=agent-two -serf-bind=172.20.20.11 -server-addr=172.20.20.11:8300 -advertise=172.20.20.11 -config-dir /etc/consul/
$ consul agent -data-dir /tmp/consul -node=agent-two -bind=172.20.20.11 -config-dir /etc/consul/
==> Starting Consul agent...
...
[INFO] agent: Synced service 'web'