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:
-
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.
-
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. -
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 a standalone Consul cluster by following the instructions in the Consul AWS Module.
- Use the scripts from the install-nomad module in a Packer template to create a Nomad AMI.
- 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. - 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.