数据库配置文件
max_connections = 500
shared_buffers = 2GB
temp_buffers = 64MB
work_mem = 64MB
max_stack_depth = 8MB
dynamic_shared_memory_type = posix
log_destination = 'stderr'
logging_collector = on
log_directory = 'pg_log'
log_filename = 'postgresql-%a.log'
log_truncate_on_rotation = on
log_rotation_age = 1440
log_rotation_size = 50MB
log_min_duration_statement = 2000
log_connections = on
log_disconnections = on
log_line_prefix = '<%m> '
log_timezone = 'PRC'
datestyle = 'iso, mdy'
timezone = 'PRC'
lc_messages = 'en_US.UTF-8'
lc_monetary = 'en_US.UTF-8'
lc_numeric = 'en_US.UTF-8'
lc_time = 'en_US.UTF-8'
default_text_search_config = 'pg_catalog.english'
port = 5431
fsync = off
max_wal_size = 4GB
checkpoint_timeout = 20min
synchronous_commit = off
listen_addresses = '*'
wal_level = replica
max_wal_senders = 5
wal_keep_segments = 1024
wal_log_hints = on
hot_standby = on
主备流复制流程
启动完成后,可以在主数据节点上,查看主备流复制的状态,命令select * from pg_stat_replication ;