From 1654de61847ca96f082ad643d2d305051feb3ffb Mon Sep 17 00:00:00 2001 From: Brian Shumate Date: Thu, 15 Sep 2016 10:25:23 -0400 Subject: [PATCH 1/2] Command output updates. - Updated starting agent example to show new output/timestamps - Updated curl example to show TaggedAddresses - Updated dig example to return 127.0.0.1 --- .../intro/getting-started/agent.html.markdown | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/website/source/intro/getting-started/agent.html.markdown b/website/source/intro/getting-started/agent.html.markdown index 920e0f6892..7c65429f80 100644 --- a/website/source/intro/getting-started/agent.html.markdown +++ b/website/source/intro/getting-started/agent.html.markdown @@ -31,39 +31,39 @@ easily. It is **not** intended to be used in production as it does not persist any state. ```text -$ consul agent -dev ==> Starting Consul agent... ==> Starting Consul agent RPC... ==> Consul agent running! + Version: 'v0.7.0' Node name: 'Armons-MacBook-Air' Datacenter: 'dc1' Server: true (bootstrap: false) Client Addr: 127.0.0.1 (HTTP: 8500, HTTPS: -1, DNS: 8600, RPC: 8400) - Cluster Addr: 172.20.20.11 (LAN: 8301, WAN: 8302) + Cluster Addr: 127.0.0.1 (LAN: 8301, WAN: 8302) Gossip encrypt: false, RPC-TLS: false, TLS-Incoming: false Atlas: ==> Log data will now stream in as it occurs: -[INFO] raft: Node at 172.20.20.11:8300 [Follower] entering Follower state -[INFO] serf: EventMemberJoin: Armons-MacBook-Air 172.20.20.11 -[INFO] consul: adding LAN server Armons-MacBook-Air (Addr: 172.20.20.11:8300) (DC: dc1) -[INFO] serf: EventMemberJoin: Armons-MacBook-Air.dc1 172.20.20.11 -[INFO] consul: adding WAN server Armons-MacBook-Air.dc1 (Addr: 172.20.20.11:8300) (DC: dc1) -[ERR] agent: failed to sync remote state: No cluster leader -[WARN] raft: Heartbeat timeout reached, starting election -[INFO] raft: Node at 172.20.20.11:8300 [Candidate] entering Candidate state -[DEBUG] raft: Votes needed: 1 -[DEBUG] raft: Vote granted. Tally: 1 -[INFO] raft: Election won. Tally: 1 -[INFO] raft: Node at 172.20.20.11:8300 [Leader] entering Leader state -[INFO] raft: Disabling EnableSingleNode (bootstrap) -[INFO] consul: cluster leadership acquired -[DEBUG] raft: Node 172.20.20.11:8300 updated peer set (2): [172.20.20.11:8300] -[DEBUG] consul: reset tombstone GC to index 2 -[INFO] consul: New leader elected: Armons-MacBook-Air -[INFO] consul: member 'Armons-MacBook-Air' joined, marking health alive -[INFO] agent: Synced service 'consul' + 2016/09/15 10:21:10 [INFO] raft: Initial configuration (index=1): [{Suffrage:Voter ID:127.0.0.1:8300 Address:127.0.0.1:8300}] + 2016/09/15 10:21:10 [INFO] raft: Node at 127.0.0.1:8300 [Follower] entering Follower state (Leader: "") + 2016/09/15 10:21:10 [INFO] serf: EventMemberJoin: Armons-MacBook-Air 127.0.0.1 + 2016/09/15 10:21:10 [INFO] serf: EventMemberJoin: Armons-MacBook-Air.dc1 127.0.0.1 + 2016/09/15 10:21:10 [INFO] consul: Adding LAN server Armons-MacBook-Air (Addr: tcp/127.0.0.1:8300) (DC: dc1) + 2016/09/15 10:21:10 [INFO] consul: Adding WAN server Armons-MacBook-Air.dc1 (Addr: tcp/127.0.0.1:8300) (DC: dc1) + 2016/09/15 10:21:13 [DEBUG] http: Request GET /v1/agent/services (180.708µs) from=127.0.0.1:52369 + 2016/09/15 10:21:13 [DEBUG] http: Request GET /v1/agent/services (15.548µs) from=127.0.0.1:52369 + 2016/09/15 10:21:17 [WARN] raft: Heartbeat timeout from "" reached, starting election + 2016/09/15 10:21:17 [INFO] raft: Node at 127.0.0.1:8300 [Candidate] entering Candidate state in term 2 + 2016/09/15 10:21:17 [DEBUG] raft: Votes needed: 1 + 2016/09/15 10:21:17 [DEBUG] raft: Vote granted from 127.0.0.1:8300 in term 2. Tally: 1 + 2016/09/15 10:21:17 [INFO] raft: Election won. Tally: 1 + 2016/09/15 10:21:17 [INFO] raft: Node at 127.0.0.1:8300 [Leader] entering Leader state + 2016/09/15 10:21:17 [INFO] consul: cluster leadership acquired + 2016/09/15 10:21:17 [DEBUG] consul: reset tombstone GC to index 3 + 2016/09/15 10:21:17 [INFO] consul: New leader elected: Armons-MacBook-Air + 2016/09/15 10:21:17 [INFO] consul: member 'Armons-MacBook-Air' joined, marking health alive + 2016/09/15 10:21:17 [INFO] agent: Synced service 'consul' ``` As you can see, the Consul agent has started and has output some log @@ -101,7 +101,7 @@ request to the Consul servers: ```text $ curl localhost:8500/v1/catalog/nodes -[{"Node":"Armons-MacBook-Air","Address":"172.20.20.11","CreateIndex":3,"ModifyIndex":4}] +[{"Node":"Armons-MacBook-Air","Address":"127.0.0.1","TaggedAddresses":{"lan":"127.0.0.1","wan":"127.0.0.1"},"CreateIndex":4,"ModifyIndex":110}] ``` In addition to the HTTP API, the [DNS interface](/docs/agent/dns.html) can @@ -118,7 +118,7 @@ $ dig @127.0.0.1 -p 8600 Armons-MacBook-Air.node.consul ;Armons-MacBook-Air.node.consul. IN A ;; ANSWER SECTION: -Armons-MacBook-Air.node.consul. 0 IN A 172.20.20.11 +Armons-MacBook-Air.node.consul. 0 IN A 127.0.0.1 ``` ## Stopping the Agent From 1ee4ba2db6daced9ecb9c8cfceabec6afb56ce6d Mon Sep 17 00:00:00 2001 From: Brian Shumate Date: Thu, 15 Sep 2016 10:37:08 -0400 Subject: [PATCH 2/2] Restore command line. --- website/source/intro/getting-started/agent.html.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/website/source/intro/getting-started/agent.html.markdown b/website/source/intro/getting-started/agent.html.markdown index 7c65429f80..2144d5c76e 100644 --- a/website/source/intro/getting-started/agent.html.markdown +++ b/website/source/intro/getting-started/agent.html.markdown @@ -31,6 +31,7 @@ easily. It is **not** intended to be used in production as it does not persist any state. ```text +-$ consul agent -dev ==> Starting Consul agent... ==> Starting Consul agent RPC... ==> Consul agent running!