cluster/services/patroni: set external waldir
This commit is contained in:
parent
08bf35647d
commit
53d283c918
1 changed files with 9 additions and 1 deletions
|
@ -10,6 +10,8 @@ let
|
||||||
pg = pkgs.postgresql_14;
|
pg = pkgs.postgresql_14;
|
||||||
|
|
||||||
baseDir = "/srv/storage/database/postgres-ha";
|
baseDir = "/srv/storage/database/postgres-ha";
|
||||||
|
|
||||||
|
walDir = "/var/lib/postgres-ha/${pg.psqlSchema}/wal";
|
||||||
in
|
in
|
||||||
|
|
||||||
{
|
{
|
||||||
|
@ -24,7 +26,10 @@ in
|
||||||
group = "patroni";
|
group = "patroni";
|
||||||
}) vars.patroni.passwords;
|
}) 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 = {
|
services.patroni = {
|
||||||
enable = true;
|
enable = true;
|
||||||
name = vars.hostName;
|
name = vars.hostName;
|
||||||
|
@ -52,6 +57,9 @@ in
|
||||||
};
|
};
|
||||||
failsafe_mode = true;
|
failsafe_mode = true;
|
||||||
postgresql = {
|
postgresql = {
|
||||||
|
basebackup = {
|
||||||
|
waldir = walDir;
|
||||||
|
};
|
||||||
use_pg_rewind = true;
|
use_pg_rewind = true;
|
||||||
use_slots = true;
|
use_slots = true;
|
||||||
authentication = {
|
authentication = {
|
||||||
|
|
Loading…
Reference in a new issue