5.6. Clusters #
PPEM supports both standard primary-standby and BiHA (Built-in High Availability) clusters. If you install an agent on a server with a created cluster, the cluster is automatically created in the web application.
This section explains how to manage clusters. It includes the following instructions:
For more information, refer to the official Postgres Pro documentation on replication and built-in high availability.
Creating a Cluster
PPEM provides the following ways of creating clusters:
Creating a New Standard Primary-Standby Cluster
When creating a new standard primary-standby cluster, you must specify the parameters of the instance that will be created and used as the primary node.
To create a new standard primary-standby cluster:
In the navigation panel, go to Infrastructure → Clusters.
In the top-right corner of the page, click Create cluster, and then Next.
Enter parameters of the new standard primary-standby cluster (parameters marked with an asterisk are required):
Node name: The unique name of the instance.
Server: The server where the instance is installed.
System user: The OS user who will own the instance files and catalogs and on behalf of which the instance service will run. In most cases, it is the
postgresuser.Ensure that the specified user exists in the OS.
Data catalog: The path to the server catalog where the main instance catalogs and files will be located.
Connection address and Connection port: The network address and port number that the instance will use for receiving client connections.
Authentication method: The authentication method that the instance will use to verify users when receiving client connections.
Possible values:
scram-sha-256.
md5.
trust: Do not perform authentication.
It is recommended to select this value only for test environments.
Database user and Database password: The name and password of the DBMS user that will be created and on behalf of which the agent will connect to the instance.
The default DBMS user name is
postgres.Preset: The configuration preset that will be applied to the instance.
Possible values:
Do not use preset: Do not apply a configuration preset to the instance.
Settings for 1C: Apply the 1C configuration preset to the instance.
Settings for OLTP: Apply the OLTP (Online Transaction Processing) configuration preset to the instance.
You can apply a new configuration preset later.
Servers of standby nodes: Allows adding standby nodes to the standard primary-standby cluster.
It is recommended to have an odd number of nodes to ensure a quorum.
To add a standby node:
Click Add servers.
From Server, select the server where the instance is installed.
When the server is selected, the following instance information is displayed:
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
In Replication mode, select one of the following values:
Synchronous
For this value, in Node identifier, enter the unique name of the node for the
synchronous_standby_namesconfiguration parameter.Asynchronous
(Optional) To add more standby nodes, click Add server.
Click Save.
Click Create cluster.
Creating a New BiHA Cluster
When creating a new BiHA cluster, you must specify the parameters of the instance that will be created and used as the leader node.
Before performing this instruction, satisfy the required prerequisites for setting up a BiHA cluster.
To create a new BiHA cluster:
In the navigation panel, go to Infrastructure → Clusters.
In the top-right corner of the page, click Create cluster.
In Failover manager, select BiHA, and then click Next.
Enter parameters of the new BiHA cluster (parameters marked with an asterisk are required):
Cluster name.
Node name: The unique name of the instance.
Server: The server where the instance is installed.
System user: The OS user who will own the instance files and catalogs and on behalf of which the instance service will run. In most cases, it is the
postgresuser.Ensure that the specified user exists in the OS.
Data catalog: The path to the server catalog where the main instance catalogs and files will be located.
Connection address and Connection port: The network address and port number that the instance will use for receiving client connections.
Authentication method: The authentication method that the instance will use to verify users when receiving client connections.
Possible values:
scram-sha-256.
md5.
trust: Do not perform authentication.
It is recommended to select this value only for test environments.
Database user and Database password: The name and password of the DBMS user that will be created and on behalf of which the agent will connect to the instance.
The default DBMS user name is
postgres.Password for connection: The password for the
biha_replication_userrole. This role is used for connecting follower nodes to the leader node.For more information, refer to the official Postgres Pro documentation on BiHA roles.
Preset: The configuration preset that will be applied to the instance.
Possible values:
Do not use preset: Do not apply a configuration preset to the instance.
Settings for 1C: Apply the 1C configuration preset to the instance.
Settings for OLTP: Apply the OLTP (Online Transaction Processing) configuration preset to the instance.
You can apply a new configuration preset later.
Servers of followers: Allows adding follower nodes to the BiHA cluster.
It is recommended to have an odd number of nodes to ensure a quorum.
To add a follower node:
Click Add servers.
From Server, select the server where the instance is installed.
When the server is selected, the following instance information is displayed:
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
(Optional) To add more follower nodes, click Add server.
Click Save.
Click Create cluster.
Creating a Standard Primary-Standby Cluster from an Existing Instance
Before performing this instruction, create an instance.
To create a standard primary-standby cluster from an existing instance:
In the navigation panel, go to Infrastructure → Clusters.
In the top-right corner of the page, click Create cluster.
In Creation mode, select From instance, and then click Next.
Enter parameters of the new standard primary-standby cluster (parameters marked with an asterisk are required):
Primary node: The instance that will be used as the primary node of the standard primary-standby cluster.
When the instance is selected, the following information is displayed:
Version and edition: The Postgres Pro version and edition installed on the instance server.
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
User: The name of the DBMS superuser on behalf of which the agent connects to the instance.
Servers of standby nodes: Allows adding standby nodes to the standard primary-standby cluster.
It is recommended to have an odd number of nodes to ensure a quorum.
To add a standby node:
Click Add servers.
From Server, select the server where the instance is installed.
When the server is selected, the following instance information is displayed:
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
From Replication mode, select one of the following values:
Synchronous
For this value, in Node identifier, enter the unique name of the standby node for the
synchronous_standby_namesconfiguration parameter.Asynchronous
(Optional) To add more standby nodes, click Add server.
Click Save.
Click Create cluster.
Creating a BiHA Cluster from an Existing Instance
Before performing this instruction, satisfy the required prerequisites for setting up a BiHA cluster.
To create a BiHA cluster from an existing instance:
In the navigation panel, go to Infrastructure → Clusters.
In the top-right corner of the page, click Create cluster.
In Creation mode, select From instance.
In Failover manager, select BiHA, and then click Next.
Enter parameters of the new BiHA cluster (parameters marked with an asterisk are required):
Leader: The instance that will be used as the leader node of the cluster.
When the instance is selected, the following information is displayed:
Version and edition: The Postgres Pro version and edition installed on the instance server.
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
Password for connection: The password for the
biha_replication_userrole. This role is used for connecting follower nodes to the leader node.For more information, refer to the official Postgres Pro documentation on BiHA roles.
Servers of followers: Allows adding follower nodes to the BiHA cluster.
It is recommended to have an odd number of nodes to ensure a quorum.
To add a follower node:
Click Add servers.
From Server, select the server where the instance is installed.
When the server is selected, the following instance information is displayed:
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
(Optional) To add more follower nodes, click Add server.
Click Save.
Click Create cluster.
Viewing Clusters
In the navigation panel, go to Infrastructure → Clusters.
The table of clusters with the following columns will be displayed:
Cluster: The unique name and identifier of the cluster.
Failover manager.
Possible values:
Missing
Patroni
Biha
Nodes, pcs.: The number of the cluster nodes.
Version: The Postgres Pro version and edition of the cluster nodes.
State.
Possible values:
Active: All cluster nodes are started.
Stale: Replication is stopped in the cluster.
Promotion: The primary/leader node of the cluster is being changed.
Network Address: The network address of the primary/leader cluster node.
Last update: The date and time when the cluster state information was last updated.
Note
The manager receives cluster state information from agents with a delay. Due to the delay, the web application can display outdated information.
Actions.
For more information about available actions, refer to other instructions in this section.
Editing a Cluster
In the navigation panel, go to Infrastructure → Clusters.
Click
next to the cluster.
Edit cluster parameters.
Click Save.
Deleting a Cluster
Important
Deleted clusters cannot be restored.
In the navigation panel, go to Infrastructure → Clusters.
Click
next to the cluster.
Confirm the operation and click Delete.
Managing Nodes of BiHA Clusters #
This section explains how to manage nodes of BiHA clusters. It includes the following instructions:
Before performing these instructions, create a BiHA cluster.
Viewing Nodes
In the navigation panel, go to Infrastructure → Clusters.
Click the name of the BiHA cluster.
The table of nodes with the following columns will be displayed:
Instance: The unique name of the instance.
This column includes additional information:
Type: The type of the node.
Possible values:
Leader
Follower
Parent node: The leader of the BiHA cluster.
Node status: The status of the instance.
Possible values:
Unknown: The status of the instance is unknown.Initialization scheduled: The instance initialization was scheduled.
Initializing: The instance is being initialized.
Initialized: The instance is initialized.
Restoring: The instance is being created from a backup.
Restored: The instance is created from the backup.
Restore canceled: The creation of an instance from a backup was canceled.
Starting: The instance is being started.
Started: The instance is started.
Stopping: The instance is being stopped.
Stopped: The instance is stopped.
Restarting: The instance is being restarted.
Reloading: The cluster is being reloaded.
Failed: There is an error with the instance.
Scheduled for removal: The instance is being deleted.
Base backup: A backup is being created for the instance.
Agent not responding: The agent installed on the instance server is not responding.
Replication mode.
Possible values:
Synchronous
Asynchronous
This column includes additional information:
Status: The status of replication.
Possible values:
Active
Inactive
Network Address: The network address of the node.
This column includes additional information:
Server: The server where the instance is installed.
User: The role used for connecting the follower node to the leader role. Usually, this is the
biha_replication_userrole.Application: The application used for connecting the follower node to the leader node.
Connection: The date and time when the follower node connected to the leader node.
Horizon Visibility: The transaction visibility horizon of the node.
Lag: The data lag between the leader and the follower node, in bytes.
This column includes additional information:
Send: The amount of WAL generated by the leader node, but not yet sent to the follower node.
Write: The amount of WAL sent to the follower node, but not yet written to the memory.
Flush: The amount of WAL written to the memory of the follower node, but not yet saved to the disk.
Replay: The amount of WAL saved to the disk of the follower node, but not yet applied to the database.
Lag time: The time lag between the leader and the follower node, in seconds.
This column includes additional information:
Write: The time passed between the leader node sending WAL to the follower node and the follower node writing it to the memory.
Flush: The time passed between the follower node writing WAL to the memory and saving it to the disk.
Replay: The time passed between the follower node saving WAL to the disk and applying it to the database.
Reply time: The date and time when the leader node last received information from the follower node.
Actions.
For more information about available actions, refer to other instructions in this section.
Selecting a New Leader Node
In the navigation panel, go to Infrastructure → Clusters.
Click the name of the BiHA cluster.
Click
next to the follower node.
Confirm the operation and click Confirm.
Adding a Follower Node
In the navigation panel, go to Infrastructure → Clusters.
Click the name of the BiHA cluster.
In the top-right corner of the page, click Edit topology.
Click Add server.
From Server, select the server where the instance is installed.
When the server is selected, the following instance information is displayed:
Data catalog: The path to the server directory where the main instance directories and files are located.
Network address and Port: The network address and port number that the instance uses to accept client connections.
Click Save.
Deleting a Follower Node
Important
You can only delete follower nodes. To delete the leader node, select a new leader node first.
Deleted follower nodes cannot be restored.
In the navigation panel, go to Infrastructure → Clusters.
Click the name of the BiHA cluster.
Click
next to the follower node.
Select one of the following values:
Update configuration and remove node from the cluster: Delete the follower node, but keep the instance in the
Startedstate.Stop and remove from the cluster: Delete the follower node, but keep the instance in the
Stoppedstate.Remove with all data: Delete the follower node and instance.
Confirm the operation and click Delete.
You can also delete follower nodes when editing the topology of the BiHA cluster. To do this, in the top-right corner of the page, click Edit topology.