Installation Instructions for BDR
Note: These instructions are for BDR1 running against PostgreSQL 9.4. BDR1 and PostgreSQL 9.4 will reach EOL in December 2019. We strongly recommend using the latest BDR version.
BDR is available as RPMs via yum for Fedora, CentOS, & RHEL, and as DEBs via apt for Debian and Ubuntu, or as source code here.
YUM Repository for BDR
The instructions below are valid for Red Hat family of operating systems (RHEL, CentOS, Fedora). Repository URL is: https://rpm.2ndquadrant.com/
You may be prompted to accept the repository GPG key for package signing. If so, accept the key by pressing ‘y’ then enter. (It’s signed by the 2ndQuadrant master packaging key, if you want to verify that.)
Next step is to install BDR. In order to do that, you should first install the repository RPM for your distro and ‘BDR PostgreSQL 9.4’ version.
- Locate the repository RPM for your PostgreSQL version from the list at: https://rpm.2ndquadrant.com/
- Install the repository RPM for your distribution (this enables the 2ndQuadrant repository as a source of BDR packages).
For example, on CentOS 7, execute:
sudo yum install https://rpm.2ndquadrant.com/site/content/2ndquadrant-repo-bdr9.4-1-1.el7.noarch.rpm
Verify that the repository is installed with:
sudo yum repolist
Once the repository is installed, you can proceed to BDR.
Remove The postgresql94 Packages
(If you don’t already have PostgreSQL 9.4 installed, simply skip this step)
BDR requires a patched version of PostgreSQL 9.4 that conflicts with the official packages from yum.postgresql.org. If you already have PostgreSQL 9.4installed from yum.postgresql.org, you will need to make a dump of all your databases, then uninstall the PGDG PostgreSQL 9.4 packages before you can install BDR.
The BDR RPMs cannot co-exist with stock PostgreSQL 9.4, and BDR does not share the same data directory as stock 9.4, so it will not be able to read your existing databases. (They will not be deleted, and uninstalling BDR then reinstalling stock PGDG 9.4 will get you access to them again, but it is strongly recommended that you dump them before installing BDR).
Once you have fully backed up all your databases:
yum remove postgresql94*
Check the list of packages to be removed carefully, approve the removal if appropriate, and proceed with the removal.
Your data directory for PostgreSQL 9.4 will still exist in /var/lib/pgsql/9.4 but will not be used while BDR is installed.
Install the BDR packages
To install the BDR-enabled PostgreSQL server, BDR extension, and the client programs, simply:
sudo yum check-update sudo yum install postgresql-bdr94-bdr
APT Repository for BDR
The instructions below are valid for Debian and all Linux flavors based on Debian (e.g. Ubuntu).
- Add the http://apt.postgresql.org/ repository. See the site for instructions.
- If not already present, install the apt-transport-https package:
sudo apt-get install apt-transport-https
- Create /etc/apt/sources.list.d/2ndquadrant.list as follows:
sudo sh -c 'echo "deb https://apt.2ndquadrant.com/ $(lsb_release -cs)-2ndquadrant main" > /etc/apt/sources.list.d/2ndquadrant.list'
- Install the 2ndQuadrant repository key:
sudo apt-get install curl ca-certificates curl https://apt.2ndquadrant.com/site/keys/9904CD4BD6BAF0C3.asc | sudo apt-key add -
- Update the package list
sudo apt-get update
- Install BDR:
sudo apt-get install postgresql-bdr-9.4-bdr-plugin