postgresql_cluster icon indicating copy to clipboard operation
postgresql_cluster copied to clipboard

postgresql cluster (patroni) with PostgresPro

Open ib2828 opened this issue 5 years ago • 3 comments

postgrespro

Compatibility with Postgres Pro Standard

:heavy_exclamation_mark: To use any version of Postgres Pro, you must purchase a license. You can get the version of the DBMS you are interested in for free for testing, exploring the capabilities of the DBMS, and developing application software.

ib2828 avatar May 18 '20 14:05 ib2828

Example for: Installation on: СentOS PostgresPro version: 12.4.1

:heavy_exclamation_mark: To use any version of Postgres Pro in production, you must purchase a license.

  1. Add PostgresPro repository (v12.4.1) for CentOS 7/8 (in the /vars/RedHat.yml variable file)
yum_repository:
  - name: "postgrespro-std"
    description: "Postgres Pro Standard repo"
    baseurl: "http://repo.postgrespro.ru//pgpro-archive/pgpro-12.4.1/centos/{{ ansible_distribution_major_version }}/os/x86_64/rpms"
    gpgkey: "http://repo.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO"
    gpgcheck: "yes"

and disable pgdg repo (optional)

install_postgresql_repo: false
  1. Add PostgresPro packages for automatic installation in the postgresql_packages variable (in the /vars/RedHat.yml variable file):
postgresql_packages:
  - postgrespro-std-{{ postgresql_version }}-server
  - postgrespro-std-{{ postgresql_version }}-client
  - postgrespro-std-{{ postgresql_version }}-contrib
  - postgrespro-std-{{ postgresql_version }}-devel
  1. Specify postgresql_bin_dir and postgresql_unix_socket_dir as follows:
postgresql_data_dir: "/var/lib/pgpro/std-{{ postgresql_version }}/data"  # or other path to PGDATA
postgresql_bin_dir: "/opt/pgpro/std-{{ postgresql_version }}/bin"
postgresql_unix_socket_dir: "/tmp"
  1. Add/edit the necessary PostgreSQL parameters (in the /vars/main.yml variable file):
postgresql_version: "12"

postgresql_users:  # this is optional
postgresql_databases:  # this is optional
postgresql_extensions:  # this is optional

postgresql_parameters:
  - {option: "max_connections", value: "100"}
  - {option: "superuser_reserved_connections", value: "5"}
  - {option: "max_locks_per_transaction", value: "512"}
  ...

Specify all other variables according to your personal requirements for the database cluster.

Deployment: quick start

vitabaks avatar May 19 '20 12:05 vitabaks

Tested with Postgres Pro Standard 12.2.1 on Centos 7 and 8.

vitabaks avatar May 20 '20 10:05 vitabaks

Tested with Postgres Pro Standard 12.2.1 on Debian, Ubuntu.

PostgresPro repository for Debian / Ubuntu (ex. v12.4.1) (in the /vars/Debian.yml variable file)

apt_repository_keys:
  - key: "http://repo.postgrespro.ru/keys/GPG-KEY-POSTGRESPRO"
apt_repository:
  - repo: "deb http://repo.postgrespro.ru//pgpro-archive/pgpro-12.4.1/{{ ansible_distribution |lower }}/ {{ ansible_distribution_release }} main"

dev package is named differently (different from RHEL)

postgresql_packages:
  - postgrespro-std-{{ postgresql_version }}-server
  - postgrespro-std-{{ postgresql_version }}-client
  - postgrespro-std-{{ postgresql_version }}-contrib
  - postgrespro-std-{{ postgresql_version }}-dev

vitabaks avatar May 22 '20 13:05 vitabaks