How to make Asynchronization between two PostgreSQL databases

Keywords: PostgreSQL - Linux - How to - Other
Description:
i have two database, one is local, its version is PostgreSQL 9.5.11, and one is on remote cloud installed with bitnami odoo stack installer for Linux, its version is PostgreSQL 10.1 , and after i tried to use bucardo to make replication, it’s successfully added the two databases information to bucardo:

bucardo add db localDB dbhost=$PGHOST dbport=$PGPORT dbname=$PGDATABASE dbuser=$PGSUPERUSER dbpass=$PGSUPERPASS 

bucardo add db remoteDB dbhost=$PGHOST dbport=$PGPORT dbname=$PGDATABASE dbuser=$PGSUPERUSER dbpass=$PGSUPERPASS

then added the tables of the local database to bucardo successfully:

sudo bucardo add all tables db=localDB

result

559 tables added successfuly

but when trying to add tables in remote server its gives me nothing, its hang and stop working:

sudo bucardo add all tables db=remoteDB

result

_

my question is: how to connect to remote database to make Asynchronization.

Hi,

Does bucardo require the remote database to be publicly accessible? In that case, you need to open the PostgreSQL port for public access. By default, for security reasons, the PostgreSQL database will not allow remote connections: https://docs.bitnami.com/aws/components/postgresql/#how-to-connect-to-postgresql-from-a-different-machine

You would need to edit postgresql.conf (look for it in /opt/bitnami/postgresql) and edit the listen_adrresses field and also edit the pg_hba.conf file to change the list of trusted addresses.

Hope it helps.

Best regards,

Javier J. Salmerón


Was my answer helpful? Click on :heart:

1 Like

Hi,

Thank you, i did solve it by adding tables to bucardo one by one, not all tables on time

bucardo add tables table1, table2, table3, … db=database2

Hi,

Good to know! If you find any other issues, do not hesitate to open a new ticket :slight_smile:

Best regards,

Javier J. Salmerón


Was my answer helpful? Click on :heart:

1 Like