Skip to main content
Version 4.0.0

Backup Site Configuration

This option allows you to define where the base data directory for the PostgreSQL cluster is located.

During backups, the provided value will be compared with the path where PostgreSQL is running, and they must match; otherwise, the backup will fail with 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 desired PgSmart Agent (or Register a new Agent).

  2. Select the Sites de Backup section (the selection is made with the [spaces] key).

    When selecting the Sites de Backup section, the following operations are made available:

    • Listar: Allows listing configured Backup Sites
    • Adicionar: Allows adding a Backup Site
    • Ativar: Allows activating a Backup Site
    • Iniciar: Allows starting a Backup Site
    • Parar: Allows stopping a Backup Site
    • Verificar: Allows checking a Backup Site
    • Remover: Allows removing a Backup Site
    note

    If no Backup Site is found, PostgreSYS will prompt to create a new one.

List Backup Sites

  1. Select the Listar operation

  2. The configured Backup Sites will be listed along with their configuration parameters.

  3. Press <ENTER> to view the details of the desired parameter.

    Figure 1 - Site Configuration - List
    Figure 1 - Site Configuration - List

Add a Backup Site

  1. Select the Adicionar operation.

  2. Enter a name for the backup site.

  3. Enter the hostname/IP of the PostgreSQL instance (Default: localhost).

  4. Enter the SSH connection user of the PostgreSQL instance. [Default: postgres]

  5. Enter the Data Directory of the PostgreSQL instance.

    note

    If desired, add a new Instance Data Directory via the Add option.

  6. Confirm if you wish to add another cluster to the backup site being created.

    Figure 2 - Site Configuration - Creation
    Figure 2 - Site Configuration - Creation
note
  • Each Backup Site is associated with a single master instance. However, multiple replicas can be registered under the same site.
  • PostgreSQL does not support native master-master replication. Replicas are read-only and used mainly to offload backup processing from the master.
  • pgBackRest allows backups to run from replicas, improving performance by reducing load on the master.
  • Use the Listar option to validate the configuration.

Activate the Backup Site

Prerequisites
note

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

  1. Select the Ativar operation.

  2. Select the backup site you want to activate.

  3. Confirm that WAL archiving is configured for the involved clusters is configured for the selected site (this is a prerequisite).

  4. Confirm the activation of the selected Backup site.

    Figure 3 - Site Configuration - Activation
    Figure 3 - Site Configuration - Activation

Start the Backup Site

Resumes backup routines previously suspended by the Stop command.

  1. Select the Iniciar operation.

  2. Select the backup site you want to start.

    Figure 4 - Site Configuration - Start
    Figure 4 - Site Configuration - Start

Stop the Backup Site

Disables the Backup site, suspending ongoing routines to prevent execution of routines during maintenance on the storage.

  1. Select the Parar operation.

  2. Select the backup site you want to suspend.

Figure 5 - Site Configuration - Stop
Figure 5 - Site Configuration - Stop

Verify the Backup Site

Prerequisites
  • Backup site activated.
  1. Select the Verificar operation.

  2. Select the backup site you want to verify.

    Figure 6 - Site Configuration - Verification
    Figure 6 - Site Configuration - Verification

Remove the Backup Site

Deactivates the Backup site.

  1. Select the Remover operation.

  2. Select the backup site you want to remove.

  3. Confirm the removal of the backup site.

  4. Confirm the removal of the backup site from global configurations.

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

Execution details for the commands can be viewed in the following files:

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