How to use physical and logical replication in Patroni together?

613 Views Asked by At

I want to construct cluster like this:

  • 3 MAIN nodes linked by physical replication
  • N OTHER nodes that receiving data from MAIN nodes via logical replication

I successfully configured physical replication between 3 MAIN nodes, but I did't go far. I must note that I specify "logical" value for "wal_level" fields for all nodes in my cluster. But when I try to create subscription at any OTHER node I got error like this: "logical decoding cannot be used while in recovery".

Can anybody help me please?

1

There are 1 best solutions below

0
On

I solve it.
Just for connection use primary node address.
It is look something like this:
You have 3 MAIN node linked by Patroni physical HA;
You also have N OTHER nodes where each of this is self primary (it is independent of the MAIN nodes).
On an OTHER nodes you must create subscription to the current primary from MAIN nodes.
Note, that you can have right user permissions for REPLICATION.