One of the beauties of PostgreSQL is that it supports cascaded replication. There is no limit to the number of cascaded replicas you could add. For example, consider a master M1 replicating to standby S2, and standby S2 replicating to standby S3, and standby S3 replicating to standby S4, and so on until standby N where N has no limit. In this recipe, we shall see how cascaded replica can be added to an existing streaming replication setup.
Getting ready...
In order to add a cascaded replica, we need an existing master-standby replication setup. The recipe Setting up streaming replication in PostgreSQL 13, can be used to create such a setup. Once the setup is completed, we need to provision a server with PostgreSQL 13 installed.
How to do it ...
We will add the replica using the following steps:
- Allow replication connections from the new standby to its master/upstream. Let's say 192.168.90.70 is the new standby:
$ echo "host replication replicator...