I'm trying to setup asynchronous replication of a PostgreSQL (TimescaleDB) database. I've been following numerous of guides, and even after trying things from documentation it doesn't seem to work. I config everything on main and db works. Then I go to the replica setup things there and I can do manual backup but automatic straming never happens. There is no information about "WAL" in the logs. I had to setup something wrong, but it's strange because as I said manual backup works.
I checked everything and tried few times. And replica slot on main is never active. What am I missing?
Here are logs from replica Logs from replica
Manual BP can be done Manual BP
On main slots aren't active Main node
2 Answers 2
database system is ready to accept connections
Exactly accept connections
, not
database system is ready to accept read only connections
Which means you started a new primary server, not replication. Also there was no entering standby mode
message.
You need to make another base backup and start in standby mode: put empty standby.signal
file in the data directory. pg_basebackup
with option -R
can place this file and write corresponding primary_conninfo
to postgresql.auto.conf
As Melkij describes, you didn't do anything to put it into streaming mode, so all you have is a detached clone, not a replica. The eaiest way to configure it for streaming would be to give -R
to pg_basebackup
, although you could have modified the new directory by hand if you wanted.
And similarly, the slots aren't in use because you did nothing to put them into use. If you had add to pg_basebackup -R
another option asking it to use a named slot, it will use it both for taking the backup itself and (via changes made to postgresql.auto.conf) for running the replica.
Explore related questions
See similar questions with these tags.