A Nomad server is the primary agent and coordinating brain of a Nomad cluster. It maintains cluster state and schedules tasks, including containers, onto Nomad client nodes. Clients run the tasks assigned by the server; tasks remain on their assigned node once defined. section 9.2.1 section 9.2.3
A practical starter cluster uses one virtual machine as the server and two as clients. Larger deployments can distribute server coordination across multiple virtual machines and regions, but a single server keeps the first setup approachable. section 9.2.1 section 9.2.3
The server configuration establishes the cluster’s basic behavior:
- Stores cluster data under /opt/nomad/data. section 9.2.3
- Listens on all available addresses with bind_addr = "0.0.0.0" and advertises private addresses for HTTP, RPC, and Serf communication. section 9.2.3
- Enables the server role with bootstrap_expect = 1, indicating a one-server cluster. section 9.2.3
- Disables the client role on the server; although co-locating both roles is possible, it is not recommended here. section 9.2.3
Configure and start a server
On the server virtual machine, create /opt/nomad/data, replace /etc/nomad.d/nomad.hcl with the server configuration, and start the Nomad service. The configuration names the node nomad-server-1, advertises its private IP address, enables the server role, and disables client execution. Clients then use that private address to join and communicate with the server. section 9.2.3 section 9.2.4
Listing 9.6 Nomad server configuration
Use the complete HCL listing to inspect the minimal server configuration, including data storage, advertised addresses, server bootstrap, and disabled client execution. section 9.2.3
