33Installing pg_auto_failover
44===========================
55
6- We provide native system packages for pg_auto_failover on most popular Linux distributions.
6+ We provide native system packages for pg_auto_failover on most popular Linux
7+ distributions.
78
89Use the steps below to install pg_auto_failover on PostgreSQL 11. At the
910current time pg_auto_failover is compatible with both PostgreSQL 10 and
@@ -12,50 +13,48 @@ PostgreSQL 11.
1213Ubuntu or Debian
1314----------------
1415
15- Quick install
16- ~~~~~~~~~~~~~
17-
18- The following installation method downloads a bash script that automates
19- several steps. The full script is available for review at our `package cloud
20- installation instructions `__ page.
21-
22- __ https://packagecloud.io/citusdata/community/install#bash
23-
24- .. code-block :: bash
25-
26- # add the required packages to your system
27- curl https://install.citusdata.com/community/deb.sh | sudo bash
28-
29- # install pg_auto_failover
30- sudo apt-get install postgresql-11-auto-failover
31-
32- # confirm installation
33- /usr/bin/pg_autoctl --version
16+ Postgres apt repository
17+ ~~~~~~~~~~~~~~~~~~~~~~~
3418
35- Manual Installation
36- ~~~~~~~~~~~~~~~~~~~
19+ Binary packages for debian and derivatives (ubuntu) are available from
20+ `apt.postgresql.org `__ repository, install by following the linked
21+ documentation and then::
3722
38- If you'd prefer to install your repo on your system manually, follow the
39- instructions from `package cloud manual installation `__ page. This page will
40- guide you with the specific details to achieve the 3 steps:
23+ $ sudo apt-get install pg-auto-failover-cli
24+ $ sudo apt-get install postgresql-14-auto-failover
4125
42- __ https://packagecloud.io/citusdata/community/install#manual
26+ __ https://wiki.postgresql.org/wiki/Apt
4327
44- 1. install CitusData GnuPG key for its package repository
45- 2. install a new apt source for CitusData packages
46- 3. update your available package list
28+ The Postgres extension named "pgautofailover" is only necessary on the
29+ monitor node. To install that extension, you can install the
30+ ``postgresql-14-auto-failover `` package when using Postgres 14. It's
31+ available for other Postgres versions too.
4732
48- Then when that's done, you can proceed with installing pg_auto_failover
49- itself as in the previous case:
33+ Avoiding the default Postgres service
34+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5035
51- .. code-block :: bash
36+ When installing the debian Postgres package, the installation script will
37+ initialize a Postgres data directory automatically, and register it to the
38+ systemd services. When using pg_auto_failover, it is best to avoid that step.
5239
53- # install pg_auto_failover
54- sudo apt-get install postgresql-11-auto-failover
40+ To avoid automated creation of a Postgres data directory when installing the
41+ debian package, follow those steps:
5542
56- # confirm installation
57- /usr/bin/pg_autoctl --version
43+ ::
44+
45+ $ curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
46+ $ echo "deb http://apt.postgresql.org/pub/repos/apt buster-pgdg main" > /etc/apt/sources.list.d/pgdg.list
47+
48+ # bypass initdb of a "main" cluster
49+ $ echo 'create_main_cluster = false' | sudo tee -a /etc/postgresql-common/createcluster.conf
50+ $ apt-get update
51+ $ apt-get install -y --no-install-recommends postgresql-14
5852
53+ That way when it's time to :ref: `pg_autoctl_create_monitor ` or
54+ :ref: `pg_autoctl_create_postgres ` there is no confusion about how to handle
55+ the default Postgres service created by debian: it has not been created at
56+ all.
57+
5958Fedora, CentOS, or Red Hat
6059--------------------------
6160
0 commit comments