I have the following requirements for replication:
- There is a primary server, which does all data modification.
- There is a secondary server, usable for read-only queries, up-to-date within a minute or so.
- The primary can access the secondary over the network, but the secondary cannot reach the primary.
The one-way access requirement is the one that causes the difficulty for the replication methods described in the documentation.
Ideally the solution should work using packages available in Debian Stable.
You may use log shipping only (not streaming replication) with
archive_timeout
set to 60 seconds.This delay is referred to in the doc as an acceptable minimum. Quotes:
Running read-only queries on such a slave is a different problem. The doc says to set
wal_level
tohot_standby
:Once
hot_standby
is on, the communication with the primary is supposed to work too. The various settings that control it likewal_receiver_status_interval
,wal_receiver_timeout
,max_standby_streaming_delay
can be disabled one by one, but it's not mentioned in the doc that we may just disable the mechanism as a whole.As an experiment, it might be interesting to see what happens when the connection to a primary is perpetually down (as opposed to temporarily down, which the standby should deal with for the sake of robustness). But as the normal operating mode for a production server that seems weird.