diff --git a/defaults/main.yaml b/defaults/main.yaml index 214762a..77d2e64 100644 --- a/defaults/main.yaml +++ b/defaults/main.yaml @@ -54,17 +54,18 @@ patroni_wal_g_pg_binary_name: 'wal-g-pg' patroni_wal_g_config_name: ".walg.json" patroni_wal_g_restore_config_name: ".walg-restore.json" patroni_restore_script: "{{ patroni_postgresql_home_dir }}/restore.sh" -#patroni_postgresql_archive_command: "wal-g wal-push %p" -#patroni_postgresql_restore_command: "wal-g wal-fetch %f %p" -#patroni_cluster_bootstrap_command: "wal-g backup-fetch {{ patroni_wal_g_restore_backup_name }}" -## "restore_command" written to recovery.conf when configuring follower (create replica) -#patroni_cluster_restore_command: "wal-g wal-fetch %f %p" -#patroni_wal_g_create_replica_methods: -# - {option: "command", value: "{{ patroni_cluster_bootstrap_command }}"} -# - {option: "no_params", value: "True"} -#patroni_basebackup_create_replica_methods: -# - {option: "max-rate", value: "1000M"} -# - {option: "checkpoint", value: "fast"} +patroni_postgresql_archive_command: "wal-g wal-push %p" +patroni_postgresql_restore_command: "wal-g wal-fetch %f %p" +patroni_cluster_bootstrap_command: "wal-g backup-fetch LATEST" +patroni_cluster_restore_bootstrap_command: "wal-g backup-fetch {{ patroni_wal_g_restore_backup_name }}" +# "restore_command" written to recovery.conf when configuring follower (create replica) +patroni_cluster_restore_command: "wal-g wal-fetch %f %p" +patroni_wal_g_create_replica_methods: + - {option: "command", value: "{{ patroni_cluster_bootstrap_command }}"} + - {option: "no_params", value: "True"} +patroni_basebackup_create_replica_methods: + - {option: "max-rate", value: "1000M"} + - {option: "checkpoint", value: "fast"} # More examples # patroni_postgresql_restore_command: "pgbackrest --stanza={{ pgbackrest_stanza }} archive-get %f %p" # restore WAL-s using pgbackrest diff --git a/templates/restore.sh.j2 b/templates/restore.sh.j2 index 5c4c187..13d39db 100644 --- a/templates/restore.sh.j2 +++ b/templates/restore.sh.j2 @@ -1,2 +1,2 @@ #!/usr/bin/env bash -{{ patroni_cluster_bootstrap_command }} +{{ patroni_cluster_restore_bootstrap_command }}