Migrate sonarr to postgresql
And increase postgresql memory to accomodate
This commit is contained in:
parent
a9a919b8f2
commit
e6653f6495
26
.terraform.lock.hcl
generated
26
.terraform.lock.hcl
generated
@ -2,21 +2,21 @@
|
||||
# Manual edits may be lost in future updates.
|
||||
|
||||
provider "registry.terraform.io/hashicorp/nomad" {
|
||||
version = "2.1.1"
|
||||
version = "2.2.0"
|
||||
hashes = [
|
||||
"h1:liQBgBXfQEYmwpoGZUfSsu0U0t/nhvuRZbMhaMz7wcQ=",
|
||||
"zh:28bc6922e8a21334568410760150d9d413d7b190d60b5f0b4aab2f4ef52efeeb",
|
||||
"zh:2d4283740e92ce1403875486cd5ff2c8acf9df28c190873ab4d769ce37db10c1",
|
||||
"zh:457e16d70075eae714a7df249d3ba42c2176f19b6750650152c56f33959028d9",
|
||||
"zh:49ee88371e355c00971eefee6b5001392431b47b3e760a5c649dda76f59fb8fa",
|
||||
"zh:614ad3bf07155ed8a5ced41dafb09042afbd1868490a379654b3e970def8e33d",
|
||||
"zh:75be7199d76987e7549e1f27439922973d1bf27353b44a593bfbbc2e3b9f698f",
|
||||
"h1:BAjqzVkuXxHtRKG+l9unaZJPk2kWZpSTCEcQPRcl2so=",
|
||||
"zh:052f909d25121e93dc799290216292fca67943ccde12ba515068b838a6ff8c66",
|
||||
"zh:20e29aeb9989f7a1e04bb4093817c7acc4e1e737bb21a3066f3ea46f2001feff",
|
||||
"zh:2326d101ef427599b72cce30c0e0c1d18ae783f1a897c20f2319fbf54bab0a61",
|
||||
"zh:3420cbe4fd19cdc96d715d0ae8e79c272608023a76033bbf582c30637f6d570f",
|
||||
"zh:41ec570f87f578f1c57655e2e4fbdb9932d94cf92dc9cd11828cccedf36dd4a4",
|
||||
"zh:5f90dcc58e3356ffead82ea211ecb4a2d7094d3c2fbd14ff85527c3652a595a2",
|
||||
"zh:64aaa48609d2db868fcfd347490df0e12c6c3fcb8e4f12908c5d52b1a0adf73f",
|
||||
"zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3",
|
||||
"zh:888e14a24410d56b37212fbea373a3e0401d0ff8f8e4f4dd00ba8b29de9fed39",
|
||||
"zh:aa261925e8b152636a0886b3a2149864707632d836e98a88dacea6cfb6302082",
|
||||
"zh:ac10cefb4064b3bb63d4b0379624a416a45acf778eac0004466f726ead686196",
|
||||
"zh:b1a3c8b4d5b2dc9b510eac5e9e02665582862c24eb819ab74f44d3d880246d4f",
|
||||
"zh:c552e2fe5670b6d3ad9a5faf78e3a27197eeedbe2b13928d2c491fa509bc47c7",
|
||||
"zh:86b4923e10e6ba407d1d2aab83740b702058e8b01460af4f5f0e4008f40e492c",
|
||||
"zh:ae89dcba33097af33a306344d20e4e25181f15dcc1a860b42db5b7199a97c6a6",
|
||||
"zh:ce56d68cdfba60891765e94f9c0bf69eddb985d44d97db9f91874bea027f08e2",
|
||||
"zh:e993bcde5dbddaedf3331e3014ffab904f98ab0f5e8b5d6082b7ca5083e0a2f1",
|
||||
]
|
||||
}
|
||||
|
||||
|
@ -41,12 +41,6 @@ all:
|
||||
group: "bin"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
- name: sonarr-data
|
||||
path: /srv/volumes/sonarr
|
||||
owner: "root"
|
||||
group: "bin"
|
||||
mode: "0755"
|
||||
read_only: false
|
||||
pi4:
|
||||
nomad_node_role: both
|
||||
nomad_node_class: ingress
|
||||
|
@ -112,6 +112,9 @@
|
||||
- name: nzbget-config
|
||||
path: /srv/volumes/nas-container/nzbget
|
||||
read_only: false
|
||||
- name: sonarr-config
|
||||
path: /srv/volumes/nas-container/sonarr
|
||||
read_only: false
|
||||
- name: lidarr-config
|
||||
path: /srv/volumes/nas-container/lidarr
|
||||
read_only: false
|
||||
|
@ -90,9 +90,6 @@ nomad/jobs/immich:
|
||||
db_name: VALUE
|
||||
db_pass: VALUE
|
||||
db_user: VALUE
|
||||
nomad/jobs/ipdvr/radarr:
|
||||
db_pass: VALUE
|
||||
db_user: VALUE
|
||||
nomad/jobs/lego:
|
||||
acme_email: VALUE
|
||||
domain_lego_dns: VALUE
|
||||
@ -132,6 +129,10 @@ nomad/jobs/redis-blocky:
|
||||
allowed_psks: VALUE
|
||||
nomad/jobs/rediscommander:
|
||||
redis_stunnel_psk: VALUE
|
||||
nomad/jobs/sonarr:
|
||||
db_name: VALUE
|
||||
db_pass: VALUE
|
||||
db_user: VALUE
|
||||
nomad/jobs/traefik:
|
||||
external: VALUE
|
||||
usersfile: VALUE
|
||||
|
@ -11,25 +11,37 @@ job "sonarr" {
|
||||
}
|
||||
|
||||
task "Backup main database" {
|
||||
sqlite "Backup database" {
|
||||
path = "/data/sonarr/sonarr.db"
|
||||
dump_to = "/data/sonarr/Backups/sonarr.db.bak"
|
||||
postgres "Backup database" {
|
||||
hostname = env("POSTGRES_HOST")
|
||||
port = env("POSTGRES_PORT")
|
||||
username = env("POSTGRES_USER")
|
||||
password = env("POSTGRES_PASSWORD")
|
||||
database = "sonarr"
|
||||
no_tablespaces = true
|
||||
dump_to = "/data/nas-container/sonarr/Backups/dump-sonarr.sql"
|
||||
}
|
||||
}
|
||||
|
||||
task "Backup logs database" {
|
||||
sqlite "Backup database" {
|
||||
path = "/data/sonarr/logs.db"
|
||||
dump_to = "/data/sonarr/Backups/logs.db.bak"
|
||||
postgres "Backup database" {
|
||||
hostname = env("POSTGRES_HOST")
|
||||
port = env("POSTGRES_PORT")
|
||||
username = env("POSTGRES_USER")
|
||||
password = env("POSTGRES_PASSWORD")
|
||||
database = "sonarr-logs"
|
||||
no_tablespaces = true
|
||||
dump_to = "/data/nas-container/sonarr/Backups/dump-sonarr-logs.sql"
|
||||
}
|
||||
}
|
||||
|
||||
backup {
|
||||
paths = ["/data/sonarr"]
|
||||
paths = ["/data/nas-container/sonarr"]
|
||||
|
||||
backup_opts {
|
||||
Exclude = [
|
||||
"sonarr_backup_*.zip",
|
||||
"/data/nas-container/sonarr/MediaCover",
|
||||
"/data/nas-container/sonarr/logs",
|
||||
"*.db",
|
||||
"*.db-shm",
|
||||
"*.db-wal",
|
||||
|
@ -73,7 +73,8 @@ POSTGRES_PASSWORD={{ .superuser_pass }}
|
||||
|
||||
resources {
|
||||
cpu = 500
|
||||
memory = 600
|
||||
memory = 700
|
||||
memory_max = 1200
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@ module "sonarr" {
|
||||
source = "./service"
|
||||
|
||||
name = "sonarr"
|
||||
image = "lscr.io/linuxserver/sonarr:4.0.0"
|
||||
image = "lscr.io/linuxserver/sonarr:4.0.2"
|
||||
|
||||
priority = 55
|
||||
|
||||
@ -13,6 +13,15 @@ module "sonarr" {
|
||||
"authelia@nomad"
|
||||
]
|
||||
|
||||
use_postgres = true
|
||||
postgres_bootstrap = {
|
||||
enabled = true
|
||||
databases = [
|
||||
"sonarr",
|
||||
"sonarr-logs",
|
||||
]
|
||||
}
|
||||
|
||||
env = {
|
||||
PGID = 100
|
||||
PUID = 1001
|
||||
@ -21,7 +30,7 @@ module "sonarr" {
|
||||
|
||||
host_volumes = [
|
||||
{
|
||||
name = "sonarr-data"
|
||||
name = "sonarr-config"
|
||||
dest = "/config"
|
||||
read_only = false
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user