From fcf44b002c3a94fe0d67f29d81e6fff0ca4e939f Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Thu, 15 Dec 2016 16:07:28 -0800 Subject: [PATCH] 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