Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

postgresql cluster (patroni) with PostgresPro #38

Open
ib2828 opened this issue May 18, 2020 · 3 comments
Open

postgresql cluster (patroni) with PostgresPro #38

ib2828 opened this issue May 18, 2020 · 3 comments
Labels
question Further information is requested

Comments

@ib2828
Copy link

ib2828 commented May 18, 2020

postgrespro

Compatibility with Postgres Pro Standard

❗ 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 ib2828 changed the title patroni : Check PostgreSQL is started and accepting connections on Master to add a feature for installation PostgresPro May 18, 2020
@vitabaks vitabaks self-assigned this May 18, 2020
@vitabaks vitabaks added the enhancement New feature or request label May 18, 2020
@vitabaks vitabaks changed the title to add a feature for installation PostgresPro postgresql cluster (patroni) with PostgresPro May 19, 2020
@vitabaks vitabaks added help wanted Extra attention is needed and removed help wanted Extra attention is needed labels May 19, 2020
@vitabaks
Copy link
Owner

vitabaks commented May 19, 2020

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

❗ 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 added a commit that referenced this issue May 19, 2020
#38
The pgbouncer package from the postgrespro repository installs the binary file under the path /usr/sbin/pgbouncer, but the package from the pgdg repository for the RedHat family is installed under the path /usr/bin/pgbouncer.

Check for the presence of the file /usr/bin/pgbouncer, if it is not exist, create a symlink on /usr/sbin/pgbouncer.
This is necessary for compatibility with the standard pgbouncer package from the pgdg repository.
vitabaks added a commit that referenced this issue May 19, 2020
#38
postgrespro-std service naming support.
@vitabaks
Copy link
Owner

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

vitabaks added a commit that referenced this issue May 20, 2020
#38
for CentOS 7/8 linux distro
vitabaks added a commit that referenced this issue May 20, 2020
#38
schedule:
Check once a week.
vitabaks added a commit that referenced this issue May 22, 2020
#38
1. In the PostgresPro DBMS, the configuration file postgresql.conf is located in the data directory (data_directory).
Therefore, there is no need to pre-create configuration files along the path /etc /postgresql/... for postgresql_exists='false' scenario.

2. PostgresPro does not have the pg_ctlcluster package.
Therefore, the decision was made:
* remove the launch of pg_ctlcluster for the "status" command, just call pg_ctl;
* remove the start of pg_ctlcluster and pg_ctl for the "reload" command, use psql and the pg_reload_conf function instead.
This allows you to reduce the amount of code and conditions, as it is suitable for all types of Linux distributions.

3. Support for naming postgrespro-std services for the Debian family.
@vitabaks
Copy link
Owner

vitabaks commented May 22, 2020

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 vitabaks added question Further information is requested and removed enhancement New feature or request labels May 26, 2020
@vitabaks vitabaks removed their assignment May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants