diff --git a/docs/apt.md b/docs/apt.md index 74fb9a7eb..a512f0ec7 100644 --- a/docs/apt.md +++ b/docs/apt.md @@ -1,10 +1,10 @@ # Install Percona Distribution for PostgreSQL on Debian and Ubuntu -This document describes how to install Percona Server for PostgreSQL from Percona repositories on DEB-based distributions such as Debian and Ubuntu. +This document describes how to install Percona Server for PostgreSQL from Percona repositories on DEB-based distributions such as Debian and Ubuntu. [Read more about Percona repositories :material-arrow-top-right:](repo-overview.md). ## Preconditions -Debian and other systems that use the apt package manager include the upstream PostgreSQL server package (postgresql-15) by default. The components of Percona Distribution for PostgreSQL 15 can only be installed together with the PostgreSQL server shipped by Percona (percona-postgresql-15). If you wish to use Percona Distribution for PostgreSQL, uninstall the PostgreSQL package provided by your distribution (postgresql-15) and then install the chosen components from Percona Distribution for PostgreSQL. +Debian and other systems that use the `apt` package manager include the upstream PostgreSQL server package `postgresql-16` by default. The components of Percona Distribution for PostgreSQL 16 can only be installed together with the PostgreSQL server shipped by Percona (`percona-postgresql-16`). If you wish to use Percona Distribution for PostgreSQL, uninstall the `postgresql-16` package provided by your distribution and then install the chosen components from Percona Distribution for PostgreSQL. ## Procedure @@ -36,8 +36,6 @@ Run all the commands in the following sections as root or using the `sudo` comma Percona provides [two repositories](repo-overview.md) for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates. - To enable a repository, we recommend using the `setup` command: - ```{.bash data-prompt="$"} $ sudo percona-release setup ppg-16 ``` @@ -45,6 +43,8 @@ Run all the commands in the following sections as root or using the `sudo` comma ### Install packages === "Install using meta-package" + + The [meta package](repo-overview.md#percona-ppg-server){:target=”_blank”} enables you to install several components of the distribution in one go. ```{.bash data-prompt="$"} $ sudo apt install percona-ppg-server-16 diff --git a/docs/docker.md b/docs/docker.md new file mode 100644 index 000000000..6f1ab0a8b --- /dev/null +++ b/docs/docker.md @@ -0,0 +1,168 @@ +# Run Percona Distribution for PostgreSQL in a Docker container + +Docker images of Percona Distribution for PostgreSQL are hosted publicly on [Docker Hub](https://hub.docker.com/r/percona/percona-distribution-postgresql/). + +For more information about using Docker, see the [Docker Docs](https://docs.docker.com/). + +!!! note "" + + Make sure that you are using the latest version of Docker. The ones provided via `apt` and `yum` may be outdated and cause errors. + + By default, Docker pulls the image from Docker Hub if it is not available locally. + +??? admonition "Docker image contents" + + The Docker image of Percona Distribution for PostgreSQL includes the following components: + + | Component name | Description | + |-------------------------------|--------------------------------------| + | `percona-postgresql{{pgversion}}`| A metapackage that installs the latest version of PostgreSQL| + | `percona-postgresql{{pgversion}}-server` | The PostgreSQL server package. | + | `percona-postgresql-common` | PostgreSQL database-cluster manager. It provides a structure under which multiple versions of PostgreSQL may be installed and/or multiple clusters maintained at one time.| + | `percona-postgresql-client-common`| The manager for multiple PostgreSQL client versions.| + | `percona-postgresql{{pgversion}}-contrib` | A collection of additional PostgreSQLcontrib extensions | + | `percona-postgresql{{pgversion}}-libs`| Libraries for use with PostgreSQL.| + | `percona-pg-stat-monitor{{pgversion}}` | A Query Performance Monitoring tool for PostgreSQL. | + | `percona-pgaudit` | Provides detailed session or object audit logging via the standard PostgreSQL logging facility. | + | `percona-pgaudit{{pgversion}}_set_user`| An additional layer of logging and control when unprivileged users must escalate themselves to superuser or object owner roles in order to perform needed maintenance tasks.| + | `percona-pg_repack{{pgversion}}`| rebuilds PostgreSQL database objects.| + | `percona-wal2json{{pgversion}}` | a PostgreSQL logical decoding JSON output plugin.| + +## Start the container + +1. Start a Percona Distribution for PostgreSQL container as follows: + + ```{.bash data-prompt="$"} + $ docker run --name container-name -e POSTGRES_PASSWORD=secret -d percona/percona-distribution-postgresql:tag + ``` + + Where: + + * `container-name` is the name you assign to your container + * `POSTGRES_PASSWORD` is the superuser password + * `tag` is the tag specifying the version you want. + + Check the [full list of tags](https://hub.docker.com/r/percona/percona-distribution-postgresql/tags/). + + + !!! tip + + You can secure the password by exporting it to the environment file and using that to start the container. + + 1. Export the password to the environment file: + + ```{.bash data-prompt="$"} + $ echo "POSTGRES_PASSWORD=secret" > .my-pg.env + ``` + + 2. Start the container: + + ```{.bash data-prompt="$"} + $ docker run --name container-name --env-file ./.my-pg.env -d percona/percona-distribution-postgresql:tag + ``` + +2. Connect to the container's interactive terminal: + + ```{.bash data-prompt="$"} + $ docker exec -it container-name bash + ``` + + The `container-name` is the name of the container that you started in the previous step. + + +## Connect to Percona Distribution for PostgreSQL from an application in another Docker container + +This image exposes the standard PostgreSQL port (`5432`), so container linking makes the instance available to other containers. Start other containers like this in order to link it to the Percona Distribution for PostgreSQL container: + +```{.bash data-prompt="$"} +$ docker run --name app-container-name --network container:container-name -d app-that-uses-postgresql +``` + +where: + +* `app-container-name` is the name of the container where your application is running, +* `container name` is the name of your Percona Distribution for PostgreSQL container, and +* `app-that-uses-postgresql` is the name of your PostgreSQL client. + +## Connect to Percona Distribution for PostgreSQL from the `psql` command line client + +The following command starts another container instance and runs the `psql` command line client against your original container, allowing you to execute SQL statements against your database: + +```{.bash data-prompt="$"} +$ docker run -it --network container:db-container-name --name container-name percona/percona-distribution-postgresql:tag psql -h address -U postgres +``` + +Where: + +* `db-container-name` is the name of your database container +* `container-name` is the name of your container that you will use to connect to the database container using the `psql` command line client +* `tag` is the tag specifying the Docker image version you want to use. +* `address` is the network address where your database container is running. Use 127.0.0.1, if the database container is running on the local machine/host. +## Enable `pg_stat_monitor` + +To enable the `pg_stat_monitor` extension after launching the container, do the following: + +* connect to the server, +* select the desired database and enable the `pg_stat_monitor` view for that database: + + ```sql + create extension pg_stat_monitor; + ``` + +* to ensure that everything is set up correctly, run: + + ```sql + \d pg_stat_monitor; + ``` + +??? example "Output" + + ``` + View "public.pg_stat_monitor" + Column | Type | Collation | Nullable | Default + ---------------------+--------------------------+-----------+----------+--------- + bucket | integer | | | + bucket_start_time | timestamp with time zone | | | + userid | oid | | | + dbid | oid | | | + queryid | text | | | + query | text | | | + plan_calls | bigint | | | + plan_total_time | numeric | | | + plan_min_timei | numeric | | | + plan_max_time | numeric | | | + plan_mean_time | numeric | | | + plan_stddev_time | numeric | | | + plan_rows | bigint | | | + calls | bigint | | | + total_time | numeric | | | + min_time | numeric | | | + max_time | numeric | | | + mean_time | numeric | | | + stddev_time | numeric | | | + rows | bigint | | | + shared_blks_hit | bigint | | | + shared_blks_read | bigint | | | + shared_blks_dirtied | bigint | | | + shared_blks_written | bigint | | | + local_blks_hit | bigint | | | + local_blks_read | bigint | | | + local_blks_dirtied | bigint | | | + local_blks_written | bigint | | | + temp_blks_read | bigint | | | + temp_blks_written | bigint | | | + blk_read_time | double precision | | | + blk_write_time | double precision | | | + host | bigint | | | + client_ip | inet | | | + resp_calls | text[] | | | + cpu_user_time | double precision | | | + cpu_sys_time | double precision | | | + tables_names | text[] | | | + wait_event | text | | | + wait_event_type | text | | | + ``` + +Note that the `pg_stat_monitor` view is available only for the databases where you enabled it. If you create a new database, make sure to create the view for it to see its statistics data. + + diff --git a/docs/installing.md b/docs/installing.md index 15ee315bc..7bb6068a2 100644 --- a/docs/installing.md +++ b/docs/installing.md @@ -1,67 +1,42 @@ # Install Percona Distribution for PostgreSQL -Percona provides installation packages in `DEB` and `RPM` format for 64-bit Linux distributions. Find the full list of supported platforms on the [Percona Software and Platform Lifecycle page](https://www.percona.com/services/policies/percona-software-support-lifecycle#pgsql). +Percona Distribution for PostgreSQL is the solution with the collection of tools from PostgreSQL community that are tested to work together and serve to assist you in deploying and managing PostgreSQL. [Read more :material-arrow-top-right: ](index.md). -The default and recommended way to install Percona Distribution for PostgreSQL is from Percona repositories using [percona-release](https://www.percona.com/doc/percona-repo-config/index.html) utility. The **percona-release** utility automatically enables the required repository for you. Then you install and update Percona Distribution for PostgreSQL packages and their dependencies through the package manager of your operating system. +You can select from multiple easy-to-follow installation options, but **we recommend using a Package Manager** for a convenient and quick way to try the software first. -## Repository contents +=== "Package manager" -Percona Distribution for PostgreSQL provides individual packages for its components. It also includes two meta-packages: `percona-ppg-server` and `percona-ppg-server-ha`. + Percona provides installation packages in `DEB` and `RPM` format for 64-bit Linux distributions. Find the full list of supported platforms and versions on the [Percona Software and Platform Lifecycle page](https://www.percona.com/services/policies/percona-software-support-lifecycle#pgsql). -Using a meta-package, you can install all components it contains in one go. + If you are on Debian or Ubuntu, use `apt` for installation. -### `percona-ppg-server` + If you are on Red Hat Enterprise Linux or compatible derivatives, use `yum`. -=== "Package name on Debian/Ubuntu" + [Install via apt :material-arrow-right:](apt.md){.md-button} + [Install via yum :material-arrow-right:](yum.md){.md-button} - `percona-ppg-server-16` + Choose your package manager below to get access to a detailed step-by-step guide. -=== "Package name on RHEL/derivatives" - `percona-ppg-server16` +=== "Docker" -The `percona-ppg-server` meta-package installs the PostgreSQL server with the following packages: + Get our image from Docker Hub and spin up a cluster on a Docker container for quick evaluation. -| Package contents | Description | -| ---------------- | --------------------------------------- | -| `percona-postgresql%{pgmajorversion}-server` | The PostgreSQL server package. | -| `percona-postgresql-common` | PostgreSQL database-cluster manager. It provides a structure under which multiple versions of PostgreSQL may be installed and/or multiple clusters maintained at one time.| -| `percona-postgresql%{pgmajorversion}-contrib` | A collection of additional PostgreSQLcontrib extensions | -| `percona-pg-stat-monitor%{pgmajorversion}` | A Query Performance Monitoring tool for PostgreSQL. | -| `percona-pgaudit` | Provides detailed session or object audit logging via the standard PostgreSQL logging facility. | -| `percona-pg_repack%{pgmajorversion}`| rebuilds PostgreSQL database objects.| -| `percona-wal2json%{pgmajorversion}` | a PostgreSQL logical decoding JSON output plugin.| + Check below to get access to a detailed step-by-step guide. + + [Run in Docker](docker.md){.md-button} -The `%{pgmajorversion}` variable stands for the major version of PostgreSQL. +=== "Kubernetes" -### `percona-ppg-server-ha` + **Percona Operator for Kubernetes** is a controller introduced to simplify complex deployments that require meticulous and secure database expertise. -=== "Package name on Debian/Ubuntu" + Check below to get access to a detailed step-by-step guide. - `percona-ppg-server-ha-16` + [Get started with Percona Operator](https://docs.percona.com/percona-operator-for-postgresql/2.0/quickstart.html){.md-button} -=== "Package name on RHEL/derivatives" - `percona-ppg-server-ha16` -The `percona-ppg-server-ha` meta-package installs high-availability components that are recommended by Percona: -| Package contents | Description | -| ---------------- | --------------------------------------- | -| `percona-patroni`| A high-availability solution for PostgreSQL. | -| `percona-haproxy`| A high-availability and load-balancing solution | -| `etcd` | A consistent, distributed key-value store | -| `python3-python-etcd` | A Python client for ETCD.[^1] | -| `etcd-client`, `etcd-server` | The client/server of the distributed key-value store. [^2]| -## Installation guidelines -To install Percona Distribution for PostgreSQL, refer to the following tutorials: -* [On Debian and Ubuntu](apt.md) -* [On Red Hat Enterprise Linux and derivatives](yum.md) - - - -[^1]: Is included in repositories for RHEL 8 / CentOS 8 operating systems -[^2]: Are included in repositories for Debian 12 operating system \ No newline at end of file diff --git a/docs/repo-overview.md b/docs/repo-overview.md index 0a0738933..7bfe4ade6 100644 --- a/docs/repo-overview.md +++ b/docs/repo-overview.md @@ -4,4 +4,58 @@ Percona provides two repositories for Percona Distribution for PostgreSQL. | Major release repository | Minor release repository | | ------------------------ | ------------------------ | -| *Major Release repository* (`ppg-16`) it includes the latest version packages. Whenever a package is updated, the package manager of your operating system detects that and prompts you to update. As long as you update all Distribution packages at the same time, you can ensure that the packages you’re using have been tested and verified by Percona.

We recommend installing Percona Distribution for PostgreSQL from the *Major Release repository*| *Minor Release repository* includes a particular minor release of the database and all of the packages that were tested and verified to work with that minor release (e.g. `ppg-16.0`). You may choose to install Percona Distribution for PostgreSQL from the Minor Release repository if you have decided to standardize on a particular release which has passed rigorous testing procedures and which has been verified to work with your applications. This allows you to deploy to a new host and ensure that you’ll be using the same version of all the Distribution packages, even if newer releases exist in other repositories.

The disadvantage of using a Minor Release repository is that you are locked in this particular release. When potentially critical fixes are released in a later minor version of the database, you will not be prompted for an upgrade by the package manager of your operating system. You would need to change the configured repository in order to install the upgrade.| \ No newline at end of file +| *Major Release repository* (`ppg-16`) it includes the latest version packages. Whenever a package is updated, the package manager of your operating system detects that and prompts you to update. As long as you update all Distribution packages at the same time, you can ensure that the packages you’re using have been tested and verified by Percona.

We recommend installing Percona Distribution for PostgreSQL from the *Major Release repository*| *Minor Release repository* includes a particular minor release of the database and all of the packages that were tested and verified to work with that minor release (e.g. `ppg-16.0`). You may choose to install Percona Distribution for PostgreSQL from the Minor Release repository if you have decided to standardize on a particular release which has passed rigorous testing procedures and which has been verified to work with your applications. This allows you to deploy to a new host and ensure that you’ll be using the same version of all the Distribution packages, even if newer releases exist in other repositories.

The disadvantage of using a Minor Release repository is that you are locked in this particular release. When potentially critical fixes are released in a later minor version of the database, you will not be prompted for an upgrade by the package manager of your operating system. You would need to change the configured repository in order to install the upgrade.| + +## Repository contents + +Percona Distribution for PostgreSQL provides individual packages for its components. It also includes two meta-packages: `percona-ppg-server` and `percona-ppg-server-ha`. + +Using a meta-package, you can install all components it contains in one go. + +### `percona-ppg-server` + +=== "Package name on Debian/Ubuntu" + + `percona-ppg-server-{{pgversion}}` + +=== "Package name on RHEL/derivatives" + + `percona-ppg-server{{pgversion}}` + +The `percona-ppg-server` meta-package installs the PostgreSQL server with the following packages: + +| Package contents | Description | +| ---------------- | --------------------------------------- | +| `percona-postgresql{{pgversion}}-server` | The PostgreSQL server package. | +| `percona-postgresql-common` | PostgreSQL database-cluster manager. It provides a structure under which multiple versions of PostgreSQL may be installed and/or multiple clusters maintained at one time.| +| `percona-postgresql{{pgversion}}-contrib` | A collection of additional PostgreSQLcontrib extensions | +| `percona-pg-stat-monitor{{pgversion}}` | A Query Performance Monitoring tool for PostgreSQL. | +| `percona-pgaudit` | Provides detailed session or object audit logging via the standard PostgreSQL logging facility. | +| `percona-pg_repack{{pgversion}}`| rebuilds PostgreSQL database objects.| +| `percona-wal2json{{pgversion}}` | a PostgreSQL logical decoding JSON output plugin.| + + +### `percona-ppg-server-ha` + +=== "Package name on Debian/Ubuntu" + + `percona-ppg-server-ha-{{pgversion}}` + +=== "Package name on RHEL/derivatives" + + `percona-ppg-server-{{pgversion}}` + +The `percona-ppg-server-ha` meta-package installs high-availability components that are recommended by Percona: + +| Package contents | Description | +| ---------------- | --------------------------------------- | +| `percona-patroni`| A high-availability solution for PostgreSQL. | +| `percona-haproxy`| A high-availability and load-balancing solution | +| `etcd` | A consistent, distributed key-value store | +| `python3-python-etcd` | A Python client for ETCD.[^1] | +| `etcd-client`, `etcd-server` | The client/server of the distributed key-value store. [^2]| + + + +[^1]: Is included in repositories for RHEL 8 / CentOS 8 operating systems +[^2]: Are included in repositories for Debian 12 operating system \ No newline at end of file diff --git a/docs/yum.md b/docs/yum.md index b7920f6f6..e473a4603 100644 --- a/docs/yum.md +++ b/docs/yum.md @@ -1,21 +1,27 @@ # Install Percona Distribution for PostgreSQL on Red Hat Enterprise Linux and derivatives -This document describes how to install Percona Distribution for PostgreSQL from Percona repositories on RPM-based distributions such as Red Hat Enterprise Linux and compatible derivatives. +This document describes how to install Percona Distribution for PostgreSQL from Percona repositories on RPM-based distributions such as Red Hat Enterprise Linux and compatible derivatives. [Read more about Percona repositories :material-arrow-top-right:](repo-overview.md). ## Platform specific notes -If you intend to install Percona Distribution for PostgreSQL on Red Hat Enterprise Linux v8, disable the ``postgresql`` and ``llvm-toolset``modules: +To install Percona Distribution for PostgreSQL, do the following: -```{.bash data-prompt="$"} -$ sudo dnf module disable postgresql llvm-toolset -``` +=== "On Red Hat Enterprise Linux v8" -On CentOS 7, you should install the ``epel-release`` package: + Disable the ``postgresql`` and ``llvm-toolset``modules: -```{.bash data-prompt="$"} -$ sudo yum -y install epel-release -$ sudo yum repolist -``` + ```{.bash data-prompt="$"} + $ sudo dnf module disable postgresql llvm-toolset + ``` + +=== "On CentOS 7" + + Install the ``epel-release`` package: + + ```{.bash data-prompt="$"} + $ sudo yum -y install epel-release + $ sudo yum repolist + ``` ## Procedure @@ -33,8 +39,6 @@ Run all the commands in the following sections as root or using the `sudo` comma Percona provides [two repositories](repo-overview.md) for Percona Distribution for PostgreSQL. We recommend enabling the Major release repository to timely receive the latest updates. - To enable a repository, we recommend using the `setup` command: - ```{.bash data-prompt="$"} $ sudo percona-release setup ppg-16 ``` @@ -42,6 +46,8 @@ Run all the commands in the following sections as root or using the `sudo` comma ### Install packages === "Install using meta-package" + + The [meta package](repo-overview.md#percona-ppg-server){:target=”_blank”} enables you to install several components of the distribution in one go. ```{.bash data-prompt="$"} $ sudo yum install percona-ppg-server16 diff --git a/mkdocs-base.yml b/mkdocs-base.yml index f09975e01..fb37d6714 100644 --- a/mkdocs-base.yml +++ b/mkdocs-base.yml @@ -77,8 +77,15 @@ markdown_extensions: pymdownx.tilde: {} pymdownx.superfences: {} pymdownx.highlight: - linenums: false + use_pygments: true pymdownx.inlinehilite: {} + pymdownx.snippets: + base_path: ["snippets"] + auto_append: + - services-banner.md + pymdownx.emoji: + emoji_index: !!python/name:materialx.emoji.twemoji + emoji_generator: !!python/name:materialx.emoji.to_svg plugins: @@ -138,15 +145,16 @@ nav: - Installation and Upgrade: - Install Percona Distribution for PostgreSQL: - "Overview": "installing.md" - - "Install on Debian and Ubuntu": "apt.md" - - "Install on RHEL and derivatives": "yum.md" + - "Install via apt": "apt.md" + - "Install via yum": "yum.md" - enable-extensions.md - repo-overview.md + - "Run in Docker": docker.md - migration.md - major-upgrade.md - minor-upgrade.md - Extensions: - - 'pg-stat-monitor': 'pg-stat-monitor.md' + - 'pg_stat_monitor': 'pg-stat-monitor.md' - Solutions: - High availability: - 'High availability': 'solutions/high-availability.md' diff --git a/snippets/supported-versions.md b/snippets/supported-versions.md new file mode 100644 index 000000000..78a2a1077 --- /dev/null +++ b/snippets/supported-versions.md @@ -0,0 +1 @@ +Percona provides installation packages in `DEB` and `RPM` format for 64-bit Linux distributions. Find the full list of supported platforms on the [Percona Software and Platform Lifecycle page](https://www.percona.com/services/policies/percona-software-support-lifecycle#pgsql). diff --git a/variables.yml b/variables.yml index ad157bec6..c1c674d70 100644 --- a/variables.yml +++ b/variables.yml @@ -2,5 +2,5 @@ # See also mkdocs.yml plugins.with-pdf.cover_subtitle and output_path release: 'release-notes-v16.0' -version: '16.0' +pgversion: '16'