Contents
How to rebuild an inconsistent PostgreSQL slave?
As ClusterControl users all we have to do is to go to the “Nodes” tab and run “Rebuild Replication Slave” job. Next, we have to pick the node to rebuild slave from and that is all. ClusterControl will use pg_basebackup to set up the replication slave and configure the replication as soon as the data is transferred.
How to check the replication status of Postgres?
I use following SQL queries to check status on Postgres v11 usually. On your master, pg_stat_replication provides data about ongoing replication: Thanks for contributing an answer to Stack Overflow! Please be sure to answer the question. Provide details and share your research!
Why is my PostgreSQL slave out of sync?
It still may happen that the slave would go out of sync with the master. Data corruption – neither hardware or software is without bugs and issues. Some problems with the disk drive may trigger data corruption on the slave. Some problems with the “vacuum” process may result in data being altered.
How does streaming replication work in PostgreSQL cluster?
PostgreSQL Streaming Replication is a great way of scaling PostgreSQL clusters and doing it adds high availability to them. As with every replication, the idea is that the slave is a copy of the master and that the slave is constantly updated with the changes that happened on the master using some sort of a replication mechanism.
How to do reverse replication in PostgreSQL database?
As you can see, the reverse replication did not occur automatically. Go to old master (new secondary) to install replication again between new master and new secondary server. It makes more sense to copy the recovery.done file in the new master from the new primary server to the new secondary with the following script.
What does recovery mean in PostgreSQL failover?
If recovery.conf file changed to recovery.done, it means that failover process completed succesfully. As you can see, the reverse replication did not occur automatically. Go to old master (new secondary) to install replication again between new master and new secondary server.
How to fix streaming replication in PostgreSQL 9.3?
The two important options for dealing with the WAL for streaming replication: wal_keep_segments should be set high enough to allow a slave to catch up after a reasonable lag (e.g. high update volume, slave being offline, etc…). archive_mode enables WAL archiving which can be used to recover files older than wal_keep_segments provides.