This page in other versions: 0.9 / 1.0 / 1.0.3

3.2. Installing BDR or UDR from packages

Installation from packages is a good choice if you want the stable release, as it's easier to install and to keep track of your installation.

If you want the very latest BDR or if packages are not yet available for your operating system you may instead want to install from source code.

Note: These instructions are part of the BDR source code so they will be outdated if you are looking at documentation for an old BDR version. Installation from packages will typically install the latest stable BDR version.

3.2.1. RHEL, Fedora and CentOS

Packages for BDR are available for Red Hat derived distros - Fedora, RHEL, and CentOS.

3.2.1.1. Install the repository RPMs

To install BDR or UDR from RPMs you should first download and install the repository RPM for your distro. This RPM will configure the download location for the BDR/UDR packages and load the signing key into your RPM database so that the package digital signatures may be verified.

Note: The repository RPM is signed with 2ndQuadrant's master packaging/releases signing key. See Verifying digital signatures.

RHEL and CentOS users should download and install the RHEL RPM for versions 5, 6, and 7, or run:

     # RHEL/CentOS users only:
     sudo yum install http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-redhat-1.0-2.noarch.rpm
    

Fedora users should download and install the Fedora RPM for Fedora 19 and 20, or run:

     # Fedora users only
     sudo yum install http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-fedora-1.0-2.noarch.rpm
    

It is strongly recommended that you also enable the corresponding repository from yum.postgresql.org, as the BDR repositories only contain the BDR extension and the PostgreSQL server, client, PLs, and the rest of the core PostgreSQL release. They do not contain PostGIS, PgBarman, or any of the other components already included in yum.postgresql.org releases. BDR is fully compatible with these components.

Red Hat / CentOS users should also enable EPEL.

3.2.1.2. Installing PostgreSQL 9.4 and BDR from packages for RHEL, Fedora or CentOS

3.2.1.2.1. Remove the postgresql94 packages, if installed

Note: 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.

3.2.1.2.2. Install the BDR packages

To install the BDR-enabled PostgreSQL server, BDR extension, and the client programs, simply:

      yum check-update
      yum install postgresql-bdr94-bdr
     

Note: If you attempt to to install this package when you already have postgresql94 installed from yum.postgresql.org, yum will report a conflict refuse to install it.

Once BDR is installed you will need to initdb a new database, make any required changes to postgresql.conf and pg_hba.conf, etc, as per any new PostgreSQl install. See /usr/share/doc/postgresql-bdr94/README.rpm-dist for details.

You can then proceed with BDR-specific configuration per Configuration Settings and Quick-start guide.

3.2.1.3. Installing UDR from packages for RHEL, Fedora or CentOS

To install UDR install PostgreSQL 9.4 from yum.postgresql.org as normal. Then install the repository RPMs as outlined above. Finally, install the UDR package:

     yum install postgresql94-udr
    

3.2.2. Installing from packages on Debian or Ubuntu

At time of writing packages for Debian and Ubuntu are available from http://packages.2ndquadrant.com/bdr/apt/. Debian and Ubuntu packaging is still subject to ongoing development and may change. See bdr-project.org for the latest information.

3.2.3. Installing from packages on Windows

Windows is not supported at this time. There is no major technical barrier to doing so but it has not been a time allocation priority. See BDR and UDR requirements.