DEV Community

Discussion on: Persisting Data with Nomad

Collapse
 
just_insane profile image
Justin Gauthier

Hey,

Thanks for this post! I'm having trouble getting NFS volumes to work in Nomad.

I have a share from my NFS server attached to all nodes at /mnt/nomad-shared which is working fine, however, when following your resolution, I get the following error:

"volumes are not enabled; cannot mount host paths: "/mnt/nomad-shared/data:/etc/traefik""

In my nomad config I have the following:

host_volume "data" {
    path = "/mnt/nomad-shared/data"
    read_only = false
}
host_volume "config" {
    path = "/mnt/nomad-shared/config"
    read_only = false
}
Enter fullscreen mode Exit fullscreen mode

and my traefik job looks like:

  config {
    image        = "traefik:v2.2"
    network_mode = "host"

    volumes = [
      "local/traefik.toml:/etc/traefik/traefik.toml",
      "/mnt/nomad-shared/data:/etc/traefik"
    ]
  }
Enter fullscreen mode Exit fullscreen mode

I've also tried "/mnt/nomad-shared/data/traefik" and "/mnt/nomad-shared/traefik" in the config, both of which result in the same error.

I'm very new to Nomad, so sorry if I'm missing something very basic.

Collapse
 
renerick profile image
Denis Palashevskiy

A bit late, but if anyone finds this post and comment and facing similar issue, I suggest to look at nomadproject.io/docs/drivers/docke.... By default, Nomad Docker task driver (I assume you use Docker) has host volumes binding disabled and you need to explicitly enable it in the config.