Hi Lucas,
if you read one of my previous emails I explained how you can do that.

I recall down here part of what I wrote, see specifically point 5b:

[…]

3.       Add your source db to bucardo (bucardo add db A, with tables etc)
bucardo add db db_A dbhost=myhost dbport=5432 dbname=mydbname dbuser=mydbuser 
dbpass=mydbpassword

4.       Add your target db to bucardo (bucardo add db B, with tables etc)
bucardo add db db_B dbhost=myhost_B dbport=5432 dbname=mydbname dbuser=mydbuser 
dbpass=mydbpassword

5.       Create a sync that has:

a.       database A as source, database B as target if you want a master to 
slave replication
bucardo add dbgroup grp_m2s_mydbname db_A:source db_B:target
bucardo add sync sync_mydbname_m2s dbs=grp_m2s_mydbname [‘tables=’]

b.       both databases as source if you want a master to master replication 
(you should choose a conflit resolution strategy,  I use “bucardo_latest”)
bucardo add dbgroup grp_m2m_mydbname db_A:source db_B:source
bucardo add sync sync_mydbname_m2m dbs=grp_m2m_mydbname 
conflict_strategy=bucardo_latest [‘tables=’]

More precisely I created a dbgroup with both databases, and then I add that 
dbgroup to the sync.
The “tables” parameter is optional, to specify a subset of tables to be 
replicated (comma separated).

6.       Start bucardo
[…]


Hope it can help,
regards.

Mattia

From: Bucardo-general <[email protected]> On Behalf Of Lucas 
Possamai
Sent: giovedì 27 maggio 2021 01:15
To: [email protected]
Subject: [Bucardo-general] Bucardo with two way replication

Hello all,

As you may have seen from my previous emails, I'm working on a migration from 
EC2 Instance PostgreSQL 9.2 to RDS PostgreSQL 12, and since I cannot have any 
downtime, I'm using Bucardo for that.

Previously, we were going to set up Bucardo, perform tests and we would move 
all customers at once to RDS. Now, the business decided that is risky and we 
wanna migrate a few customers over at a time. However, whatever these customers 
do in RDS, the data must be replicated back to the master 9.2.

Example:

source db (PG 9.2) --> Bucardo --> target db (PG 12)
target db (PG 12) --> Bucardo --> source db (PG 9.2)

So, it means that I'll need a two way replication set up.

I couldn't find anything online about this process. Does anybody have any 
suggestions or steps to follow, please?

Regards,
Lucas
_______________________________________________
Bucardo-general mailing list
[email protected]
https://bucardo.org/mailman/listinfo/bucardo-general

Reply via email to