Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Installing BDR 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.

RHEL, Fedora and CentOS

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

Install the repository RPMs

To install BDR from RPMs you should first download and install the repository RPM for your distro. This RPM will configure the download location for the BDR 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 appropriate repo rpm:
     # RHEL/CentOS users only:
     sudo yum install http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-redhat-latest.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-latest.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.

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

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.

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     
Note: If you attempt 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.

Debian or Ubuntu

Packages for Debian and Ubuntu are available from http://packages.2ndquadrant.com/bdr/apt/.

Adding the BDR repository

To install BDR from DEBs you first need to add the BDR repository to your server.
First, install and enable the PostgreSQL apt repository for PGDG. This repository is required by the Debian BDR packages.
Next, create /etc/apt/sources.list.d/2ndquadrant.list with the repository URL below, changing wheezy to the codename of the Debian/Ubuntu version you are using, as obtained with lsb_release -c:
      deb http://packages.2ndquadrant.com/bdr/apt/ wheezy-2ndquadrant main   
Import the repository key from http://packages.2ndquadrant.com/bdr/apt/AA7A6805.asc, update the package lists, and start installing packages:
     wget --quiet -O - http://packages.2ndquadrant.com/bdr/apt/AA7A6805.asc | sudo apt-key add -
     sudo apt-get update    
Note: The package signing key is signed with 2ndQuadrant's master packaging/releases signing key. 

 Installing PostgreSQL 9.4 and BDR from packages for Debian or Ubuntu

  Remove the postgresql-9.4 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. If you already have PostgreSQL 9.4 installed either from apt.postgresql.org or your official distribution repository, you will need to make a dump of all your databases, then uninstall the official PostgreSQL 9.4 packages before you can install BDR.
The BDR Debian packages cannot co-exist with stock PostgreSQL 9.4. However BDR uses the same data directory as stock 9.4, to ensure the compatibility with system utilities, so you should always first backup the existing instalation before trying to install the BDR PostgreSQL packages.
Once you have fully backed up all your databases:
      sudo apt-get remove postgresql-9.4
     
Check the list of packages to be removed carefully, approve the removal if appropriate, and proceed with the removal.

Install the BDR packages

To differentiate between the BDR specific packages and vanilla PostgreSQL packages all the package names start with postgresql-bdr instead of plain postgresql. So if you want to install the PostgreSQL package with BDR patches you should run:
      sudo apt-get update
      sudo apt-get install postgresql-bdr-9.4 postgresql-bdr-9.4-bdr-plugin    
Note: If you attempt to install this package when you already have postgresql-9.4 installed you will get informed that the official package will be removed and confirmation will be required. Do not remove the old packages if you have existing data directory!
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. This works with standard system utilities like pg_createcluster.

 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.

Comments

Popular posts from this blog

VMWARE WORKSTATION 3,4,5,6,7,8,9,10,11,12,14,15...etc LICENSE KEYS COLLECTION

How to find the server is whether standby (slave) or primary(master) in Postgresql replication ?

Oracle to Postgresql migration

PostgreSQL Enterprise Manager - PEM Monitoring Tools

7 Steps to configure BDR replication in postgresql