From 7dcea6a37f59299e0dc89a48293c3634227e5b12 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 27 Mar 2018 10:02:47 -0700 Subject: [PATCH] demo: give agents unique names Give demo agents unique names to improve `nomad node status` output. Since the agents default to the hostname, they all had the same name whether using the root or demo Vagrantfiles. --- demo/vagrant/client1.hcl | 3 +++ demo/vagrant/client2.hcl | 3 +++ demo/vagrant/server.hcl | 3 +++ .../source/intro/getting-started/cluster.html.md | 16 +++++++++------- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/demo/vagrant/client1.hcl b/demo/vagrant/client1.hcl index 845a4ebe6..6ba1e5fc9 100644 --- a/demo/vagrant/client1.hcl +++ b/demo/vagrant/client1.hcl @@ -4,6 +4,9 @@ log_level = "DEBUG" # Setup data dir data_dir = "/tmp/client1" +# Give the agent a unique name. Defaults to hostname +name = "client1" + # Enable the client client { enabled = true diff --git a/demo/vagrant/client2.hcl b/demo/vagrant/client2.hcl index 963546c4b..d1a42737f 100644 --- a/demo/vagrant/client2.hcl +++ b/demo/vagrant/client2.hcl @@ -4,6 +4,9 @@ log_level = "DEBUG" # Setup data dir data_dir = "/tmp/client2" +# Give the agent a unique name. Defaults to hostname +name = "client2" + # Enable the client client { enabled = true diff --git a/demo/vagrant/server.hcl b/demo/vagrant/server.hcl index f055de4e6..453df78c6 100644 --- a/demo/vagrant/server.hcl +++ b/demo/vagrant/server.hcl @@ -4,6 +4,9 @@ log_level = "DEBUG" # Setup data dir data_dir = "/tmp/server1" +# Give the agent a unique name. Defaults to hostname +name = "server1" + # Enable the server server { enabled = true diff --git a/website/source/intro/getting-started/cluster.html.md b/website/source/intro/getting-started/cluster.html.md index 5e3a76abd..5ffc2fd62 100644 --- a/website/source/intro/getting-started/cluster.html.md +++ b/website/source/intro/getting-started/cluster.html.md @@ -91,6 +91,9 @@ log_level = "DEBUG" # Setup data dir data_dir = "/tmp/client1" +# Give the agent a unique name. Defaults to hostname +name = "client1" + # Enable the client client { enabled = true @@ -107,10 +110,9 @@ ports { } ``` -Copy that file to `client2.hcl` and change the `data_dir` to -be `/tmp/client2` and the `http` port to 5657. Once you've created -both `client1.hcl` and `client2.hcl`, open a tab for each and -start the agents: +Copy that file to `client2.hcl`. Change the `data_dir` to be `/tmp/client2`, +the `name` to `client2`, and the `http` port to 5657. Once you have created +both `client1.hcl` and `client2.hcl`, open a tab for each and start the agents: ```text $ sudo nomad agent -config client1.hcl @@ -140,9 +142,9 @@ we should see both nodes in the `ready` state: ```text $ nomad node status -ID Datacenter Name Class Drain Status -fca62612 dc1 nomad false ready -c887deef dc1 nomad false ready +ID Datacenter Name Class Drain Status +fca62612 dc1 client1 false ready +c887deef dc1 client2 false ready ``` We now have a simple three node cluster running. The only difference