Nomad server and client listening on localhost -- this is the best way?

Our team needs to run a single node Nomad setup on our dev workstations. nomad agent -dev has some limitations we would like to avoid and so I’m trying to do something like the following:

data_dir  = "/opt/nomad/data"

bind_address = "127.0.0.1"

server {
  enabled          = true
  bootstrap_expect = 1
}

client {
  enabled = true
  servers = ["127.0.0.1:4647"]
}

However, this results in an error when starting Nomad:

Failed to parse HTTP advertise address (, 127.0.0.1, 4646, false): Defaulting advertise to localhost is unsafe, please set advertise manually

Ok, fine. So in the above config, replace the =bind_address= setting with:

advertise {
  http = "127.0.0.1"
  serf = "{{ GetDefaultInterfaces | attr \"address\" }}"
  rpc  = "{{ GetDefaultInterfaces | attr \"address\" }}"
}

That seems to work fine. Is that the most simple way to resolve this?

Hi @niftyjennins,

That configuration looks good to me; it’s really dependant on works best for your setup and requirements. It also looks like the simplest way to resolve your issue and looks similar to my own local non-dev configuration.

Thanks,
jrasell and the Nomad team