Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Cannot setup logical replication (alloydb postgres subscription to an EC2 publisher)

Fairly new to alloydb and am running into some challenges .

I have and EC2 instance running postgres. I am trying to get logical replication working using native logical replication and NOT pglogical .


My network rules allows connection from both alloydb and ec2. I can access alloydb via psql from the ec2 instance. Obviously I cannot test the other way around. But the IP of the alloydb is part of my rules in EC2 and hba file.


I have a publication created on the ec2 instance
when i try to create a subscription on the alloydb, connection fails and times out.
I have tried various ways of simulating a connection from alloydb to the ec2 instance.  All of the following fail.

  • create subscription
  • fdw
  • dblinks

all of the above approaches fail to connect. It seems like a firewall issue or rule but that is not the case since i can ..

  • connect from ec2 to alloydb via psql
  • I removed all security rules from ec2 for testing. in other words, it is open to the world and still cannot connect from alloydb

One other thing,  the alloydb instance does not allow me to set the flag wal_level. It defaults to replica and i cannot change it to logical.

Thanks

0 1 282
1 REPLY 1

Hello , 

Welcome to Google Cloud Community!

Logical replication requires that the wal_level configuration parameter be set to logical. In AlloyDB it doesn't allow  setting this directly, instead  you must set alloydb.logical_decoding=on.