liveBook · Manning

Nomad server

As explained in Road to Kubernetes

A Nomad client is a cluster agent and machine that receives and runs workloads assigned by the Nomad server.

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
# Located at /etc/nomad.d/nomad.hcl
data_dir = "/opt/nomad/data"

bind_addr = "0.0.0.0"

name = "nomad-server-1"

advertise {
    http = "192.168.204.96"
    rpc = "192.168.204.96"
    serf = "192.168.204.96"
}

server {
    enabled = true
    bootstrap_expect = 1 # number of servers
}

client {
    enabled = false
}

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

How Road to Kubernetes covers it

How deep it goes
Explains core configuration declarations and setup steps, but defers advanced multi-server configuration details.
Examples
Uses a one-server, two-client cluster and an HCL configuration named nomad-server-1.
What it assumes
Assumes virtual machines, Nomad installation, and basic SSH and service-management commands; teaches the cluster roles from their definitions.
What you can do after
Operate/configure a single Nomad server and connect clients through its private communication address.
How it connects
Connects cluster management with Nomad clients, tasks, jobs, containers, and Kubernetes control-plane concepts.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Road to Kubernetes. The section links point to the parts of the book it draws on.