From c2287adeeea4a10807629923ca04be81055523e8 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 15 Dec 2016 16:07:28 -0800 Subject: [PATCH 1/2] Fix demo vagrant server by making hostname resolve --- demo/vagrant/Vagrantfile | 3 +++ demo/vagrant/server.hcl | 12 +++++++----- website/source/intro/getting-started/cluster.html.md | 8 ++++++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/demo/vagrant/Vagrantfile b/demo/vagrant/Vagrantfile index 57ff2ecc3..a6f584307 100644 --- a/demo/vagrant/Vagrantfile +++ b/demo/vagrant/Vagrantfile @@ -19,6 +19,9 @@ sudo mv nomad /usr/bin/nomad sudo mkdir -p /etc/nomad.d sudo chmod a+w /etc/nomad.d +# Set hostname's IP to made advertisement Just Work +sudo sed -i -e "s/.*nomad.*/$(ip route get 1 | awk '{print $NF;exit}') nomad/" /etc/hosts + SCRIPT Vagrant.configure(2) do |config| diff --git a/demo/vagrant/server.hcl b/demo/vagrant/server.hcl index 5361af54f..b745dbe2c 100644 --- a/demo/vagrant/server.hcl +++ b/demo/vagrant/server.hcl @@ -12,8 +12,10 @@ server { bootstrap_expect = 1 } -advertise { - http = "localhost" - rpc = "localhost" - serf = "localhost" -} +# Advertise must be set to a non-loopback address. +# Defaults to the resolving the local hostname. +#advertise { +# http = "10.0.2.1" +# rpc = "10.0.2.1" +# serf = "10.0.2.1" +#} diff --git a/website/source/intro/getting-started/cluster.html.md b/website/source/intro/getting-started/cluster.html.md index 31535df93..75469ea98 100644 --- a/website/source/intro/getting-started/cluster.html.md +++ b/website/source/intro/getting-started/cluster.html.md @@ -33,6 +33,14 @@ server { # Self-elect, should be 3 or 5 for production bootstrap_expect = 1 } + +# Advertise must be set to a non-loopback address. +# Defaults to the resolving the local hostname. +#advertise { +# http = "10.0.2.1" +# rpc = "10.0.2.1" +# serf = "10.0.2.1" +#} ``` This is a fairly minimal server configuration file, but it From 75a04b4c1f78e0b28f5e0a9e94a486fc7fc5103b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 15 Dec 2016 17:17:31 -0800 Subject: [PATCH 2/2] Remove commented out block from comments --- website/source/intro/getting-started/cluster.html.md | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/website/source/intro/getting-started/cluster.html.md b/website/source/intro/getting-started/cluster.html.md index 75469ea98..e8b3f0e28 100644 --- a/website/source/intro/getting-started/cluster.html.md +++ b/website/source/intro/getting-started/cluster.html.md @@ -19,7 +19,7 @@ The first step is to create the config file for the server. Either download the file from the [repository here](https://github.com/hashicorp/nomad/tree/master/demo/vagrant), or paste this into a file called `server.hcl`: -``` +```hcl # Increase log verbosity log_level = "DEBUG" @@ -33,14 +33,6 @@ server { # Self-elect, should be 3 or 5 for production bootstrap_expect = 1 } - -# Advertise must be set to a non-loopback address. -# Defaults to the resolving the local hostname. -#advertise { -# http = "10.0.2.1" -# rpc = "10.0.2.1" -# serf = "10.0.2.1" -#} ``` This is a fairly minimal server configuration file, but it