Files
homework46/postgresql.conf.template

33 lines
786 B
Plaintext

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