v2.0.0
This commit is contained in:
15
roles/postgres/templates/pg_hba.conf.j2
Normal file
15
roles/postgres/templates/pg_hba.conf.j2
Normal file
@@ -0,0 +1,15 @@
|
||||
# PostgreSQL 16 pg_hba.conf - Host Based Authentication
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
|
||||
# Local connections
|
||||
local all postgres peer
|
||||
local all all peer
|
||||
|
||||
# Replication from pg2 (10.0.0.2)
|
||||
host replication replicator 10.0.0.2/32 md5
|
||||
|
||||
# Applications and MailArchiver
|
||||
host all all 10.0.0.0/24 md5
|
||||
|
||||
# IPv6 local
|
||||
host all all ::1/128 md5
|
||||
51
roles/postgres/templates/postgresql.conf.j2
Normal file
51
roles/postgres/templates/postgresql.conf.j2
Normal file
@@ -0,0 +1,51 @@
|
||||
# PostgreSQL Configuration for Production
|
||||
# Debian 13 - najnowsza dostępna wersja
|
||||
# Primary: pg1, Replica: pg2
|
||||
|
||||
# --- Network ---
|
||||
listen_addresses = '*'
|
||||
max_connections = 200
|
||||
port = 5432
|
||||
|
||||
# --- Memory (dla 8GB RAM) ---
|
||||
shared_buffers = 2GB
|
||||
effective_cache_size = 6GB
|
||||
work_mem = 64MB
|
||||
maintenance_work_mem = 1GB
|
||||
|
||||
# --- WAL and Logging ---
|
||||
wal_level = replica
|
||||
wal_compression = on
|
||||
max_wal_senders = 10
|
||||
max_replication_slots = 10
|
||||
wal_keep_size = 10GB
|
||||
|
||||
# --- Archiving (dla pgBackRest) ---
|
||||
archive_mode = on
|
||||
archive_command = 'pgbackrest --stanza=main archive-push %p'
|
||||
archive_timeout = 300
|
||||
|
||||
# --- Checkpoints ---
|
||||
checkpoint_timeout = 15min
|
||||
checkpoint_completion_target = 0.9
|
||||
max_wal_size = 64GB
|
||||
min_wal_size = 16GB
|
||||
|
||||
# --- Logging ---
|
||||
log_directory = '/var/log/postgresql'
|
||||
log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
|
||||
log_truncate_on_rotation = on
|
||||
log_rotation_age = 1d
|
||||
log_rotation_size = 100MB
|
||||
log_min_duration_statement = 1000
|
||||
log_connections = on
|
||||
log_disconnections = on
|
||||
log_duration = off
|
||||
|
||||
# --- Replication slots ---
|
||||
max_replication_slots = 10
|
||||
|
||||
# --- Performance ---
|
||||
random_page_cost = 1.1
|
||||
effective_io_concurrency = 200
|
||||
synchronous_commit = local
|
||||
Reference in New Issue
Block a user