DEV Community

lykins
lykins

Posted on

Setting up the Nomad Cluster

My first task in setting up my Nomad Image Factory is creating the Nomad cluster.

Lab:

  • 3 : Mini Computers
    • N100 CPU
    • 16 GB Memory
    • 2 : 1GB Nics
  • Proxmox

Cluster Nodes

Nomad Cluster:

  • Simple Cluster
    • 3 Nodes with Server and Client Role
    • 2 CPU
    • 4 GB Memory
    • Ubuntu 24

Nomad VMs

Installing Nomad:

I take the easy way to install Nomad.

sudo apt-get update && \
  sudo apt-get install wget gpg coreutils

wget -O- https://apt.releases.hashicorp.com/gpg | \
  sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
| sudo tee /etc/apt/sources.list.d/hashicorp.list

sudo apt-get update && sudo apt-get install nomad
Enter fullscreen mode Exit fullscreen mode

After installing you should be able to check the Nomad version to confirm.

Nomad Version

Additional Notes:

If you want to do a manual install and setup, I would recommend following this guide : HERE :).

If sticking with using the package manager, just a few notes - atleast on he Ubuntu side. I would not think there is a difference with RHEL-based.

Service

systemctl

It is setup up with a default config. If this was a server only node, I would have set up a nomad user and group, and change root in both places nomad.

user

Other note is the nomad environment and config file. They are set up in /etc/nomad.d. If changing you'll need to update those values in the service config.

config

Config

My favorite thing about Nomad and what drew me to it was its use of HCL. My background prior to messing with Nomad is with Terraform + Packer, so it is a common syntax I am already familiar with.

The common config location is /etc/nomad.d.

ls -l

For now, I will not change anything in here. I probably will play with TLS down the road, but since this is a lab, I am sticking to the defaults.

nomad.hcl

Starting up Nomad:

Last item I had to hit was install Docker. Went ahead and did that since I will be running containers on this.

At this point I am ready to get it up and running...

starting service

Just to note, I entered in the IP address to bootstrap the servers. Everything else is pretty much the default...

data_dir  = "/opt/nomad/data"
bind_addr = "0.0.0.0"

server {
  enabled          = true
  bootstrap_expect = 1
        server_join {
        retry_join = ["192.168.39.109"]
        }
}

client {
  enabled = true
  servers = ["127.0.0.1"]
Enter fullscreen mode Exit fullscreen mode

Once I got the service running on each I checked the UI to confirm all have been joined...

Joined Servers

I did notice when checking the clients and their driver status that I must have missed the Docker engine on one of them. I'll jump back in and get that cleaned up.

missing driver


Well that is it for the night. It is getting late and HashiConf starts in two days :)

Cheers,
lykins

Top comments (0)