Master the setup of a PostgreSQL BDR (Bi-Directional Replication) cluster for Multi-Master Replication. This guide walks you through installing EPAS (EnterpriseDB Postgres Advanced Server), configuring multiple instances, and achieving a robust distributed database system with high availability.
Install EPAS
Make sure to install the edb postgres (epas) server before installing the bdr. You can also install bdr with postgres but for this setup I am setting it up for the epas. Use this link to install epas on ubuntu. https://www.enterprisedb.com/docs/epas/latest/installing/
Note that in order to access the edb bdr and epass you should have the access to the edb repository and only then you would be able to install the packages. Take a look https://www.enterprisedb.com/docs/repos/getting_started/with_cli/adding_edb_repositories/ and add the edb repo.
Setting up PGD
Also take a look at the edb distributed postgres setup documentation for a detailed look . https://www.enterprisedb.com/docs/pgd/latest/deploy-config/deploy-manual/deploying/04-installing-software/
Install Packages
Install the bdr packages. You may install the proxies but we will not setting up the proxies in this setup.
Setting up clusters
Lets create some bash var that will be helpful in setting up the clusters.
Bellow is a script for setting up three data clusters and then setting up the bdr extension.
Node 1
Node 2
Node 3
Make a Distributed Cluster
Now we need to run some commands on seperate nodes. First, lets run the command on the first node.
Run this on the second data node
Run this on third data node
Now let add some data on any node and check if the data is bieng replicated
You may check the status by using these utilit;
Комментарии