{"pageProps":{"postData":{"id":"2021-10-05-running-nomad-on-raspberry","contentHtml":"

Hi everyone, in this post I explain the Hashicorp Nomad installation process to manage Docker containers on my Raspberry Pi.

\n

Definition of Nomad \"A simple and flexible workload orchestrator to deploy and manage containers and non-containerized applications across on-prem and clouds at scale.\" according to the website.

\n

I have been using the Raspberry Pi OS 64 bits on a Raspberry Pi 4, this OS is based on Debian 10 for arch arm64 at the time of writing this article.

\n

The first step is to get the single binary and copy it to folder /usr/local/bin

\n

The binary can be downloaded from Nomad website.

\n

Unzip the binary, change the permission and move it to /usr/local/bin

\n
sudo chown root:root nomad\n\nsudo mv nomad /usr/local/bin\n
\n

After that, you need to create a SystemD script to enable and start a service.

\n
sudo touch /etc/systemd/system/nomad.service\n
\n

And add the following content.

\n
[Unit]\nDescription=Nomad\nDocumentation=https://www.nomadproject.io/docs/\nWants=network-online.target\nAfter=network-online.target\n\n# When using Nomad with Consul it is not necessary to start Consul first. These\n# lines start Consul before Nomad as an optimization to avoid Nomad logging\n# that Consul is unavailable at startup.\n#Wants=consul.service\n#After=consul.service\n\n[Service]\nExecReload=/bin/kill -HUP $MAINPID\nExecStart=/usr/local/bin/nomad agent -config /etc/nomad.d\nKillMode=process\nKillSignal=SIGINT\nLimitNOFILE=65536\nLimitNPROC=infinity\nRestart=on-failure\nRestartSec=2\n\n## Configure unit start rate limiting. Units which are started more than\n## *burst* times within an *interval* time span are not permitted to start any\n## more. Use `StartLimitIntervalSec` or `StartLimitInterval` (depending on\n## systemd version) to configure the checking interval and `StartLimitBurst`\n## to configure how many starts per interval are allowed. The values in the\n## commented lines are defaults.\n\n# StartLimitBurst = 5\n\n## StartLimitIntervalSec is used for systemd versions >= 230\n# StartLimitIntervalSec = 10s\n\n## StartLimitInterval is used for systemd versions < 230\n# StartLimitInterval = 10s\n\nTasksMax=infinity\nOOMScoreAdjust=-1000\n\n[Install]\nWantedBy=multi-user.target\n\n
\n

Add a nomad config file to /etc/nomad.d/nomad.hcl

\n
data_dir = \"/opt/nomad/data\"\nbind_addr = \"0.0.0.0\"\n\nserver {\n  enabled = true\n  bootstrap_expect = 1\n}\n\nclient {\n  enabled = true\n  servers = [\"127.0.0.1:4646\"]\n}\n
\n

Enable and start a service, check the service status.

\n
sudo systemctl enable nomad\n\nsudo systemctl start nomad\n\nsudo systemctl status nomad\n
\n

Finally, access the http://localhost:4646 and the see ui manager of Nomad Hashicorp.

\n

References

\n\n","title":"Running Hashicorp Nomad on Raspberry","date":"2021-10-05"}},"__N_SSG":true}