A Postgres cluster with a primary and a streaming replica, one Barman server, and any number of additional replicas cascaded from the first one. This architecture is suitable for testing, demonstrating and learning. We plan to release a production primary/standby architecture for TPA in the near future.

In default configuration this architecture uses open source software only. To use subscription-only EDB software with this architecture requires credentials for EDB Repos 1.0. If you choose EDB Advanced Server (EPAS) you will also require credentials for the legacy 2ndQuadrant repos. See How TPA uses 2ndQuadrant and EDB repositories for more detail on this topic.

Default layout

By default, the primary has one read-only replica attached in the same location; the replica, in turn, has one cascaded replica attached in a different location, where the Barman server is also configured to take backups from the primary.

Cluster with cascading replication

If there is an even number of Postgres nodes, the Barman node is additionally configured as a witness. This ensures that the number of nodes is always odd, which is convenient when enabling automatic failover.

Cluster configuration

Overview of configuration options

An example invocation of tpaexec configure for this architecture is shown below.

tpaexec configure ~/clusters/m1 \
         --architecture M1 \
         --platform aws --region eu-west-1 --instance-type t3.micro \
         --distribution Debian \
         --postgresql 14

You can list all available options using the help command.

tpaexec configure --architecture M1 --help

The tables below describe the mandatory options for M1 and additional important options. More detail on the options is provided in the following section.

Mandatory Options

ParameterDescription
--architecture (-a)Must be set to M1.
Postgres flavour and version (e.g. --postgresql 15)A valid flavour and version specifier.


Additional Options

ParameterDescriptionBehaviour if omitted
--platformOne of aws, docker, bare.Defaults to aws.
--num-cascaded-replicasThe number of cascaded replicas from the first replica.Defaults to 1.
--failover-managerSelect the failover manager from efm, repmgr and patroni.TPA will select EFM
as the failover manager
for EPAS, and repmgr
for all other flavours.
--enable-efmConfigure Failover Manager as the cluster failover manager.See --failover-manager above.
--enable-repmgrConfigure Replication Manager as the cluster failover manager.See --failover-manager above.
--enable-patroniConfigure Patroni as the cluster failover manager.See --failover-manager above.
--enable-haproxy2 additional nodes will be added as a load balancer layer.
Only supported with Patroni as the failover manager.
HAproxy nodes will not be added to the cluster.
--patroni-dcsSelect the Distributed Configuration Store backend for patroni.
Only option is etcd at this time.
Only supported with Patroni as the failover manager.
Defaults to etcd.


More detail about M1 configuration

You may optionally specify --num-cascaded-replicas N to request N cascaded replicas (including 0 for none; default: 1).

You may also specify any of the options described by tpaexec help configure-options.