33.1. Creating an Instance #
Important
Agents automatically discover hosts, instances, instance objects, and other components installed on the server and create them in the web application. You can configure the automatic discovery in the ppem-agent.yml agent configuration file.
The automatic discovery and a number of other features are not supported when PPEM is installed in a secure environment.
33.1.1. Creating a New Instance #
Creating a new instance includes creating a new data directory and starting an instance service on the server.
To create a new instance:
In the navigation panel, go to Infrastructure → Instances.
In the top-right corner of the page, click Add instance.
Select Create a new instance, and then click Next.
Specify parameters of the new instance (parameters marked with an asterisk are required):
Name.
Server: The server where the instance is installed.
Version: The version of Postgres Pro on the instance server.
Data directory: The path to the server directory where the main instance directories and files are located.
Binary directory: The path to the server directory where executable files of the instance are located.
System user: The operating system user that owns instance files and catalogs and on behalf of which the instance service runs. In most cases, it is the
postgresuser.Ensure that the specified user exists in the operating system.
Connection method: The method that clients use for connecting to the instance.
Possible values:
Network address.
For this value, in Network address, select the network address that the instance uses for receiving client connections.
Unix socket.
For this value, in Unix socket directory, enter the path to the Unix socket directory that the instance uses for receiving client connections.
Port: The port number that the instance uses for receiving client connections.
Authentication method: The authentication method that the instance uses 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.
DB superuser and DB superuser password: The name and password of the DBMS user that is created and on behalf of which the agent connects to the instance.
The default username is
postgres.
Click Next, and then specify additional parameters if required:
Configuration preset: The configuration preset that is applied to the instance.
Possible values:
—: 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 another configuration preset to the instance later.
Configuration parameters: Configuration parameters that are applied to the instance.
To add a parameter, specify the parameter and its value, and then click Add.
You can add multiple parameters. Added parameters take precedence over the previously specified configuration preset.
Tags: Tags that are assigned to the instance.
Start instance after creation: Specifies whether the instance is started after creation.
For more information, refer to Section 33.5.
Service name: The name of the instance service.
The
.serviceextension is automatically added to the specified instance service name.
Click Add instance.
33.1.2. Creating an Instance from a Backup #
For more information about backups, refer to Chapter 58.
Before performing this instruction, create a backup.
To create an instance from a backup:
In the navigation panel, go to Infrastructure → Instances.
In the top-right corner of the page, click Add instance.
Select Create from a backup, and then click Next.
Specify parameters of the backup from which the instance is created (parameters marked with an asterisk are required):
Storage: The storage where the backup is located.
You can use a local or S3 storage. The local storage must be located on the same server as the instance for which the backup is created.
Instance: The instance for which the backup is created.
Period: The period when the backup was created.
Backup: The backup from which the instance is created.
Click Next, and then specify parameters of the new instance (parameters marked with an asterisk are required):
Name.
Server: The server where the instance is installed.
Version: The version of Postgres Pro on the instance server.
Data directory: The path to the server directory where the main instance directories and files are located.
Binary directory: The path to the server directory where executable files of the instance are located.
System user: The operating system user that owns instance files and catalogs and on behalf of which the instance service runs. In most cases, it is the
postgresuser.Ensure that the specified user exists in the operating system.
Available space: Allows checking whether there is enough disk space on the server for creating the instance from the backup.
To start the check, click Check.
External directories: If the backup includes directories located outside of the instance data directory, this parameter allows specifying the corresponding directories for the instance that is created.
Restore point: The state to which the instance must be restored.
Possible values:
Last backup state: Restore the instance to the last state covered by the backup.
Date and time: Restore the instance state to the specified date and time covered by the backup.
For this value, in Date and time, specify the date and time.
LSN: Restore the instance to the state corresponding to the specified WAL LSN.
For this value, in LSN, enter the WAL LSN.
Transaction ID: Restore the instance state to the specified transaction ID.
For this value, in Transaction ID, enter the transaction ID.
For Date and time, LSN, and Transaction ID, specify the following parameter:
Restore the state at the specified date and time inclusive / Restore the state corresponding to the specified LSN inclusive / Restore the state corresponding to the specified transaction inclusive: Specifies whether the instance state is restored, including the specified value.
For example, if you enter
123456in Transaction ID and enable Restore the state corresponding to the specified transaction inclusive, the instance state is restored to the transaction with ID123456. If you do not enable Restore the state corresponding to the specified transaction inclusive, the instance state is restored to the transaction with ID123455.Database recovery: Specifies instance databases that are restored or excluded from the restoration process.
Possible values:
Restore all databases.
Exclude specified databases.
Restore specified databases.
For Exclude specified databases and Restore specified databases, in Exclude databases or Restore databases, enter the unique database name, and then click Add.
You can add multiple databases.
Click Next, and then specify additional parameters (parameters marked with an asterisk are required):
After restore: The action that must be performed after restoring the instance to the state.
Possible values:
Start instance.
Don't start instance.
For more information, refer to Section 33.5.
Connection method: The method that clients use for connecting to the instance.
Possible values:
Network address.
For this value, in Network address, select the network address that the instance uses for receiving client connections.
Unix socket.
For this value, in Unix socket directory, enter the path to the Unix socket directory that the instance uses for receiving client connections.
Port: The port number that the instance uses for receiving client connections.
Configuration preset: The configuration preset that is applied to the instance.
Possible values:
—: 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 another configuration preset to the instance later.
Configuration parameters: Configuration parameters that are applied to the instance.
To add a parameter, specify the parameter and its value, and then click Add.
You can add multiple parameters. Added parameters take precedence over the previously specified configuration preset.
Tags: Tags that are assigned to the instance.
Service name: The name of the instance service.
The
.serviceextension is automatically added to the specified instance service name.
Click Add instance.
33.1.3. Adding an Existing Instance #
You may need to add an existing instance if the automatic discovery of instances installed on the server is disabled.
Before performing this instruction, ensure that the instance is running on the server and is ready to receive client connections.
To add an existing instance:
In the navigation panel, go to Infrastructure → Instances.
In the top-right corner of the page, click Add instance.
Select Add an existing instance, and then click Next.
Specify instance discovery parameters (parameters marked with an asterisk are required), and then start the discovery process:
From Agent, select the agent that must discover instances.
In Search in directories, click Add, and then specify the server directory where the agent must discover instances.
You can add multiple directories. By default, directories are not added, meaning that the agent discovers instances in all server directories.
Click Start search.
Select the instance from the list of discovered instances.
If the list is empty, review and correct instance discovery parameters, then click Start search again.
Click Next, and then specify parameters of the new instance (parameters marked with an asterisk are required):
Name.
Server: The server where the instance is installed.
Version: The version of Postgres Pro on the instance server.
Data directory: The path to the server directory where the main instance directories and files are located.
Binary directory: The path to the server directory where executable files of the instance are located.
System user: The operating system user that owns instance files and catalogs and on behalf of which the instance service runs. In most cases, it is the
postgresuser.Ensure that the specified user exists in the operating system.
Connection method: The method that clients use for connecting to the instance.
Possible values:
Network address.
For this value, in Network address, select the network address that the instance uses for receiving client connections.
Unix socket.
For this value, in Unix socket directory, enter the path to the Unix socket directory that the instance uses for receiving client connections.
Port: The port number that the instance uses for receiving client connections.
DB superuser and DB superuser password: The name and password of the DBMS user that is created and on behalf of which the agent connects to the instance.
The default username is
postgres.Startup method: Specifies the instance startup method.
Possible values:
systemd: Start the instance using the systemd unit.
This is the recommended startup method.
pg_ctl: Start the instance using the pg_ctl utility.
Tags: Tags that are assigned to the instance.
Click Add instance.