{"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.
\nDefinition 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.
\nI 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.
\nThe first step is to get the single binary and copy it to folder /usr/local/bin
\nThe binary can be downloaded from Nomad website.
\nUnzip the binary, change the permission and move it to /usr/local/bin
\nsudo chown root:root nomad\n\nsudo mv nomad /usr/local/bin\n
\nAfter that, you need to create a SystemD script to enable and start a service.
\nsudo touch /etc/systemd/system/nomad.service\n
\nAnd 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
\nAdd a nomad config file to /etc/nomad.d/nomad.hcl
\ndata_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
\nEnable and start a service, check the service status.
\nsudo systemctl enable nomad\n\nsudo systemctl start nomad\n\nsudo systemctl status nomad\n
\nFinally, access the http://localhost:4646 and the see ui manager of Nomad Hashicorp.
\nReferences
\n\n","title":"Running Hashicorp Nomad on Raspberry","date":"2021-10-05"}},"__N_SSG":true}