1<sect1 id="installation-packages" xreflabel="Installing from packages">
2 <title>Installing &repmgr; from packages</title>
3
4  <indexterm>
5   <primary>installation</primary>
6   <secondary>from packages</secondary>
7  </indexterm>
8
9 <para>
10  We recommend installing &repmgr; using the available packages for your
11  system.
12 </para>
13
14 <sect2 id="installation-packages-redhat" xreflabel="Installing from packages on RHEL, CentOS and Fedora">
15
16  <title>RedHat/CentOS/Fedora</title>
17
18  <indexterm>
19   <primary>installation</primary>
20   <secondary>on Red Hat/CentOS/Fedora etc.</secondary>
21  </indexterm>
22
23  <para>
24	&repmgr; RPM packages for RedHat/CentOS variants and Fedora are available from the
25	<ulink url="https://2ndquadrant.com">2ndQuadrant</ulink>
26	<ulink url="https://dl.2ndquadrant.com/">public repository</ulink>; see following
27	section for details.
28  </para>
29  <note>
30    <para>
31      Currently the <ulink url="https://2ndquadrant.com">2ndQuadrant</ulink>
32	  <ulink url="https://dl.2ndquadrant.com/">public repository</ulink> provides
33      support for RedHat/CentOS versions 5, 6 and 7. Support for version 8 is
34      available via the PGDG repository; see below for details.
35    </para>
36  </note>
37  <para>
38   RPM packages for &repmgr; are also available via Yum through
39   the PostgreSQL Global Development Group (PGDG) RPM repository
40   (<ulink url="https://yum.postgresql.org/">https://yum.postgresql.org/</ulink>).
41   Follow the instructions for your distribution (RedHat, CentOS,
42   Fedora, etc.) and architecture as detailed there. Note that it can take some days
43   for new &repmgr; packages to become available via the this repository.
44  </para>
45  <note>
46    <para>
47      &repmgr; RPM packages are designed to be compatible with the community-provided PostgreSQL packages
48      and 2ndQuadrant's <ulink url="https://www.2ndquadrant.com/en/resources/2ndqpostgres/">2ndQPostgres</ulink>.
49      They may not work with vendor-specific packages such as those provided by RedHat for RHEL
50      customers, as the PostgreSQL filesystem layout may be different to the community RPMs.
51      Please contact your support vendor for assistance.
52    </para>
53    <para>
54      See also <link linkend="appendix-faq">FAQ</link> entry
55      <xref linkend="faq-third-party-packages"/>.
56    </para>
57  </note>
58
59  <para>
60    For more information on the package contents, including details of installation
61    paths and relevant <link linkend="configuration-file-service-commands">service commands</link>,
62    see the appendix section <xref linkend="packages-centos"/>.
63  </para>
64
65
66  <sect3 id="installation-packages-redhat-2ndq">
67    <title>2ndQuadrant public RPM yum repository</title>
68
69    <para>
70      <ulink url="https://2ndquadrant.com/">2ndQuadrant</ulink> provides a dedicated <literal>yum</literal>
71      <ulink url="https://dl.2ndquadrant.com/">public repository</ulink> for 2ndQuadrant software,
72      including &repmgr;. We recommend using this for all future &repmgr; releases.
73    </para>
74    <para>
75      General instructions for using this repository can be found on its
76      <ulink url="https://dl.2ndquadrant.com/">homepage</ulink>. Specific instructions
77      for installing &repmgr; follow below.
78    </para>
79    <para>
80      <emphasis>Installation</emphasis>
81
82      <itemizedlist>
83	<listitem>
84	  <para>
85	    Locate the repository RPM for your PostgreSQL version from the list at:
86	    <ulink url="https://dl.2ndquadrant.com/">https://dl.2ndquadrant.com/</ulink>
87	  </para>
88	</listitem>
89
90        <listitem>
91          <para>
92            Install the repository definition for your distribution and PostgreSQL version
93	    (this enables the 2ndQuadrant repository as a source of &repmgr; packages).
94	  </para>
95	  <para>
96	    For example, for PostgreSQL 11 on CentOS, execute:
97	    <programlisting>
98curl https://dl.2ndquadrant.com/default/release/get/11/rpm | sudo bash</programlisting>
99	  </para>
100
101	  <para>
102	    For PostgreSQL 9.6 on CentOS, execute:
103	    <programlisting>
104curl https://dl.2ndquadrant.com/default/release/get/9.6/rpm | sudo bash</programlisting>
105	  </para>
106
107
108	  <para>
109	    Verify that the repository is installed with:
110	    <programlisting>
111sudo yum repolist</programlisting>
112	    The output should contain two entries like this:
113	    <programlisting>
1142ndquadrant-dl-default-release-pg11/7/x86_64         2ndQuadrant packages (PG11) for 7 - x86_64               18
1152ndquadrant-dl-default-release-pg11-debug/7/x86_64   2ndQuadrant packages (PG11) for 7 - x86_64 - Debug        8</programlisting>
116	  </para>
117	</listitem>
118
119        <listitem>
120          <para>
121            Install the &repmgr; version appropriate for your PostgreSQL version (e.g. <literal>repmgr10</literal>):
122            <programlisting>
123sudo yum install repmgr11</programlisting>
124          </para>
125          <note>
126            <para>
127              For packages for PostgreSQL 9.6 and earlier, the package name does not contain
128              a period between major and minor version numbers, e.g.
129              <literal>repmgr96</literal>.
130            </para>
131          </note>
132          <tip>
133            <para>
134              To determine the names of available packages, execute:
135              <programlisting>
136yum search repmgr</programlisting>
137            </para>
138          </tip>
139
140        </listitem>
141      </itemizedlist>
142    </para>
143
144    <para>
145      <emphasis>Compatibility with PGDG Repositories</emphasis>
146    </para>
147    <para>
148      The 2ndQuadrant &repmgr; yum repository packages use the same definitions and file system layout as the
149      main PGDG repository.
150    </para>
151    <para>
152      Normally <application>yum</application> will prioritize the repository with the most recent &repmgr; version.
153      Once the PGDG repository has been updated, it doesn't matter which repository
154      the packages are installed from.
155    </para>
156    <para>
157      To ensure the 2ndQuadrant repository is always prioritised, install <literal>yum-plugin-priorities</literal>
158      and set the repository priorities accordingly.
159    </para>
160
161    <para>
162      <emphasis>Installing a specific package version</emphasis>
163    </para>
164    <para>
165      To install a specific package version, execute <command>yum --showduplicates list</command>
166      for the package in question:
167      <programlisting>
168[root@localhost ~]# yum --showduplicates list repmgr11
169Loaded plugins: fastestmirror
170Loading mirror speeds from cached hostfile
171 * base: ftp.tsukuba.wide.ad.jp
172 * epel: nrt.edge.kernel.org
173 * extras: ftp.tsukuba.wide.ad.jp
174 * updates: ftp.tsukuba.wide.ad.jp
175Installed Packages
176repmgr11.x86_64                        4.4.0-1.rhel7                         @pgdg11
177Available Packages
178repmgr11.x86_64                        4.2-1.el7                             2ndquadrant-dl-default-release-pg11
179repmgr11.x86_64                        4.2-2.el7                             2ndquadrant-dl-default-release-pg11
180repmgr11.x86_64                        4.3-1.el7                             2ndquadrant-dl-default-release-pg11
181repmgr11.x86_64                        4.4-1.el7                             2ndquadrant-dl-default-release-pg11</programlisting>
182      then append the appropriate version number to the package name with a hyphen, e.g.:
183      <programlisting>
184[root@localhost ~]# yum install repmgr11-4.3-1.el7</programlisting>
185    </para>
186
187    <para>
188      <emphasis>Installing old packages</emphasis>
189    </para>
190    <para>
191      See appendix <link linkend="packages-old-versions-rhel-centos">Installing old package versions</link>
192      for details on how to retrieve older package versions.
193    </para>
194
195  </sect3>
196
197 </sect2>
198
199 <sect2 id="installation-packages-debian" xreflabel="Installing from packages on Debian or Ubuntu">
200
201  <title>Debian/Ubuntu</title>
202
203  <indexterm>
204   <primary>installation</primary>
205   <secondary>on Debian/Ubuntu etc.</secondary>
206  </indexterm>
207
208  <para>.deb packages for &repmgr; are available from the
209  PostgreSQL Community APT repository (<ulink url="https://apt.postgresql.org/">https://apt.postgresql.org/</ulink>).
210  Instructions can be found in the APT section of the PostgreSQL Wiki
211  (<ulink url="https://wiki.postgresql.org/wiki/Apt">https://wiki.postgresql.org/wiki/Apt</ulink>).
212  </para>
213  <para>
214    For more information on the package contents, including details of installation
215    paths and relevant <link linkend="configuration-file-service-commands">service commands</link>,
216    see the appendix section <xref linkend="packages-debian-ubuntu"/>.
217  </para>
218
219  <sect3 id="installation-packages-debian-ubuntu-2ndq">
220    <title>2ndQuadrant public apt repository for Debian/Ubuntu</title>
221
222    <para>
223      <ulink url="https://2ndquadrant.com/">2ndQuadrant</ulink> provides a
224      <ulink url="https://dl.2ndquadrant.com/">public apt repository</ulink> for 2ndQuadrant software,
225      including &repmgr;.
226    </para>
227    <para>
228      General instructions for using this repository can be found on its
229      <ulink url="https://dl.2ndquadrant.com/">homepage</ulink>. Specific instructions
230      for installing &repmgr; follow below.
231    </para>
232
233    <para>
234
235      <emphasis>Installation</emphasis>
236
237      <itemizedlist>
238
239	    <listitem>
240	      <para>
241            Install the repository definition for your distribution and PostgreSQL version
242	        (this enables the 2ndQuadrant repository as a source of &repmgr; packages) by executing:
243            <programlisting>
244              curl https://dl.2ndquadrant.com/default/release/get/deb | sudo bash</programlisting>
245	      </para>
246          <note>
247            <para>
248              This will automatically install the following additional packages, if not already present:
249              <itemizedlist spacing="compact" mark="bullet">
250                <listitem>
251                  <simpara><literal>lsb-release</literal></simpara>
252                </listitem>
253                <listitem>
254                  <simpara><literal>apt-transport-https</literal></simpara>
255                </listitem>
256              </itemizedlist>
257            </para>
258          </note>
259        </listitem>
260
261	    <listitem>
262	      <para>
263            Install the &repmgr; version appropriate for your PostgreSQL version (e.g. <literal>repmgr11</literal>):
264            <programlisting>
265              sudo apt-get install postgresql-11-repmgr</programlisting>
266	      </para>
267          <note>
268            <para>
269              For packages for PostgreSQL 9.6 and earlier, the package name includes
270              a period between major and minor version numbers, e.g.
271              <literal>postgresql-9.6-repmgr</literal>.
272            </para>
273          </note>
274	    </listitem>
275
276      </itemizedlist>
277
278    </para>
279
280    <para>
281      <emphasis>Installing old packages</emphasis>
282    </para>
283    <para>
284      See appendix <link linkend="packages-old-versions-debian">Installing old package versions</link>
285      for details on how to retrieve older package versions.
286    </para>
287
288
289  </sect3>
290 </sect2>
291
292</sect1>
293