Загрузить файлы в «/»

This commit is contained in:
2026-07-02 20:50:29 +03:00
parent 058d9d549b
commit 367c117f68
3 changed files with 51 additions and 0 deletions

10
pg-server.conf.template Normal file
View File

@@ -0,0 +1,10 @@
[pg-server]
conninfo = host={{ master_ip }} user={{ backup_user }} dbname=postgres password={{ backup_password }}
streaming_conninfo = host={{ master_ip }} user={{ backup_stream_user }} password={{ bcakup_stream_password }}
backup_method = postgres
archiver = off
streaming_archiver = on
slot_name = barman_slot
create_slot = auto

8
pg_hba.template Normal file
View File

@@ -0,0 +1,8 @@
local all postgres peer
local all all peer
host all all 127.0.0.1/32 scram-sha-256
host all all ::1/128 scram-sha-256
host replication {{ replication_user }} 10.0.0.10/32 scram-sha-256
host replication {{ replication_user }} 10.0.0.11/32 scram-sha-256
host replication {{ backup_stream_user }} 10.0.0.12/32 scram-sha-256
host all {{ backup_user }} 10.0.0.12/32 scram-sha-256

33
postgresql.conf.template Normal file
View File

@@ -0,0 +1,33 @@
data_directory = '/var/lib/postgresql/14/main'
hba_file = '/etc/postgresql/14/main/pg_hba.conf'
ident_file = '/etc/postgresql/14/main/pg_ident.conf'
listen_addresses = '*'
port = 5432
max_connections = 100
wal_level = replica
wal_log_hints = on
max_wal_senders = 10
max_replication_slots = 10
hot_standby = on
hot_standby_feedback = on
{% if inventory_hostname == 'sql-master' %}
primary_slot_name = 'standby_slot'
{% else %}
primary_conninfo = 'host={{ master_ip }} port=5432 user={{ replication_user }} password={{ replication_password }} application_name=standby1'
primary_slot_name = 'standby_slot'
{% endif %}
{% if inventory_hostname == 'sql-master' %}
archive_mode = on
archive_command = '/bin/true'
{% endif %}
wal_keep_size = 1024
max_slot_wal_keep_size = 1024