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