<para>
This book is the official documentation of &bdr; &bdrversion; for
- use with &pgmajorversion;. It has been written by the &postgres;
- and &bdr; developers and other volunteers in parallel to the
- development of the &bdr; software. It describes all the
+ use with PostgreSQL &pgmajorversion;. It has been written by the
+ &postgres; and &bdr; developers and other volunteers in parallel to
+ the development of the &bdr; software. It describes all the
functionality that the current version of &bdr; officially
supports.
</para>
<partintro>
<para>
- There's several options for installing both &bdr; and &udr;.
+ There are several options for installing both &bdr; and &udr;.
</para>
</partintro>
+ &install-packages;
+
<chapter id="installation-source">
- <title>Installing &bdr;/&udr; from source</title>
+ <title>Installing &bdr; or &udr; from source</title>
<sect1>
- <title>Prerequisites</title>
+ <title>Prerequisites for installing from source</title>
<para>
- To install either &bdr; or &udr; &postgres;'s prerequisites for
- compiling have to be installed. These are documented in
- &postgres;'s documentation
- about <ulink url='http://www.postgresql.org/docs/current/install-requirements.html'>general
- prerequisites</ulink>
- and <ulink url='http://www.postgresql.org/docs/current/docguide-toolsets.html'>prerequisites
- for documentation</ulink>.
+ To install either &bdr; or &udr; the prerequisites for compiling
+ &postgres; must be installed. These are described in &postgres;'s
+ documentation
+ on <ulink url='http://www.postgresql.org/docs/current/install-requirements.html'>build requirements</ulink>
+ and <ulink url='http://www.postgresql.org/docs/current/docguide-toolsets.html'>build requirements for documentation</ulink>.
</para>
<para>
<itemizedlist spacing="compact" mark="bullet">
<listitem>
<para>
- <literal>Debian</literal> - all prerequisites should be
- installed after the command
+ <literal>Debian</literal> and <literal>Ubuntu</literal>: First
+ add the <ulink
+ url="http://apt.postgresql.org/">apt.postgresql.org</ulink>
+ repository to your <filename>sources.list</filename> if you
+ have not already done so. Then install the pre-requisites for
+ building PostgreSQL with:
<programlisting>
- apt-get build-dep postgresql-9.4
+ sudo apt-get update
+ sudo apt-get build-dep postgresql-9.4
</programlisting>
- has been executed. This requires
- that <literal>sources.list</literal> is configured to provide
- sources.
- </para>
+ </para>
</listitem>
<listitem>
<para>
- <literal>RHEL 6.x</literal> - all prerequisites should be
- installed after the commands
- <!--FIXME: really no stable URL? -->
+ <literal>RHEL or CentOS 6.x or 7.x</literal>: install the appropriate repository RPM
+ for your system from <ulink url="http://yum.postgresql.org/repopackages.php">
+ yum.postgresql.org</ulink>. Then install the prerequisites for building
+ PostgreSQL with:
<programlisting>
- yum install http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-1.noarch.rpm
- yum groupinstall "Development Tools"
- yum-builddep postgresql94
+ sudo yum check-update
+ sudo yum groupinstall "Development Tools"
+ sudo yum install yum-utils
+ sudo yum-builddep postgresql94
+ sudo yum install openjade docbook-dtds docbook-style-dsssl docbook-style-xsl
</programlisting>
- have been executed. This requires
- that <literal>sources.list</literal> is configured to provide
- sources.
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>RHEL 7.x</literal> - all prerequisites should be
- installed after the commands
- <!--FIXME: really no stable URL? -->
- <programlisting>
- yum groupinstall "Development Tools"
- yum-builddep postgresql
- </programlisting>
- have been executed. This requires
- that <literal>sources.list</literal> is configured to provide
- sources.
</para>
</listitem>
</para>
<para>
- Postgres can be compiled using the normal documented
- procedures. That will usually be something like:
+ The patched PostgreSQL required for BDR can be compiled using the
+ <ulink
+ url="http://www.postgresql.org/docs/current/static/installation.html">normal
+ documented procedures</ulink>. That will usually be something
+ like:
<programlisting>
cd /path/to/bdr-pg-source/
./configure --prefix=/path/to/install --enable-debug --enable-openssl
- make -j16 -s install-world
+ make -j4 -s install-world
</programlisting>
</para>
<para>
- To then install &udr; execute its configure script with the
- earlier installed <application>pg_config</application> in the path.
+ To then install &bdr; execute its configure script with the
+ <application>pg_config</application> installed by the patched PostgreSQL
+ in the <literal>PATH</literal> environment variable, e.g.:
<programlisting>
cd /path/to/bdr-plugin-source/
PATH=/path/to/install:"$PATH" ./configure
- make -j16 -s all
+ make -j4 -s all
</programlisting>
</para>
</sect1>
<sect1 id="installation-udr-source">
<title>Installation of &udr; from source</title>
<para>
- Installing &udr; is simpler than installing &bdr;. It compilers
- against a stocket &postgres; 9.4 if the relevant headers are
- installed.
+ Installing &udr; is simpler than installing &bdr;. It compiles
+ against a stock (unmodified) &postgres; 9.4 if the relevant
+ headers are installed.
+ </para>
+
+ <para>
+ Most Linux distributions put the required header files in a "dev"
+ or "devel" package. Exactly what to install depends on how you
+ installed PostgreSQL in the first place.
+ <itemizedlist>
+ <listitem>
+ <para>
+ If you installed from apt.postgresql.org packages on
+ Debian/Ubuntu then run:
+ <programlisting>
+ sudo apt-get install postgresql-server-dev-9.4
+ </programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ If you installed from yum.postgresql.org packages on
+ RHEL or CentOS then run:
+ <programlisting>
+ sudo yum install postgresql94-dev
+ </programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
</para>
<para>
To compile &udr; execute its configure script with &postgres;'s
- <application>pg_config</application> in the path.
+ <application>pg_config</application> in the <literal>PATH</literal>.
<programlisting>
cd /path/to/bdr-plugin-source/
PATH=/path/to/pg/install:"$PATH" ./configure
make -j16 -s all
</programlisting>
+ On Debian/Ubuntu systems <application>pg_config</application> is on the default
+ <literal>PATH</literal> so you can just run
+ <programlisting>
+ ./configure
+ </programlisting>
+ On RHEL/CentOS systems you will need to put
+ <filename>/usr/pgsql-9.4/bin</filename> on the
+ <literal>PATH</literal>, e.g.:
+ <programlisting>
+ PATH=/usr/pgsql-9.4/bin:$PATH ./configure
+ </programlisting>
</para>
</sect1>
</part>
<part id="quickstart">
- <title>Quick Start</title>
+ <title>&bdr; Quick Start</title>
<partintro>
<para>
</para>
</sect1>
- <sect1 id="quickstart-source">
- <title>Installing from source</title>
- <para>
- Compiling PostgreSQL with &bdr; ...
- </para>
- </sect1>
</chapter>
</part>
--- /dev/null
+<chapter id="installation-packages">
+ <title>Installing &bdr; or &udr; from packages</title>
+
+ <para>
+ 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.
+ </para>
+
+ <para>
+ If you want the very latest BDR or if packages are not
+ yet available for your operating system you may instead want to
+ <link linkend="installation-source"> install from source
+ code</link>.
+ </para>
+
+ <note>
+ <para>
+ 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.
+ </para>
+ </note>
+
+
+ <sect1>
+ <title>RHEL, Fedora and CentOS</title>
+
+ <para>
+ Packages for BDR are available for Red Hat derived distros -
+ Fedora, RHEL, and CentOS.
+ </para>
+
+ <sect2>
+ <title>Install the repository RPMs</title>
+
+ <para>
+ 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.
+ </para>
+
+ <note>
+ <title>Verifying the digital signature on the repository RPM</title>
+ <para>
+ If you wish to verify the repository RPM's digital signature
+ using <literal>rpm -V</literal>, the signing key ID is the
+ 2ndQuadrant packaging key <literal>0x2B11E054</literal>, which
+ can be <ulink
+ url="https://pgp.mit.edu/pks/lookup?search=0x2B11E054&op=index&exact=on">
+ found in the GPG keyservers</ulink>. You can <ulink
+ url="http://2ndquadrant.com/signing-keys"> verify the fingerprint
+ on the 2ndQuadrant website.</ulink> then import the key with
+ <literal>rpmkeys</literal>.
+ </para>
+ </note>
+
+ <para>
+ RHEL and CentOS users should download and install <ulink url="http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-redhat-1.0-2.noarch.rpm">the RHEL RPM for versions 5, 6, and 7</ulink>, or run:
+
+ <programlisting>
+ # 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
+ </programlisting>
+
+ Fedora users should download and install the Fedora RPM for Fedora 19 and 20, or run:
+
+ <programlisting>
+ # 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
+ </programlisting>
+ </para>
+
+ <para>
+ It is strongly recommended that you also enable the
+ corresponding repository from
+ <ulink url="http://yum.postgresql.org/">yum.postgresql.org</ulink>,
+ 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.
+ </para>
+
+ <para>
+ Red Hat / CentOS users should also
+ <ulink url="https://fedoraproject.org/wiki/EPEL">enable EPEL</ulink>.
+ </para>
+
+ </sect2>
+
+ <sect2>
+ <title>Installing PostgreSQL &pgmajorversion; and &bdr; from packages for RHEL, Fedora or CentOS</title>
+
+ <sect3>
+ <title>Remove the <literal>postgresql94</literal> packages, if installed</title>
+
+ <note>
+ <para>If you don't already have PostgreSQL &pgmajorversion; installed, simply skip this step.</para>
+ </note>
+
+ <para>
+ &bdr; requires a patched version of PostgreSQL &pgmajorversion;
+ that conflicts with the official packages from
+ yum.postgresql.org. If you already have PostgreSQL
+ &pgmajorversion;installed from yum.postgresql.org, you will need
+ to make a dump of all your databases, then uninstall the PGDG
+ PostgreSQL &pgmajorversion; packages before you can install &bdr;
+ </para>
+
+ <para>
+ The BDR RPMs cannot co-exist with stock PostgreSQL
+ &pgmajorversion;, and BDR does not share the same data directory
+ as stock &pgmajorversion;, so it will not be able to read your
+ existing databases. (They will not be deleted, and uninstalling
+ BDR then reinstalling stock PGDG &pgmajorversion; will get you
+ access to them again, but it is strongly recommended that you
+ dump them before installing BDR).
+ </para>
+
+ <para>
+ Once you have fully backed up all your databases:
+ <programlisting>
+ yum remove postgresql94\*
+ </programlisting>
+ Check the list of packages to be removed carefully,
+ approve the removal if appropriate, and proceed with the removal.
+ </para>
+
+ <para>
+ Your data directory for PostgreSQL &pgmajorversion; will still
+ exist in <filename>/var/lib/pgsql/&pgmajorversion;</filename> but
+ will not be used while BDR is installed.
+ </para>
+
+ </sect3>
+
+ <sect3>
+ <title>Install the &bdr; packages</title>
+
+ <para>
+ To install the &bdr;-enabled PostgreSQL server, &bdr; extension, and the client programs, simply:
+ <programlisting>
+ yum check-update
+ yum install postgresql-bdr94-bdr
+ </programlisting>
+ </para>
+
+ <note>
+ <para>
+ 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.
+ </para>
+ </note>
+
+ <para>
+ Once &bdr; is installed you will need to initdb a new database,
+ make any required changes to <filename>postgresql.conf</filename>
+ and <filename>pg_hba.conf</filename>, etc, as per any new
+ PostgreSQl install. See
+ <filename>/usr/share/doc/postgresql-bdr94/README.rpm-dist</filename>
+ for details.
+ </para>
+
+ <para>
+ You can then proceed with BDR-specific configuration per
+ <xref linkend="settings"> and <xref linkend="quickstart">.
+ </para>
+
+ </sect3>
+
+ </sect2>
+
+ <sect2>
+ <title>Installing &udr; from packages for RHEL, Fedora or CentOS</title>
+
+ <para>
+ To install &udr; install PostgreSQL &pgmajorversion; from <ulink
+ url="http://yum.postgresql.org/">yum.postgresql.org</ulink> as
+ normal. Then install the repository RPMs as outlined above.
+ Finally, install the UDR package:
+ <programlisting>
+ yum install postgresql94-udr
+ </programlisting>
+ </para>
+
+ </sect2>
+
+ </sect1>
+</chapter>