1<appendix id="appendix-packages" xreflabel="Package details">
2
3  <title>&repmgr; package details</title>
4
5  <indexterm>
6    <primary>packages</primary>
7  </indexterm>
8
9  <para>
10    This section provides technical details about various &repmgr; binary
11    packages, such as location of the installed binaries and
12    configuration files.
13  </para>
14
15  <sect1 id="packages-centos" xreflabel="CentOS packages">
16    <title>CentOS Packages</title>
17
18    <indexterm>
19      <primary>packages</primary>
20      <secondary>CentOS packages</secondary>
21    </indexterm>
22
23    <indexterm>
24      <primary>CentOS</primary>
25      <secondary>package information</secondary>
26    </indexterm>
27
28    <para>
29      Currently, &repmgr; RPM packages are provided for versions 6.x and 7.x of CentOS. These should also
30      work on matching versions of Red Hat Enterprise Linux, Scientific Linux and Oracle Enterprise Linux;
31      together with CentOS, these are the same RedHat-based distributions for which the main community project
32      (PGDG) provides packages (see the <ulink url="https://yum.postgresql.org/">PostgreSQL RPM Building Project</ulink>
33      page for details).
34    </para>
35
36    <para>
37      Note these &repmgr; RPM packages are not designed to work with SuSE/OpenSuSE.
38    </para>
39
40    <note>
41      <para>
42        &repmgr; packages are designed to be compatible with community-provided PostgreSQL packages.
43        They may not work with vendor-specific packages such as those provided by RedHat for RHEL
44        customers, as the filesystem layout may be different to the community RPMs.
45        Please contact your support vendor for assistance.
46      </para>
47    </note>
48
49    <sect2 id="packages-centos-repositories">
50      <title>CentOS repositories</title>
51
52      <para>
53        &repmgr; packages are available from the public 2ndQuadrant repository, and also the
54        PostgreSQL community repository. The 2ndQuadrant repository is updated immediately
55        after each
56        &repmgr; release.
57      </para>
58
59      <table id="centos-2ndquadrant-repository">
60        <title>2ndQuadrant public repository</title>
61        <tgroup cols="2">
62          <tbody>
63            <row>
64              <entry>Repository URL:</entry>
65              <entry><ulink url="https://dl.2ndquadrant.com/">https://dl.2ndquadrant.com/</ulink></entry>
66            </row>
67            <row>
68              <entry>Repository documentation:</entry>
69              <entry><ulink url="https://repmgr.org/docs/current/installation-packages.html#INSTALLATION-PACKAGES-REDHAT-2NDQ">https://repmgr.org/docs/current/installation-packages.html#INSTALLATION-PACKAGES-REDHAT-2NDQ</ulink></entry>
70            </row>
71          </tbody>
72        </tgroup>
73      </table>
74
75      <table id="centos-pgdg-repository">
76        <title>PostgreSQL community repository (PGDG)</title>
77        <tgroup cols="2">
78          <tbody>
79            <row>
80              <entry>Repository URL:</entry>
81              <entry><ulink url="https://yum.postgresql.org/repopackages.php">https://yum.postgresql.org/repopackages.php</ulink></entry>
82            </row>
83            <row>
84              <entry>Repository documentation:</entry>
85              <entry><ulink url="https://yum.postgresql.org/">https://yum.postgresql.org/</ulink></entry>
86            </row>
87          </tbody>
88        </tgroup>
89      </table>
90
91    </sect2>
92
93    <sect2 id="packages-centos-details">
94      <title>CentOS package details</title>
95
96      <para>
97        The two tables below list relevant information, paths, commands etc. for the &repmgr; packages on
98        CentOS 7 (with systemd) and CentOS 6 (no systemd). Substitute the appropriate PostgreSQL major
99        version number for your installation.
100      </para>
101
102      <note>
103        <para>
104          For PostgreSQL 9.6 and lower, the CentOS packages use a mixture of <literal>9.6</literal>
105          and <literal>96</literal> in various places to designate the major version; e.g. the
106          package name is <literal>repmgr96</literal>, but the binary directory is
107          <filename>/var/lib/pgsql/9.6/data</filename>.
108        </para>
109        <para>
110          From PostgreSQL 10, the first part of the version number (e.g. <literal>10</literal>) is
111          the major version, so there is more consistency in file/path/package naming
112          (package <literal>repmgr10</literal>, binary directory <filename>/var/lib/pgsql/10/data</filename>).
113        </para>
114      </note>
115
116
117  <table id="centos-7-packages">
118   <title>CentOS 7 packages</title>
119
120   <tgroup cols="2">
121    <tbody>
122
123     <row>
124      <entry>Package name example:</entry>
125      <entry><filename>repmgr11-4.4.0-1.rhel7.x86_64</filename></entry>
126     </row>
127
128     <row>
129      <entry>Metapackage:</entry>
130      <entry>(none)</entry>
131     </row>
132
133     <row>
134      <entry>Installation command:</entry>
135      <entry><literal>yum install repmgr11</literal></entry>
136     </row>
137
138     <row>
139      <entry>Binary location:</entry>
140      <entry><filename>/usr/pgsql-11/bin</filename></entry>
141     </row>
142
143     <row>
144      <entry>repmgr in default path:</entry>
145      <entry>NO</entry>
146     </row>
147
148     <row>
149      <entry>Configuration file location:</entry>
150      <entry><filename>/etc/repmgr/11/repmgr.conf</filename></entry>
151     </row>
152
153     <row>
154      <entry>Data directory:</entry>
155      <entry><filename>/var/lib/pgsql/11/data</filename></entry>
156     </row>
157
158     <row>
159      <entry>repmgrd service command:</entry>
160      <entry><command>systemctl [start|stop|restart|reload] repmgr11</command></entry>
161     </row>
162
163     <row>
164      <entry>repmgrd service file location:</entry>
165      <entry><filename>/usr/lib/systemd/system/repmgr11.service</filename></entry>
166     </row>
167
168     <row>
169      <entry>repmgrd log file location:</entry>
170      <entry>(not specified by package; set in <filename>repmgr.conf</filename>)</entry>
171     </row>
172
173    </tbody>
174   </tgroup>
175  </table>
176
177  <table id="centos-6-packages">
178   <title>CentOS 6 packages</title>
179
180   <tgroup cols="2">
181    <tbody>
182
183     <row>
184      <entry>Package name example:</entry>
185      <entry><filename>repmgr96-4.0.4-1.rhel6.x86_64</filename></entry>
186     </row>
187
188     <row>
189      <entry>Metapackage:</entry>
190      <entry>(none)</entry>
191     </row>
192
193     <row>
194      <entry>Installation command:</entry>
195      <entry><literal>yum install repmgr96</literal></entry>
196     </row>
197
198     <row>
199      <entry>Binary location:</entry>
200      <entry><filename>/usr/pgsql-9.6/bin</filename></entry>
201     </row>
202
203     <row>
204      <entry>repmgr in default path:</entry>
205      <entry>NO</entry>
206     </row>
207
208     <row>
209      <entry>Configuration file location:</entry>
210      <entry><filename>/etc/repmgr/9.6/repmgr.conf</filename></entry>
211     </row>
212
213     <row>
214      <entry>Data directory:</entry>
215      <entry><filename>/var/lib/pgsql/9.6/data</filename></entry>
216     </row>
217
218     <row>
219      <entry>repmgrd service command:</entry>
220      <entry><literal>service [start|stop|restart|reload] repmgr-9.6</literal></entry>
221     </row>
222
223     <row>
224      <entry>repmgrd service file location:</entry>
225      <entry><literal>/etc/init.d/repmgr-9.6</literal></entry>
226     </row>
227
228     <row>
229      <entry>repmgrd log file location:</entry>
230      <entry><filename>/var/log/repmgr/repmgrd-9.6.log</filename></entry>
231     </row>
232
233    </tbody>
234   </tgroup>
235  </table>
236
237    </sect2>
238 </sect1>
239
240
241
242
243  <sect1 id="packages-debian-ubuntu" xreflabel="Debian/Ubuntu packages">
244    <title>Debian/Ubuntu Packages</title>
245    <indexterm>
246      <primary>packages</primary>
247      <secondary>Debian/Ubuntu packages</secondary>
248    </indexterm>
249
250    <indexterm>
251      <primary>Debian/Ubuntu</primary>
252      <secondary>package information</secondary>
253    </indexterm>
254
255    <para>
256      &repmgr; <literal>.deb</literal> packages are provided by 2ndQuadrant as well as the
257      PostgreSQL Community APT repository, and are available for each community-supported
258      PostgreSQL version, currently supported Debian releases, and currently supported
259      Ubuntu LTS releases.
260    </para>
261
262    <sect2 id="packages-apt-repository">
263      <title>APT repositories</title>
264
265      <table id="apt-2ndquadrant-repository">
266        <title>2ndQuadrant public repository</title>
267        <tgroup cols="2">
268          <tbody>
269            <row>
270              <entry>Repository URL:</entry>
271              <entry><ulink url="https://dl.2ndquadrant.com/">https://dl.2ndquadrant.com/</ulink></entry>
272            </row>
273            <row>
274              <entry>Repository documentation:</entry>
275              <entry><ulink url="https://repmgr.org/docs/current/installation-packages.html#INSTALLATION-PACKAGES-DEBIAN">https://repmgr.org/docs/current/installation-packages.html#INSTALLATION-PACKAGES-DEBIAN</ulink></entry>
276            </row>
277          </tbody>
278        </tgroup>
279      </table>
280
281
282      <table id="apt-repository">
283        <title>PostgreSQL Community APT repository (PGDG)</title>
284        <tgroup cols="2">
285          <tbody>
286            <row>
287              <entry>Repository URL:</entry>
288              <entry><ulink url="https://apt.postgresql.org/">https://apt.postgresql.org/</ulink></entry>
289            </row>
290            <row>
291              <entry>Repository documentation:</entry>
292              <entry><ulink url="https://wiki.postgresql.org/wiki/Apt">https://wiki.postgresql.org/wiki/Apt</ulink></entry>
293            </row>
294          </tbody>
295        </tgroup>
296      </table>
297    </sect2>
298
299   <sect2 id="packages-debian-details">
300      <title>Debian/Ubuntu package details</title>
301
302      <para>
303        The table below lists relevant information, paths, commands etc. for the &repmgr; packages on
304        Debian 9.x ("Stretch"). Substitute the appropriate PostgreSQL major
305        version number for your installation.
306      </para>
307      <para>
308        See also <xref linkend="repmgrd-configuration-debian-ubuntu"/> for some specifics related
309        to configuring the &repmgrd; daemon.
310      </para>
311
312      <table id="debian-9-packages">
313        <title>Debian 9.x packages</title>
314
315        <tgroup cols="2">
316          <tbody>
317
318            <row>
319              <entry>Package name example:</entry>
320              <entry><filename>postgresql-11-repmgr</filename></entry>
321            </row>
322
323            <row>
324              <entry>Metapackage:</entry>
325              <entry><filename>repmgr-common</filename></entry>
326            </row>
327
328            <row>
329              <entry>Installation command:</entry>
330              <entry><literal>apt-get install postgresql-11-repmgr</literal></entry>
331            </row>
332
333            <row>
334              <entry>Binary location:</entry>
335              <entry><filename>/usr/lib/postgresql/11/bin</filename></entry>
336            </row>
337
338            <row>
339              <entry>repmgr in default path:</entry>
340              <entry>Yes (via wrapper script <filename>/usr/bin/repmgr</filename>)</entry>
341            </row>
342
343            <row>
344              <entry>Configuration file location:</entry>
345              <entry>(not set by package)</entry>
346            </row>
347
348            <row>
349              <entry>Data directory:</entry>
350              <entry><filename>/var/lib/postgresql/11/main</filename></entry>
351            </row>
352
353            <row>
354              <entry>PostgreSQL service command:</entry>
355              <entry><command>systemctl [start|stop|restart|reload] postgresql@11-main</command></entry>
356
357            </row>
358
359            <row>
360              <entry>repmgrd service command:</entry>
361              <entry><command>systemctl [start|stop|restart|reload] repmgrd</command></entry>
362            </row>
363
364            <row>
365              <entry>repmgrd service file location:</entry>
366              <entry><filename>/etc/init.d/repmgrd</filename> (defaults in: <filename>/etc/defaults/repmgrd</filename>)</entry>
367            </row>
368
369            <row>
370              <entry>repmgrd log file location:</entry>
371              <entry>(not specified by package; set in <filename>repmgr.conf</filename>)</entry>
372            </row>
373
374          </tbody>
375        </tgroup>
376      </table>
377      <note>
378        <para>
379          When using Debian packages, instead of using the <application>systemd</application> service
380          command directly,  it's recommended to execute <command>pg_ctlcluster</command>
381          (as <literal>root</literal>, either directly or via <command>sudo</command>), e.g.:
382          <programlisting>
383            <command>pg_ctlcluster 11 main [start|stop|restart|reload]</command></programlisting>
384        </para>
385        <para>
386          For pre-<application>systemd</application> systems, <command>pg_ctlcluster</command>
387          can be executed directly by the <literal>postgres</literal> user.
388        </para>
389      </note>
390   </sect2>
391
392  </sect1>
393
394  <sect1 id="packages-snapshot" xreflabel="Snapshot packages">
395    <title>Snapshot packages</title>
396    <indexterm>
397      <primary>snapshot packages</primary>
398    </indexterm>
399    <indexterm>
400      <primary>packages</primary>
401      <secondary>snaphots</secondary>
402    </indexterm>
403
404    <para>
405      For testing new features and bug fixes, from time to time 2ndQuadrant provides
406      so-called &quot;snapshot packages&quot; via its public repository. These packages
407      are built from the &repmgr; source at a particular point in time, and are not formal
408      releases.
409    </para>
410    <note>
411      <para>
412        We do not recommend installing these packages in a production environment
413        unless specifically advised.
414      </para>
415    </note>
416    <para>
417      To install a snapshot package, it's necessary to install the 2ndQuadrant public snapshot repository,
418      following the instructions here: <ulink url="https://dl.2ndquadrant.com/default/release/site/">https://dl.2ndquadrant.com/default/release/site/</ulink> but replace <literal>release</literal> with <literal>snapshot</literal>
419      in the appropriate URL.
420    </para>
421    <para>
422      For example, to install the snapshot RPM repository for PostgreSQL 9.6, execute (as <literal>root</literal>):
423      <programlisting>
424curl https://dl.2ndquadrant.com/default/snapshot/get/9.6/rpm | bash</programlisting>
425
426      or as a normal user with root sudo access:
427      <programlisting>
428curl https://dl.2ndquadrant.com/default/snapshot/get/9.6/rpm | sudo bash</programlisting>
429    </para>
430    <para>
431      Alternatively you can browse the repository here:
432      <ulink url="https://dl.2ndquadrant.com/default/snapshot/browse/">https://dl.2ndquadrant.com/default/snapshot/browse/</ulink>.
433    </para>
434    <para>
435      Once the repository is installed, installing or updating &repmgr; will result in the latest snapshot
436      package being installed.
437    </para>
438    <para>
439      The package name will be formatted like this:
440      <programlisting>
441repmgr96-4.1.1-0.0git320.g5113ab0.1.el7.x86_64.rpm</programlisting>
442      containg the snapshot build number (here: <literal>320</literal>) and the hash
443      of the <application>git</application> commit it was built from (here: <literal>g5113ab0</literal>).
444    </para>
445
446    <para>
447      Note that the next formal release (in the above example <literal>4.1.1</literal>), once available,
448      will install in place of any snapshot builds.
449    </para>
450
451  </sect1>
452
453  <sect1 id="packages-old-versions" xreflabel="Installing old package versions">
454    <title>Installing old package versions</title>
455
456    <indexterm>
457      <primary>old packages</primary>
458    </indexterm>
459
460    <indexterm>
461      <primary>packages</primary>
462      <secondary>old versions</secondary>
463    </indexterm>
464
465    <indexterm>
466      <primary>installation</primary>
467      <secondary>old package versions</secondary>
468    </indexterm>
469
470    <sect2 id="packages-old-versions-debian" xreflabel="old Debian package versions">
471      <title>Debian/Ubuntu</title>
472      <para>
473        An archive of old packages (<literal>3.3.2</literal> and later) for Debian/Ubuntu-based systems is available here:
474        <ulink url="https://apt-archive.postgresql.org/">https://apt-archive.postgresql.org/</ulink>
475      </para>
476    </sect2>
477
478    <sect2 id="packages-old-versions-rhel-centos" xreflabel="old RHEL/CentOS package versions">
479      <title>RHEL/CentOS</title>
480
481      <para>
482        Old versions can be located with e.g.:
483        <programlisting>
484          yum --showduplicates list repmgr96</programlisting>
485        (substitute the appropriate package name; see <xref linkend="packages-centos"/>) and installed with:
486        <programlisting>
487          yum install {package_name}-{version}</programlisting>
488        where <literal>{package_name}</literal> is the base package name (e.g. <literal>repmgr96</literal>)
489        and <literal>{version}</literal> is the version listed by the
490        <command> yum --showduplicates list ...</command> command, e.g. <literal>4.0.6-1.rhel6</literal>.
491      </para>
492      <para>For example:
493        <programlisting>
494          yum install repmgr96-4.0.6-1.rhel6</programlisting>
495      </para>
496
497      <sect3 id="packages-old-versions-rhel-centos-repmgr3">
498        <title>repmgr 3 packages</title>
499        <para>
500          Old &repmgr; 3 RPM packages (<literal>3.2</literal> and later) can be retrieved from the
501          (deprecated) 2ndQuadrant repository at
502          <ulink url="http://packages.2ndquadrant.com/repmgr/yum/">http://packages.2ndquadrant.com/repmgr/yum/</ulink>
503          by installing the appropriate repository RPM:
504        </para>
505
506        <itemizedlist spacing="compact" mark="bullet">
507
508          <listitem>
509            <simpara>
510              <ulink url="http://packages.2ndquadrant.com/repmgr/yum-repo-rpms/repmgr-fedora-1.0-1.noarch.rpm">http://packages.2ndquadrant.com/repmgr/yum-repo-rpms/repmgr-fedora-1.0-1.noarch.rpm</ulink>
511            </simpara>
512          </listitem>
513
514          <listitem>
515            <simpara>
516              <ulink url="http://packages.2ndquadrant.com/repmgr/yum-repo-rpms/repmgr-rhel-1.0-1.noarch.rpm">http://packages.2ndquadrant.com/repmgr/yum-repo-rpms/repmgr-rhel-1.0-1.noarch.rpm</ulink>
517            </simpara>
518          </listitem>
519
520        </itemizedlist>
521      </sect3>
522
523    </sect2>
524  </sect1>
525
526
527  <sect1 id="packages-packager-info" xreflabel="Information for packagers">
528    <title>Information for packagers</title>
529    <indexterm>
530      <primary>packages</primary>
531      <secondary>information for packagers</secondary>
532    </indexterm>
533    <para>
534      We recommend patching the following parameters when
535      building the package as built-in default values for user convenience.
536      These values can nevertheless be overridden by the user, if desired.
537    </para>
538    <itemizedlist>
539      <listitem>
540        <para>
541          Configuration file location: the default configuration file location
542          can be hard-coded by patching <varname>package_conf_file</varname>
543          in <filename>configfile.c</filename>:
544          <programlisting>
545		/* packagers: if feasible, patch configuration file path into "package_conf_file" */
546		char		package_conf_file[MAXPGPATH] = "";</programlisting>
547        </para>
548        <para>
549          See also: <xref linkend="configuration-file"/>
550        </para>
551      </listitem>
552
553      <listitem>
554        <para>
555          PID file location: the default &repmgrd; PID file
556          location can be hard-coded by patching <varname>package_pid_file</varname>
557          in <filename>repmgrd.c</filename>:
558          <programlisting>
559		/* packagers: if feasible, patch PID file path into "package_pid_file" */
560		char		package_pid_file[MAXPGPATH] = "";</programlisting>
561        </para>
562        <para>
563          See also: <xref linkend="repmgrd-pid-file"/>
564        </para>
565      </listitem>
566
567    </itemizedlist>
568  </sect1>
569</appendix>
570