我想设置 PostgreSQL 流复制,但出现以下错误:
FATAL: could not receive data from WAL stream:
ERROR: requested WAL segment 00000001000000000000006A has already been removed.
Run Code Online (Sandbox Code Playgroud)
主控IP:192.168.0.30
从机IP:192.168.0.36
关于大师:
我创建了一个rep
仅用于复制的用户。
Postgres config 目录( )内的相关文件/opt/Postgres/9.3/data
:
pg_hba.conf
:
host replication rep 192.168.0.36/32 trust
Run Code Online (Sandbox Code Playgroud)
postgresql.conf
:
listen_addresses = 'localhost,192.168.0.30'
wal_level = 'hot_standby'
archive_mode = on
archive_command = 'cd .'
max_wal_senders = 1
hot_standby = on
Run Code Online (Sandbox Code Playgroud)
我已经重新启动了该postgres
服务。
在从机上:
我已停止该postgres
服务,然后将更改应用于两个文件:
pg_hba.conf
:
host replication rep 192.168.0.30/32 trust
Run Code Online (Sandbox Code Playgroud)
postgresql.conf
:
listen_addresses = 'localhost,192.168.0.36'
wal_level …
Run Code Online (Sandbox Code Playgroud)