Skip to main content
Version 4.0.0

High Availability Service Installation

The PostgreSQL Ecosystem components with which PgSmart integrates to provide the High Availability service are: Patroni, etcd, and HAProxy.

Prerequisites
  • PgSmart CLI must be installed, after meeting the minimum requirements.

  • Extra package repository to resolve indirect dependencies. In compliance with each organization's security and support policies, Tecnisys does not provide these packages. For Enterprise Linux family distributions, the Extra Packages for Enterprise Linux - EPEL repository usually provides the necessary indirect dependencies.

  • The PgSmart Agent service must be started on all database nodes.

    Terminal input
        systemctl start pgsmart-agent
  • Access using the local pgsmart user. For example:

    Terminal input
        su - pgsmart
  • PgSmart Agents Registration through PgSmart-Client.

    warning

    We recommend dedicated servers for each high availability service component.

    warning

    The High Availability Agent, represented by the Patroni component, must be installed on the same server as the Database Service, represented by the PostgreSQL component.

Command Syntax
Terminal input
    pgsmart install -a <agent> --service=ha --ha-components={agent|dcs|proxy}

Flags

  • -M, --pg-version=11–17 => Defines the PostgreSQL major version to install. The latest available release will be used.
  • -a, --agent=<agent> => Defines the alias, hostname, or IP address where a PgSmart Agent is installed.
  • -h, --help => Displays help.
  • -q, --quiet => Non-interactive execution for installing services. Used together with --service, --pg-version, and --agent.
  • -s, --service=(adm|db|backup|pool|ha|obs) => PostgreSYS Platform Services.
  • --ha-components=(agent|dcs|proxy) => High Availability service components. Used with --quiet, --service=ha, and --agent:
    • agent → High Availability Agent
    • dcs → Distributed Configuration Repository
    • proxy → High Availability Proxy
Non-Interactive Installation

This installation mode is activated by the quiet option (--quiet, -q) and uses default values for parameters not provided. However, this option is disabled during the first installation, due to the need to create the PostgreSYS package repository based on interactively collected information.

Terminal input
    pgsmart install -q -a <agent> --service=ha --ha-components={agent|dcs|proxy}
Figure 1 - HA Installation - Non-Interactive
Figure 1 - HA Installation - Non-Interactive
Interactive Installation
Terminal input
    pgsmart install
  1. Select the PgSmart Agent (or Register a new Agent).
  2. Select the Alta Disponibilidade service.
  3. Select the desired High Availability component (agent|dcs|proxy).
  4. Select the PostgreSQL Major Base Version.
  5. Select the Release of the PostgreSQL major version.
  6. Confirm the installation.
  7. Confirm whether to install/update the PostgreSYS package repository.

7.1 If yes, select Provide and enter:

  • Repository URL.

  • Identification code.

  • Repository name.

  • Repository user (optional if different from the Tecnisys standard).

  • Repository password (optional if different from the Tecnisys standard).

  • Confirm whether to activate GPG key verification.

    • If yes, provide the path to the GPG key file.
note
  • For local installation, don't forget to download and import the GPG public key of the repositories (RPM-GPG-KEY-PGSYS).

    For example, for RHEL 8 distributions, access:

File path
  https://repo.tecnisys.com.br/repository/yum/pgsys/repos/4.0.0/rhel-8-x86_64/RPM-GPG-KEY-PGSYS
  • The compressed installation packages (tar.gz) already include the public GPG key.
Figure 2 - HA Installation - Interactive
Figure 2 - HA Installation - Interactive

Command Variations for Interactive Installation

Some parameters can be pre-passed through the command line. However, without the quiet option (--quiet, -q), execution remains interactive and those parameters are used as default in the prompts.

Examples:

Terminal input
    pgsmart install --service=ha
Terminal input
    pgsmart install --ha-components=agent
Final Notes
note

The installation process can be monitored via the PgSmart log file:

Terminal input
  tail -f /var/log/pgsmart-agent/pgsmart.log
Terminal input
  tail -f /var/log/pgsmart-client/pgsmart.log
note

PgSmart defines environment variables (e.g., PGDATA, PGBIN) in the current user's ~/.bash_profile. These variables are applied in new terminal sessions. To apply them immediately without logging out, run:

Terminal input
    source ~/.bash_profile