High Availability Agent Configuration
Below are the necessary commands to configure the High Availability Agent in the PostgreSQL Ecosystem:
- PgSmart Client and Agent installed.
- All high availability components installed, respecting the minimum requirements.
- Instance on the same server as the High Availability Agent installed and initialized.
- For a high availability environment, it is recommended to use dedicated servers for each component.
- Distributed Configuration Repository (DCS) configured.
In a high availability environment, it is recommended to use dedicated servers for each component.
Non-interactive execution is disabled for this operation.
- 
Select the PgSmart Agent(or Register new Agent).
- 
Enter the name of the High Availability Environment.
- 
Identify the Server.
- Instructions
- Video
Connection Data Configuration for High Availability Agent:
- 
Identify the network interfaceto be used internally by the High Availability Agent.
- 
Identify the portto be used by the High Availability Agent.
Connection Data Configuration for the Repository
- 
Confirm if the Distributed Configuration Store (DCS) has already been configured (prerequisite): 3.1. Enter the IP addressof the DCS for client requests.3.2. Enter the portof the DCS for client requests.3.3. Confirm if you wish to add another server to compose the Distributed Configuration Store and update its data if affirmative. 
PostgreSQL Instance Data Configuration
- 
Enter the Instance data: 4.1. Enter the network interface for monitoringthe PostgreSQL instance.4.2. Enter the network interface for access to the PostgreSQL instance.4.3. Confirm the existence of the PostgreSQL instance. 4.4. Select the data directoryof the PostgreSQL instance.4.5. Enter the transaction log directoryWALDIR.4.6. Enter the password file directory(PGPASS).4.7. Confirm the existence of a MASTER PostgreSQL instance in the high availability environment. 
Instance User Configuration
- 
Enter Instance User data: 5.1. Enter the replication user name.5.2. Enter the replication user password.5.3. Confirm if the replication user (replication role) already exists in the PostgreSQL instance. 5.4. Enter the high availability agent user name.5.5. Enter the high availability agent user password.5.6. Confirm if the high availability agent (SUPERUSER role) already exists in the PostgreSQL instance. 
Instance Operation Rules Configuration
- 
Enter the Operation Rules: 6.1. Confirm if the PostgreSQL instance can be promoted to MASTER in a failover. 6.2. Confirm if the PostgreSQL instance can be cloned to automatically recreate other instances (requires template(s)). 6.3. Confirm if synchronous replication is allowed. 
PostgreSQL Instance Template Configuration
- 
If cloning is confirmed, PgSmart will proceed to Template Configuration: 7.1. Enter the default character encodingENCODE.7.2. Enter the default regional representationfor dates and monetary values (LOCALE).7.3. Confirm enabling Checksum for data pages. 7.4. Select the network interfacefor data replication.7.5. Confirm if you want to inform another PostgreSQL server(s) that compose(s) the High Availability Environment. 7.5.1. If yes, provide the IP addressof the server(s).7.6. Confirm if you wish to specify the proxy server for the High Availability Environment. 7.6.1. If yes, provide the IP addressof the proxy server(s).
Template Access Rules Configuration
- 
Confirm if you want to include access rules for applications in the initialization template. If affirmative: 8.1. Select the Access Rule Type.8.2. Enter the Database(s).8.3. Enter the User(s) or Group(s).8.4. Enter the Hostname or IP/CIDRauthorized.8.5. Select the authentication method.
Template Users Configuration
- 
Confirm if you want to include users in the initialization template. If affirmative: 9.1. Enter the user name.9.2. Enter the user password.9.3. Select the user privileges [createrole (create users) or createdb (create database)]. 
Service Activation
- 
Activate the Service: 10.1. Confirm saving the High Availability Agent configuration. 10.2. Confirm creating the replicator user in the PostgreSQL instance. 10.3. Confirm creating the patroni user in the PostgreSQL instance. 10.4. Confirm defining the necessary access rules for the High Availability environment in the PostgreSQL instance. 10.5. Confirm RELOAD of the instance to apply the access rules. 10.6. Confirm starting the High Availability Agent service:  Figure 1 - High Availability - Agent - Configuration Figure 1 - High Availability - Agent - Configuration