diff --git a/IT/Hashicorp Nomad.md b/IT/Hashicorp Nomad.md index b304d31..e4c056d 100644 --- a/IT/Hashicorp Nomad.md +++ b/IT/Hashicorp Nomad.md @@ -32,8 +32,8 @@ https://developer.hashicorp.com/nomad/tutorials/get-started/gs-install#install-t ## Creating a single node cluster - -Create a config file with in `/etc/nomad.d` named `config.hcl`: +1. Install the `nomad` binary. +2. Create a config file with in `/etc/nomad.d` named `config.hcl`: ```hcl # https://developer.hashicorp.com/nomad/docs/configuration # The client block configures the Nomad agent to accept jobs as assigned @@ -42,14 +42,40 @@ Create a config file with in `/etc/nomad.d` named `config.hcl`: client { enabled = true } +# https://developer.hashicorp.com/nomad/docs/configuration/server server { enabled = true + # The number of server nodes to wait for before bootstrapping. bootstrap_expect = 1 } # The local directory where agent state is stored. data_dir = "/opt/nomad" name = "YOUR_NOMAD_NAME_HERE" ``` +3. Create a Linux service `nomad.service` inside `/etc/systemd/system`: +```systemd +[Unit] +Description=Nomad +Documentation=https://nomadproject.io/docs/ +Wants=network-online.target +After=network-online.target + +[Service] +ExecReload=/bin/kill -HUP $MAINPID +ExecStart=/usr/local/bin/nomad agent -config /etc/nomad.d +KillMode=process +KillSignal=SIGINT +LimitNOFILE=infinity +LimitNPROC=infinity +Restart=on-failure +RestartSec=2 +StartLimitBurst=3 +TasksMax=infinity + +[Install] +WantedBy=multi-user.target +``` +4. Start the service with `sudo systemctl enable nomad && sudo systemctl start nomad`. # Resources - -