mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-23 07:06:30 +00:00
This brings the repmgr documentation build system in line with that used by the main PostgreSQL project, and removed the restriction that documentation must be built against PostgreSQL 9.6 or earlier. Main formatting changes are: - convert empty-element tags (mainly <xref/>) - put <indexterm> sections in the correct location - correct usage of various entities.
273 lines
9.0 KiB
Plaintext
273 lines
9.0 KiB
Plaintext
<sect1 id="installation-source" xreflabel="Installing from source code">
|
|
|
|
<title>Installing &repmgr; from source</title>
|
|
|
|
<indexterm>
|
|
<primary>installation</primary>
|
|
<secondary>from source</secondary>
|
|
</indexterm>
|
|
|
|
<sect2 id="installation-source-prereqs">
|
|
<title>Prerequisites for installing from source</title>
|
|
<para>
|
|
To install &repmgr; the prerequisites for compiling
|
|
&postgres; must be installed. These are described in &postgres;'s
|
|
documentation
|
|
on <ulink url="https://www.postgresql.org/docs/current/install-requirements.html">build requirements</ulink>
|
|
and <ulink url="https://www.postgresql.org/docs/current/docguide-toolsets.html">build requirements for documentation</ulink>.
|
|
</para>
|
|
|
|
<para>
|
|
Most mainstream Linux distributions and other UNIX variants provide simple
|
|
ways to install the prerequisites from packages.
|
|
<itemizedlist spacing="compact" mark="bullet">
|
|
<listitem>
|
|
<para>
|
|
<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, and ensure the source repository is enabled.
|
|
</para>
|
|
<tip>
|
|
<para>
|
|
If not configured, the source repository can be added by including
|
|
a <literal>deb-src</literal> line as a copy of the existing <literal>deb</literal>
|
|
line in the repository file, which is usually
|
|
<filename>/etc/apt/sources.list.d/pgdg.list</filename>, e.g.:
|
|
<programlisting>
|
|
deb http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main
|
|
deb-src http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main</programlisting>
|
|
</para>
|
|
</tip>
|
|
<para>
|
|
Then install the prerequisites for
|
|
building PostgreSQL with e.g.:
|
|
<programlisting>
|
|
sudo apt-get update
|
|
sudo apt-get build-dep postgresql-9.6</programlisting>
|
|
</para>
|
|
|
|
<important>
|
|
<simpara>
|
|
Select the appropriate PostgreSQL version for your target repmgr version.
|
|
</simpara>
|
|
</important>
|
|
|
|
<note>
|
|
<para>
|
|
If using <command>apt-get build-dep</command> is not possible, the
|
|
following packages may need to be installed manually:
|
|
|
|
<itemizedlist spacing="compact" mark="bullet">
|
|
|
|
<listitem>
|
|
<simpara><literal>llibedit-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibkrb5-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibpam0g-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibreadline-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibselinux1-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibssl-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibxml2-dev</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>llibxslt1-dev</literal></simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
</note>
|
|
|
|
</listitem>
|
|
<listitem>
|
|
<para>
|
|
<literal>RHEL or CentOS 6.x or 7.x</literal>: install the appropriate repository RPM
|
|
for your system from <ulink url="https://yum.postgresql.org/repopackages.php">
|
|
yum.postgresql.org</ulink>. Then install the prerequisites for building
|
|
PostgreSQL with:
|
|
<programlisting>
|
|
sudo yum check-update
|
|
sudo yum groupinstall "Development Tools"
|
|
sudo yum install yum-utils openjade docbook-dtds docbook-style-dsssl docbook-style-xsl
|
|
sudo yum-builddep postgresql96</programlisting>
|
|
</para>
|
|
|
|
<important>
|
|
<simpara>
|
|
Select the appropriate PostgreSQL version for your target repmgr version.
|
|
</simpara>
|
|
</important>
|
|
<note>
|
|
<para>
|
|
If using <command>yum-builddep</command> is not possible, the
|
|
following packages may need to be installed manually:
|
|
|
|
<itemizedlist spacing="compact" mark="bullet">
|
|
|
|
<listitem>
|
|
<simpara><literal>libselinux-devel</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>libxml2-devel</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>libxslt-devel</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>openssl-devel</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>pam-devel</literal></simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara><literal>readline-devel</literal></simpara>
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
</para>
|
|
</note>
|
|
|
|
<tip>
|
|
<para>
|
|
If building against PostgreSQL 11 or later configured with the <option>--with-llvm</option> option
|
|
(this is the case with the PGDG-provided packages) you'll also need to install the
|
|
<literal>llvm-toolset-7-clang</literal> package. This is available via the
|
|
<ulink url="https://wiki.centos.org/AdditionalResources/Repositories/SCL">Software Collections (SCL) Repository</ulink>.
|
|
</para>
|
|
</tip>
|
|
|
|
</listitem>
|
|
</itemizedlist>
|
|
</para>
|
|
|
|
</sect2>
|
|
|
|
|
|
<sect2 id="installation-get-source">
|
|
<title>Getting &repmgr; source code</title>
|
|
|
|
<para>
|
|
There are two ways to get the &repmgr; source code: with git, or by downloading tarballs of released versions.
|
|
</para>
|
|
|
|
<sect3>
|
|
<title>Using <application>git</application> to get the &repmgr; sources</title>
|
|
|
|
<para>
|
|
Use <application><ulink url="https://git-scm.com">git</ulink></application> if you expect
|
|
to update often, you want to keep track of development or if you want to contribute
|
|
changes to &repmgr;. There is no reason <emphasis>not</emphasis> to use <application>git</application>
|
|
if you're familiar with it.
|
|
</para>
|
|
|
|
<para>
|
|
The source for &repmgr; is maintained at
|
|
<ulink url="https://github.com/2ndQuadrant/repmgr">https://github.com/2ndQuadrant/repmgr</ulink>.
|
|
</para>
|
|
|
|
<para>
|
|
There are also tags for each &repmgr; release, e.g. <literal>v4.2.0</literal>.
|
|
</para>
|
|
|
|
<para>
|
|
Clone the source code using <application>git</application>:
|
|
<programlisting>
|
|
git clone https://github.com/2ndQuadrant/repmgr</programlisting>
|
|
</para>
|
|
|
|
<para>
|
|
For more information on using <application>git</application> see
|
|
<ulink url="https://git-scm.com/">git-scm.com</ulink>.
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
<sect3>
|
|
<title>Downloading release source tarballs</title>
|
|
|
|
<para>
|
|
Official release source code is uploaded as tarballs to the
|
|
&repmgr; website along with a tarball checksum and a matching GnuPG
|
|
signature. See
|
|
<ulink url="http://repmgr.org/">http://repmgr.org/</ulink>
|
|
for the download information. See <xref linkend="appendix-signatures"/>
|
|
for information on verifying digital signatures.
|
|
</para>
|
|
|
|
<para>
|
|
You will need to download the repmgr source, e.g. <filename>repmgr-4.0.tar.gz</filename>.
|
|
You may optionally verify the package checksums from the
|
|
<literal>.md5</literal> files and/or verify the GnuPG signatures
|
|
per <xref linkend="appendix-signatures"/>.
|
|
</para>
|
|
|
|
<para>
|
|
After you unpack the source code archives using <command>tar xf</command>
|
|
the installation process is the same as if you were installing from a git
|
|
clone.
|
|
</para>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
<sect2 id="installation-repmgr-source">
|
|
<title>Installation of &repmgr; from source</title>
|
|
<para>
|
|
To installing &repmgr; from source, simply execute:
|
|
|
|
<programlisting>
|
|
./configure && make install</programlisting>
|
|
|
|
Ensure <command>pg_config</command> for the target PostgreSQL version is in
|
|
<varname>$PATH</varname>.
|
|
</para>
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 id="installation-build-repmgr-docs">
|
|
<title>Building &repmgr; documentation</title>
|
|
<para>
|
|
The &repmgr; documentation is (like the main PostgreSQL project)
|
|
written in DocBook format. To build it locally as HTML, you'll need to
|
|
install the required packages as described in the
|
|
<ulink url="https://www.postgresql.org/docs/9.6/docguide-toolsets.html">
|
|
PostgreSQL documentation</ulink> then execute:
|
|
<programlisting>
|
|
./configure && make install-doc</programlisting>
|
|
</para>
|
|
<para>
|
|
The generated HTML files will be placed in the <filename>doc/html</filename>
|
|
subdirectory of your source tree.
|
|
</para>
|
|
|
|
<para>
|
|
To build the documentation as a single HTML file, execute:
|
|
<programlisting>
|
|
cd doc/ && make repmgr.html</programlisting>
|
|
</para>
|
|
|
|
<note>
|
|
<simpara>
|
|
Due to changes in PostgreSQL's documentation build system from PostgreSQL 10,
|
|
the documentation can currently only be built against PostgreSQL 9.6 or earlier.
|
|
This limitation will be fixed when time and resources permit.
|
|
</simpara>
|
|
</note>
|
|
</sect2>
|
|
|
|
|
|
</sect1>
|