listen_addresses = '*'
port = 5432
max_connections = 100
shared_buffers = 256MB
dynamic_shared_memory_type = posix
log_destination = 'stderr'
logging_collector = on
log_directory = 'log'
log_filename = 'postgresql-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1d
log_rotation_size = 0
log_line_prefix = '%m [%p] '
log_timezone = 'Asia/Seoul'
datestyle = 'iso, ymd'
timezone = 'Asia/Seoul'
lc_messages = 'ko_KR.UTF-8'
lc_monetary = 'ko_KR.UTF-8'
lc_numeric = 'ko_KR.UTF-8'
lc_time = 'ko_KR.UTF-8'
default_text_search_config = 'pg_catalog.simple'
wal_buffers = 8MB
max_wal_size = 1GB
min_wal_size = 80MB
checkpoint_completion_target = 0.9
# Replica 관련 설정
wal_level = replica
max_wal_senders = 2
wal_keep_segments = 32
wal_sender_timeout = 60s
CREATE USER replicator WITH REPLICATION ENCRYPTED PASSWORD 'secret';
*pg.hba.conf 설정
host replication replicator standbyIP/32 md5
pg_basebackup -h masterIP -U replicator -p 5432 -D /var/lib/pgsql/12/data/ -Xs -P -R
암호:
25527/25527 kB (100%), 1/1 테이블스페이스