Skip to content

Latest commit

 

History

History
174 lines (115 loc) · 7.36 KB

File metadata and controls

174 lines (115 loc) · 7.36 KB

Install Percona Distribiution for PostgreSQL from binary tarballs

You can find the binary tarballs on the Percona website. Select the desired version from a version dropdown and All from the Select Platform dropdown.

NOTE:
Unlike package managers, A tarball installation don't have the facility to make sure that all dependancies are resolved to the right version of libraries. There is no method to ensure that libraries are present and not getting removed. Broken dependancies could result in errors, crashes or even corruption. So tarball installation is not suggestable for any safe, secure, reliable and mission critical uses.

There are the following tarballs available both for x86_64 and ARM64 architectures:

  • percona-postgresql-{{dockertag}}-ssl1.1-linux-aarch64.tar.gz - for operating systems on ARM64 architecture that run OpenSSL version 1.x
  • percona-postgresql-{{dockertag}}-ssl1.1-linux-x86_64.tar.gz - for operating systems on x86_64 architecture that run OpenSSL version 1.x
  • percona-postgresql-{{dockertag}}-ssl3-linux-aarch64.tar.gz - for operating systems on ARM64 architecture that run OpenSSL version 3.x
  • percona-postgresql-{{dockertag}}-ssl3-linux-x86_64.tar.gz - for operating systems on x86_64 architecture that run OpenSSL version 3.x

To check what OpenSSL version you have, run the following command:

$ openssl version

Tarball contents

The tarballs include the following components:

Component Description
percona-postgresql{{pgversion}} The latest version of PostgreSQL server and the following extensions:
- pgaudit
- pgAudit_set_user
- pg_repack
- pg_stat_monitor
- pg_gather
- wal2json
- postGIS
- the set of contrib extensions
percona-haproxy A high-availability solution and load-balancing solution
percona-patroni A high-availability solution for PostgreSQL
percona-pgbackrest A backup and restore tool
percona-pgbadger PostgreSQL log analyzer with fully detailed reports and graphs
percona-pgbouncer Lightweight connection pooler for PostgreSQL
percona-pgpool-II A middleware between PostgreSQL server and client for high availability, connection pooling and load balancing
percona-perl A Perl module required to create the plperl extension - a procedural language handler for PostgreSQL that allows writing functions in the Perl programming language
percona-python3 A Python3 module required to create plpython extension - a procedural language handler for PostgreSQL that allows writing functions in the Python programming language. Python is also required by Patroni
percona-tcl Tcl development libraries required to create the pltcl extension - a loadable procedural language for the PostgreSQL database system that enables the creation of functions and trigger procedures in the Tcl language
percona-etcd A key-value distributed store that stores the state of the PostgreSQL cluster

Preconditions

=== "Debian and Ubuntu"

1. Uninstall the upstream PostgreSQL package. 
2. Create the user to own the PostgreSQL process. For example, `mypguser`. Run the following command:

    ```{.bash data-prompt="$"}
    $ sudo useradd -m mypguser
    ```

    Set the password for the user:

    ```{.bash data-prompt="$"}
    $ sudo passwd mypguser
    ```

=== "RHEL and derivatives"

Create the user to own the PostgreSQL process. For example, `mypguser`, Run the following command: 
    
```{.bash data-prompt="$"}
$ sudo useradd mypguser -m 
```

Set the password for the user:

```{.bash data-prompt="$"}
$ sudo passwd mypguser
```

Procedure

The steps below install the tarballs for OpenSSL 3.x on x86_64 architecture. Use another tarball if your operating system has OpenSSL version 1.x and / or has the ARM64 architecture.

  1. Create the directory where you will store the binaries. For example, /opt/pgdistro

  2. Grant access to this directory for the mypguser user.

    $ sudo chown mypguser:mypguser /opt/pgdistro/
  3. Fetch the binary tarball.

    $ wget https://downloads.percona.com/downloads/postgresql-distribution-17/{{dockertag}}/binary/tarball/percona-postgresql-{{dockertag}}-ssl3-linux-x86_64.tar.gz
  4. Extract the tarball to the directory for binaries that you created on step 1.

    $ sudo tar -xfv percona-postgresql-{{dockertag}}-ssl3-linux-x86_64.tar.gz -C /opt/pgdistro/
  5. If you extracted the tarball in a directory other than /opt, copy percona-python3, percona-tcl and percona-perl to the /opt directory. This is required for the correct run of libraries that require those modules.

    $ sudo cp <path_to>/percona-perl <path_to>/percona-python3 <path_to>/percona-tcl /opt/
  6. Add the location of the binaries to the PATH variable:

    $ export PATH=:/opt/pgdistro/percona-haproxy/sbin/:/opt/pgdistro/percona-patroni/bin/:/opt/pgdistro/percona-pgbackrest/bin/:/opt/pgdistro/percona-pgbadger/:/opt/pgdistro/percona-pgbouncer/bin/:/opt/pgdistro/percona-pgpool-II/bin/:/opt/pgdistro/percona-postgresql{{pgversion}}/bin/:/opt/pgdistro/percona-etcd/bin/:/opt/percona-perl/bin/:/opt/percona-tcl/bin/:/opt/percona-python3/bin/:$PATH
  7. Create the data directory for PostgreSQL server. For example, /usr/local/pgsql/data.

  8. Grant access to this directory for the mypguser user.

    $ sudo chown mypguser:mypguser /usr/local/pgsql/data
  9. Switch to the user that owns the Postgres process. In our example, mypguser:

    $ su - mypguser
  10. Initiate the PostgreSQL data directory:

    $ /opt/pgdistro/percona-postgresql{{pgversion}}/bin/initdb -D /usr/local/pgsql/data

    ??? example "Sample output"

     ```{.text .no-copy}
     Success. You can now start the database server using:
    
     /opt/pgdistro/percona-postgresql{{pgversion}}/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
     ```
    
  11. Start the PostgreSQL server:

    $ /opt/pgdistro/percona-postgresql{{pgversion}}/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start

    ??? example "Sample output"

    ```{.text .no-copy}
    waiting for server to start.... done
    server started
    ```
    
  12. Connect to psql

    $ /opt/pgdistro/percona-postgresql{{pgversion}}/bin/psql -d postgres

    ??? example "Sample output"

     ```{.text .no-copy}
     psql ({{pspgversion}} (Percona Server for PostgreSQL), server {{pspgversion}} (Percona Server for PostgreSQL))
     Type "help" for help.
    
     postgres=#
     ```
    

Start the components

After you unpacked the tarball and added the location of the components' binaries to the $PATH variable, the components are available for use. You can invoke a component by running its command-line tool.

For example, to check HAProxy version, type:

$ haproxy version

Some components require additional setup. Check the Enabling extensions page for details.