Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf

Browse the Repo

file-type-icon.circleci
file-type-icon_ci
file-type-icon_docs
file-type-iconexamples
file-type-iconmodules
file-type-icontest
file-type-icon.gitignore
file-type-iconCODEOWNERS
file-type-iconCONTRIBUTING.md
file-type-iconLICENSE
file-type-iconNOTICE
file-type-iconREADME.md
file-type-iconcore-concepts.md
file-type-iconmain.tf
file-type-iconoutputs.tf
file-type-iconvariables.tf
HashiCorp Nomad

HashiCorp Nomad

Deploy a Nomad cluster. Supports automatic bootstrapping, discovery of Consul servers, automatic recovery of failed servers.

Code Preview

Preview the Code

mobile file icon

core-concepts.md

down

Background

To run a production Nomad cluster, you need to deploy a small number of server nodes (typically 3), which are responsible for being part of the consensus protocol, and a larger number of client nodes, which are used for running jobs. You must also have a Consul cluster deployed (see the Consul AWS Module) in one of the following configurations:

  1. Deploy Nomad and Consul in the same cluster
  2. Deploy Nomad and Consul in separate clusters

Deploy Nomad and Consul in the same cluster

  1. Use the install-consul module from the Consul AWS Module and the install-nomad module from this Module in a Packer template to create an AMI with Consul and Nomad.

    If you are just experimenting with this Module, you may find it more convenient to use one of our official public AMIs:

    WARNING! Do NOT use these AMIs in your production setup. In production, you should build your own AMIs in your own AWS account.

  2. Deploy a small number of server nodes (typically, 3) using the consul-cluster module. Execute the run-consul script and the run-nomad script on each node during boot, setting the --server flag in both scripts.

  3. Deploy as many client nodes as you need using the nomad-cluster module. Execute the run-consul script and the run-nomad script on each node during boot, setting the --client flag in both scripts.

Check out the nomad-consul-colocated-cluster example for working sample code.

Deploy Nomad and Consul in separate clusters

  1. Deploy a standalone Consul cluster by following the instructions in the Consul AWS Module.
  2. Use the scripts from the install-nomad module in a Packer template to create a Nomad AMI.
  3. Deploy a small number of server nodes (typically, 3) using the nomad-cluster module. Execute the run-nomad script on each node during boot, setting the --server flag. You will need to configure each node with the connection details for your standalone Consul cluster.
  4. Deploy as many client nodes as you need using the nomad-cluster module. Execute the run-nomad script on each node during boot, setting the --client flag.

Check out the nomad-consul-separate-cluster example for working sample code.

Questions? Ask away.

We're here to talk about our services, answer any questions, give advice, or just to chat.

Ready to hand off the Gruntwork?