Skip to main content
Version 3.1.0

Backup Environment Configuration

In this option, it is possible to define where the base data directory for the PostgreSQL cluster is located.

During the backups, the provided value will be compared with the path where PostgreSQL is running, and these must be the same, or the backup will return an error.

By default, RHEL 7-8 stores clusters in: /var/lib/pgsql/[version]/data.

Command Syntax
Terminal input
pgsmart backup config [Flags]

Flags:

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

Non-interactive execution is disabled for this operation.

Interactive Configuration
Terminal input
pgsmart backup config
  1. Select the PgSmart Agent (or register new Agent).

  2. Select the Backup Environments Section (selection is made with the [spaces] key).

    Upon selecting the Backup Environments section, the following operations are made available:

  • List configured Backup Environments.
  • Add a Backup Environment.
  • Activate a Backup Environment.
  • Start a Backup Environment.
  • Stop a Backup Environment.
  • Verify a Backup Environment.
  • Remove a Backup Environment.
note

If no backup environment is found, PostgreSYS opens the possibility of creating a new one.

List a Backup Environment

  1. Select the List operation

  2. Configured Backup environments will be displayed.

    Figure 1 - Environment Configuration - List
    Figure 1 - Environment Configuration - List

Add a Backup Environment

  1. Select the Add operation.

  2. Provide a Name for the backup environment.

  3. Provide the Hostname/IP of the PostgreSQL instance (Default: localhost).

  4. Provide the SSH Connection Port for the PostgreSQL instance.

  5. Provide the SSH connection User for the PostgreSQL instance. [Default: postgres]

  6. Provide the Connection Port of the PostgreSQL instance.

  7. Provide the Data Directory of the PostgreSQL instance.

  8. Provide the Connection User of the PostgreSQL instance.

  9. Confirm if you wish to add another cluster to the backup environment being created.

    Figure 2 - Environment Configuration - Add
    Figure 2 - Environment Configuration - Add
note
  • Within a Backup Environment, it is possible to have more than one cluster registered. However, this second environment refers to replicas, since each Backup Environment relates to a single Master instance.

  • A Master instance can have several replicas linked, but natively, there is no Master/Master replication in PostgreSQL.

  • By including more than one instance, o pgBackRest "interprets" the additional instances as "replicas". And it is possible to point to the "replicas" (in the Backup Routines) for executing Backups, freeing up the 'Master' instance from processing operations, file copies, and compression, etc.

  • PostgreSQL replicas, by nature, do not accept writes, only reads. This makes them less processing-heavy and, consequently, a more efficient Backup.

  • To validate the operation of the Backup Environment, use the List option.

Activate the Backup Environment

Prerequisite

Wal archiving configured.

note

The WAL archiving of the clusters involved must be configured for the selected backup environment. Otherwise the operation will be aborted.

  1. Select the Activate operation.

  2. Select the Backup environment.

  3. Confirm if the WAL archiving of the involved clusters is set up for the selected environment (it's a prerequisite).

  4. Confirm the activation of the selected backup environment.

    Figure 3 - Environment Configuration - Activation
    Figure 3 - Environment Configuration - Activation

Start the Backup Environment

Cancels the suspension of backup routines effected through the stop command.

  1. Select the Start operation.

  2. Select the Environment you wish to start.

    Figure 4 - Environment Configuration - Start
    Figure 4 - Environment Configuration - Start

Stop the Backup Environment

Makes the Backup Environment unavailable, suspending the execution of ongoing routines, aiming to prevent routines from being executed while, for example, maintenance on the 'storage' is being done.

  1. Select the Stop operation.

  2. Select the Environment you wish to suspend.

    Figure 5 - Environment Configuration - Stop
    Figure 5 - Environment Configuration - Stop

Verify the Backup Environment

Prerequisite

Ambiente de backup ativado

  1. Select the Verify operation.

  2. Select the Environment you wish to verify.

    Figure 6 - Environment Configuration - Verification
    Figure 6 - Environment Configuration - Verification

Remove the Backup Environment

Deactivates the Backup Environment.

  1. Select the Remove operation.

  2. Select the Environment you wish to remove.

  3. Confirm the deletion of the backup environment.

  4. Confirm the removal of the backup environment from the global settings.

    Figure 7 - Environment Configuration - Removal
    Figure 7 - Environment Configuration - Removal
Final Notes
note

Details of the command executions can be viewed in the following files:

  • /var/log/pgsmart-agent/pgsmart.log
  • /var/log/pgsmart-client/pgsmart.log
  • /var/log/pgbackrest/[backup environment]-start.log
  • /var/log/pgbackrest/[backup environment]-stop.log
  • /var/log/pgbackrest/[backup environment]-stanza-create.log
  • /var/log/pgbackrest/[backup environment]-stanza-delete.log