Skip to main content
Version 4.0.0

High Availability Proxy Configuration

Below are the necessary commands to configure the high availability proxy(ies) in the PostgreSQL Ecosystem:

Prerequisites
note

In a high availability environment, it is recommended to use servers dedicated exclusively to each component.

Command Syntax
Terminal input
    pgsmart ha proxy config [Flags]

Flags:

  • -h, --help => Help
Non-Interactive Configuration

Non-interactive execution is disabled for this operation.

Interactive Configuration
  1. Select the PgSmart Agent (or Register new Agent).

  2. Confirm if the High Availability Agent is already configured on all PostgreSQL instances.

  3. Enter the High Availability Environment Name. [Default: pgsys-producao]

Instance Configuration (configure all PostgreSQL instances that are part of the High Availability Environment):

  1. Enter the server identification name of PostgreSQL Instance [1].

  2. Enter the IP address for accessing PostgreSQL Instance [1].

  3. Enter the port for accessing PostgreSQL Instance [1]. [Default: 5432]

  4. Enter the Agent Port of High Availability Agent for PostgreSQL Instance [1]. [Default: 8008]

  5. Confirm whether you want to add another PostgreSQL instance.

    note

    It is possible to inform more than one PostgreSQL instance; simply confirm the need for additional inclusion.

Connection Data Configuration

  1. Enter the port for accessing PostgreSQL via the high availability proxy. [Default: 5432]

Service Activation

  1. Confirm to save the settings and start the high availability proxy service.

    note

    To test access to the High Availability environment through the proxy, use the command:

    Terminal input
        psql -U <HA agent user> -h <proxy IP address> -p <PostgreSQL access port via proxy> postgres

    Example:

    Terminal input
        psql -U patroni -h 192.168.200.135 -p 5432 postgres
    Figure 1 - High Availability - Proxy - Configuration
    Figure 1 - High Availability - Proxy - Configuration