High Availability Service Installation
The PostgreSQL Ecosystem components with which PgSmart integrates to provide the High Availability service are: Patroni, etcd, and HAProxy.
- 
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 inputsystemctl start pgsmart-agent
- 
Access using the local pgsmartuser. For example:Terminal inputsu - pgsmart
- 
PgSmart Agents Registration through PgSmart-Client. warningWe recommend dedicated servers for each high availability service component. warningThe High Availability Agent, represented by the Patroni component, must be installed on the same server as the Database Service, represented by the PostgreSQL component. 
    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
 
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.
- Command
- Video
    pgsmart install -q -a <agent> --service=ha --ha-components={agent|dcs|proxy}

- Instructions
- Agent
- DCS
- Proxy
    pgsmart install
- Select the PgSmart Agent(or Register a new Agent).
- Select the Alta Disponibilidadeservice.
- Select the desired High Availability component(agent|dcs|proxy).
- Select the PostgreSQL Major Base Version.
- Select the Releaseof the PostgreSQL major version.
- Confirm the installation.
- 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.
 
- 
For local installation, don't forget to download and import the GPG public key of the repositories (PGSYS-GPG-KEY). For example, for RHEL, CentOS and similars: URL da Chave GPGhttps://repo.tecnisys.com.br/repository/yum/pgsys/components/4.1.0/rhel-8-x86_64/PGSYS-GPG-KEY/PGSYS-GPG-KEYfor SUSE and similars: DynamicCommand type="gpg-url-suse" version=4.1.0 /> for Debian, Ubuntu and similars: URL da Chave GPGhttps://repo.tecnisys.com.br/repository/apt/pgsys/components/4.1.0/PGSYS-GPG-KEY.asc
- 
The compressed installation packages (tar.gz) already include the public GPG key. 

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:
    pgsmart install --service=ha
    pgsmart install --ha-components=agent
The installation process can be monitored via the PgSmart log file:
  tail -f /var/log/pgsmart-agent/pgsmart.log
  tail -f /var/log/pgsmart-client/pgsmart.log
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:
    source ~/.bash_profile