PostgreSQL WAL Files Settings
To create a transactionally consistent backup of a PostgreSQL VM, you must enable application-aware processing and define the settings of WAL files processing. Veeam Backup & Replication supports backup of PostgreSQL instances running on both Linux and Microsoft Windows machines.
|
Note |
|
By default, Veeam Backup & Replication detects PostgreSQL instances as follows:
If you keep configuration files in custom directories, the pgsqlagent agent will use its own VeeamPostgreSQLAgent.xml configuration file. You can use this file on both Linux and Microsoft Windows machines:
If the directory or the file does not exist, create it manually. The pgsqlagent agent configuration file must be a single-line XML file. To explicitly include or exclude specific directories from rescan, add the following attributes to the VeeamPostgreSQLAgent.xml file:
You can also use ExcludeConfigDirs to skip PostgreSQL instances that you do not want to process while application-aware processing stays enabled. For more information, see Application-Aware Processing. Examples:
|
To specify WAL files settings and back up PostgreSQL logs, do the following:
- In the Processing Settings window, click the PostgreSQL tab.
- From the Specify PostgreSQL account with superuser privileges drop-down list, select a user account that Veeam Backup & Replication will use to connect to the PostgreSQL instance. The account must have privileges described in the Permissions section. If you have not set up credentials beforehand, click the Manage credentials link or click Add on the right to add credentials.
By default, the Use guest credentials option is selected in the list. In this case, Veeam Backup & Replication will use the account specified at the Guest Processing step of the wizard to access the VM guest OS and connect to the PostgreSQL instance.
Note that if you plan to select the System user without password (peer) authentication method at step 3 of this procedure, you can add a user account in the Credentials Manager without specifying the password for the account.
- In The specified user is section, specify how the user will authenticate against the PostgreSQL instance:
- Select Database user with password if the account you specified at step 2 is a PostgreSQL account and you entered the password for this account in the Credentials Manager.
|
Note |
|
If you want Veeam Backup & Replication to use the user name map authentication, select Database user with password and leave the password field empty. Consider the following:
For more information about the user name maps, see the PostgreSQL documentation. |
- Select Database user with password file (.pgpass) if the password for the account you specified at step 2 is defined in the .pgpass configuration file on the PostgreSQL VM. The password file must be located in the user's home directory. For more information about the password file, see the PostgreSQL documentation.
- Select System user without password (peer) if you want Veeam Backup & Replication to use the peer authentication method for Linux machines or the SSPI authentication method for Microsoft Windows machines. For Linux machines, Veeam Backup & Replication will use the account you specified at step 2 as the OS account and as the PostgreSQL account to connect to PostgreSQL. For more information about the peer authentication method, see the PostgreSQL documentation. For Microsoft Windows machines, Veeam Backup & Replication uses SSPI authentication: it first tries Kerberos and, if Kerberos is not available, falls back to NTLM.
|
Important |
|
The peer authentication method is available for Linux machines only. If you have added a new PostgreSQL account and want to use it with this method, make sure that you have added this account as a Linux user with sufficient permissions. |
- To back up PostgreSQL WAL files with Veeam Backup & Replication, select the Back up logs every <N> minutes check box and specify the frequency of WAL files backup. By default, WAL files are backed up every 15 minutes. The maximum log backup interval is 480 minutes.
- In the Retain log backups section, specify the retention policy for WAL files stored in the backup repository:
- Select Until the corresponding image-level backup is deleted to apply the same retention policy to both image-level backups and WAL file backups.
- Select Keep only last <N> days of log backups to keep WAL files for a specific number of days. By default, WAL files are kept for 15 days. If you select this option, you must make sure that retention for WAL files is not greater than retention for the image-level backups. For more information, see Retention for PostgreSQL WAL Files.
- In the Temporary location for archived logs field, you must specify a path to the storage location where you want to keep WAL files. Depending on the guest OS of the PostgreSQL VM, specify a Linux or Microsoft Windows absolute path. The specified path must be accessible to the PostgreSQL server and have sufficient free disk space. This field is required if you select the Back up logs every <N> minutes check box.
If you specify settings for multiple VMs or for a VM container (for example, a host or cluster), click Configure next to Temporary location for archived logs. In the Temporary Location for Archive Logs window, specify a path in the Linux path field, the Windows path field or both, and click Apply. Veeam Backup & Replication uses the Linux path for Linux VMs and the Windows path for Microsoft Windows VMs.
- In the Log shipping servers section, click Choose to select which log shipping server you want to use to transport WAL files:
- Select Automatic selection if you want Veeam Backup & Replication to select an optimal log shipping server automatically. The process of WAL files shipping does not require a dedicated server — Veeam Backup & Replication can use any Microsoft Windows or Linux server added to the backup infrastructure.
- Select Use the specified servers only to define a log shipping server explicitly. In the Log Shipping Servers window, select check boxes next to the servers you want to use as log shipping servers. The server list includes all Microsoft Windows and Linux servers added to the backup infrastructure.
Make sure that you select a server that is not used by other resource-consuming tasks. For example, you may not want to use a server that performs the WAN accelerator role as a log shipping server. For load balance and high availability purposes, it is recommended that you select at least 2 log shipping servers.
