diff --git a/disk-check.nomad b/disk-check.nomad new file mode 100644 index 0000000..7caacc7 --- /dev/null +++ b/disk-check.nomad @@ -0,0 +1,18 @@ +job "disk-check" { + datacenters = ["dc1"] + type = "batch" + + group "check" { + count = 6 # Check all nodes + constraint { + distinct_hosts = true + } + task "df" { + driver = "raw_exec" + config { + command = "df" + args = ["-h"] + } + } + } +} diff --git a/entrypoint.sh b/entrypoint.sh index 2ae7a0e..1542f61 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -92,7 +92,7 @@ start_app() { # 3. Start Navidrome with ND_DBPATH environment variable. # This is the most authoritative way to set the DB location. - export ND_DBPATH="/data/navidrome.db?_busy_timeout=15000" + export ND_DBPATH="/litefs/navidrome.db?_busy_timeout=15000" /app/navidrome & NAVIDROME_PID=$! diff --git a/litefs.yml b/litefs.yml index 1d4526f..1da19f1 100644 --- a/litefs.yml +++ b/litefs.yml @@ -13,7 +13,7 @@ lease: advertise-url: "http://${ADVERTISE_IP}:20202" consul: url: "${CONSUL_URL}" - key: "litefs/navidrome" + key: "${LITEFS_CONSUL_KEY}" # Internal HTTP API for replication http: diff --git a/mnt-configs-check.nomad b/mnt-configs-check.nomad new file mode 100644 index 0000000..a9eb2be --- /dev/null +++ b/mnt-configs-check.nomad @@ -0,0 +1,18 @@ +job "mnt-configs-check" { + datacenters = ["dc1"] + type = "batch" + + group "check" { + count = 4 + constraint { + distinct_hosts = true + } + task "df" { + driver = "raw_exec" + config { + command = "df" + args = ["-h", "/mnt/configs"] + } + } + } +} diff --git a/navidrome-litefs.nomad b/navidrome-litefs.nomad index 734d8d9..0864b11 100644 --- a/navidrome-litefs.nomad +++ b/navidrome-litefs.nomad @@ -13,7 +13,7 @@ job "navidrome-litefs" { } group "navidrome" { - count = 4 + count = 3 update { max_parallel = 1 @@ -26,6 +26,12 @@ job "navidrome-litefs" { distinct_hosts = true } + constraint { + attribute = "${attr.unique.hostname}" + operator = "!=" + value = "odroid7" + } + network { # Request static ports on the host port "http" { @@ -48,19 +54,20 @@ job "navidrome-litefs" { force_pull = true volumes = [ - "/mnt/configs/navidrome_litefs:/var/lib/litefs", + "/mnt/configs/navidrome_litefs_v2:/var/lib/litefs", "/mnt/Public/configs/navidrome:/data", "/mnt/Public/Downloads/Clean_Music:/music/CleanMusic:ro", "/mnt/Public/Downloads/news/slskd/downloads:/music/slskd:ro", "/mnt/Public/Downloads/incoming_music:/music/incomingmusic:ro" ] - } + } - env { + env { # LiteFS Config CONSUL_URL = "http://${attr.unique.network.ip-address}:8500" ADVERTISE_IP = "${attr.unique.network.ip-address}" - PORT = "8080" # Internal proxy port (unused but kept) + LITEFS_CONSUL_KEY = "litefs/navidrome-v2" + PORT = "8080" # Internal proxy port (unused but kept)" # Navidrome Config ND_DATAFOLDER = "/data" diff --git a/odroid7-check.nomad b/odroid7-check.nomad new file mode 100644 index 0000000..366b5dd --- /dev/null +++ b/odroid7-check.nomad @@ -0,0 +1,19 @@ +job "odroid7-check" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.unique.hostname}" + value = "odroid7" + } + + group "check" { + task "df" { + driver = "raw_exec" + config { + command = "bash" + args = ["-c", "df -h; sleep 60"] + } + } + } +} diff --git a/odroid7-docker-check.nomad b/odroid7-docker-check.nomad new file mode 100644 index 0000000..259ea5e --- /dev/null +++ b/odroid7-docker-check.nomad @@ -0,0 +1,19 @@ +job "odroid7-docker-check" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.unique.hostname}" + value = "odroid7" + } + + group "check" { + task "ps" { + driver = "raw_exec" + config { + command = "docker" + args = ["ps", "--filter", "name=navidrome-litefs"] + } + } + } +} diff --git a/odroid8-check.nomad b/odroid8-check.nomad new file mode 100644 index 0000000..b47c97a --- /dev/null +++ b/odroid8-check.nomad @@ -0,0 +1,19 @@ +job "odroid8-check" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.unique.hostname}" + value = "odroid8" + } + + group "check" { + task "df" { + driver = "raw_exec" + config { + command = "df" + args = ["-h"] + } + } + } +} diff --git a/odroid8-disk-check.nomad b/odroid8-disk-check.nomad new file mode 100644 index 0000000..41dd9bd --- /dev/null +++ b/odroid8-disk-check.nomad @@ -0,0 +1,19 @@ +job "odroid8-disk-check" { + datacenters = ["dc1"] + type = "batch" + + constraint { + attribute = "${attr.unique.hostname}" + value = "odroid8" + } + + group "check" { + task "df" { + driver = "raw_exec" + config { + command = "bash" + args = ["-c", "df -h; sleep 60"] + } + } + } +}