主库配置
修改pg_hba.conf
local replication postgres trust
host replication postgres 127.0.0.1/32 trust
host replication postgres ::1/128 trust
修改postgresql.conf
wal_level = hot_standby --WAL记录级别
--or wal_level = archive
max_wal_senders = 1 --允许几个链接读取WAL记录
执行
pg_basebackup -D basegd/ -R --备份至目录basegb -R生成recovery.conf文件
显示为
NOTICE: WAL archiving is not enabled; you must ensure that all required WAL segments are copied through other means to complete the backup
继续编辑postgresql.conf
archive_mode = on
archive_command = 'cp %p /home/postgre/archiv