From 53d283c91811c9e993ea4f9493b69a091431bf29 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 23 Aug 2023 00:59:53 +0200 Subject: [PATCH] cluster/services/patroni: set external waldir --- cluster/services/patroni/worker.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cluster/services/patroni/worker.nix b/cluster/services/patroni/worker.nix index e4aca90..4413d48 100644 --- a/cluster/services/patroni/worker.nix +++ b/cluster/services/patroni/worker.nix @@ -10,6 +10,8 @@ let pg = pkgs.postgresql_14; baseDir = "/srv/storage/database/postgres-ha"; + + walDir = "/var/lib/postgres-ha/${pg.psqlSchema}/wal"; in { @@ -24,7 +26,10 @@ in group = "patroni"; }) vars.patroni.passwords; - systemd.tmpfiles.rules = [ "d '${baseDir}' 0700 patroni patroni - -" ]; + systemd.tmpfiles.rules = [ + "d '${baseDir}' 0700 patroni patroni - -" + "d '${walDir}' 0700 patroni patroni - -" + ]; services.patroni = { enable = true; name = vars.hostName; @@ -52,6 +57,9 @@ in }; failsafe_mode = true; postgresql = { + basebackup = { + waldir = walDir; + }; use_pg_rewind = true; use_slots = true; authentication = {