vault backup: 2024-10-07 14:53:40

This commit is contained in:
zleyyij 2024-10-07 14:53:40 -06:00
parent 2fd51d50eb
commit f9f0da665f

View File

@ -32,8 +32,8 @@ https://developer.hashicorp.com/nomad/tutorials/get-started/gs-install#install-t
## Creating a single node cluster
<https://stackoverflow.com/questions/56112422/nomad-configuration-for-single-node-to-act-as-production-server-and-client>
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
- <https://developer.hashicorp.com/nomad/tutorials/get-started/gs-overview>
- <https://developer.hashicorp.com/nomad/docs/drivers>