Configuring BART

To configure the BART host and each database server that is to be managed by BART you must:

  1. Establish the BART user account and ensure it runs the bart and the bart-scanner program.

  2. Use the bart.cfg.sample file to create the bart.cfg file. The BART configuration file is located in BART_HOME/etc/bart.cfg:

    cp bart.cfg.sample bart.cfg

  3. Set the environment variable for the BART user account. If the libpq library does not reside in the default installation location, you must add the libpq library to the LD_LIBRARY_PATH environment variable and place the following settings in the BART user account’s profile so they take effect upon login:

# .bash\_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

export LD_LIBRARY_PATH=/usr/edb/as11/lib:$LD_LIBRARY_PATH
  1. Set the following parameters in the [BART] section of the BART configuration file:

bart_host (required)

Specify this parameter value in the form of <bart_user>@<bart_host_address>.

backup_path (required)

Create the BART backup catalog and specify the path to the file system parent directory where BART database server backups and archived WAL files are stored. Ensure the BART user account owns the location specified in the backup_path parameter.

pg_basebackup_path (required)

Specify the path to the pg_basebackup program on the BART host.

xlog_method (optional)

Set to fetch (default) to collect the transaction log files after the backup is completed. Set to stream to stream the transaction log in parallel with the full backup creation.

retention_policy (optional)

Specify when an active backup should be marked as obsolete when the MANAGE subcommand is used. Specify max_number BACKUPS (default setting), max_number DAYS, max_number WEEKS, or max_number MONTHS where max_number is a positive integer.

wal_compression (optional)

Set to enabled to compress the archived WAL files in gzip format when the MANAGE subcommand is invoked. Please note: The gzip compression program must be in the BART user account’s PATH.

copy_wals_during_restore (optional)

Set to enabled to copy the archived WAL files from the BART backup catalog to the restore_path/archived_wals directory prior to the database server archive recovery.

logfile (optional)

Use logfile to specify the path to the location to which output from the bart program is written. The log file will be created the first time you invoke the bart command using the sample configuration file value.

scanner_logfile (optional)

Use scanner_logfile to specify the path to the location to which output from the bart-scanner program is written. The scanner log file will be created the first time you invoke the bart command using the sample configuration file value.

thread_count (optional)

Specify the number of worker threads to copy blocks from the database server to the BART backup catalog when the BACKUP subcommand is invoked for incremental backups.

When taking a full backup, if the thread count is 1, then the pg_basebackup utility is used to take the full backup unless the --no-pg_basebackup option is specified with the BACKUP subcommand.

batch_size (optional)

Specify the number of blocks of memory used for copying modified blocks from the database server to the BART backup catalog when the BACKUP subcommand is invoked for incremental backups. The maximum permitted value is 131072 (131072 * 8192 = 1 GB). The minimum permitted value is 1 (1 * 8192 = 8192 bytes).

scan_interval (optional)

Specify the number of seconds before forcing a scan of the WAL files in the archive directory of the BART backup catalog. The default value is 0, which means no brute-force scanning will be started.

mbm_scan_timeout (optional)

Specify the number of seconds to wait for MBM files before timing out; the default value is 20 seconds. The mbm_scan_timeout parameter value must be greater than 0. The mbm_scan_timeout parameter is applicable only for incremental backup.

workers (optional)

Specify the number of parallel worker processes required to stream the modified blocks of an incremental backup to the restore host. The default value is 1.
  1. Invoke the CHECK-CONFIG subcommand omitting the -s option to check the parameter settings in the BART configuration file including bart_host, backup_path, and pg_basebackup_path.
  2. Set the following parameters for each database server in the server section of the BART configuration file. The parameter setting in the server section overrides the setting in the global [BART] section for that particular database server.

[ServerName] (required)

Specify a database server name.

backup_name (optional)

Specify user-friendly name for the backups of the database server.

host (required)

Specify the IP address of the database server to be configured for backup.

port (optional)

Specify the port number identifying the database server instance to be backed up. The default is port 5444.

user (required)

Specify the replication database user name used by BART to establish the connection to the database server for full backups.

archive_command (optional)

When the INIT subcommand is used, the content and variables specified in the BART archive_command result in the archive command string to be generated into the Postgres archive_command parameter in the postgresql.auto.conf file. The following information applies only to the BART archive_command parameter.

Enclose the command string within single quotes (‘).

If the archive_command parameter is omitted, it still results in its usage by the INIT subcommand with a setting of 'scp %p %h:%a/%f' where %p is the path of the file to archive used by the Postgres archiving process, %h is replaced by the bart_host parameter setting, %a is replaced by the BART archive path, and %f is the archived file name used by the Postgres archiving process.

cluster_owner (required)

Specify the Linux operating system user account that owns the database cluster. This is typically enterprisedb for Advanced Server clusters installed in compatible mode, or postgres for PostgreSQL or Advanced Server clusters installed in the PostgreSQL compatible mode.

remote_host (optional)

Specify this parameter value in the form of <remote_user>@<remote_host_address> where remote_user is the user account on the target database server host and remote_host_address is the IP address of the remote host.

tablespace_path (optional)

Specify the path to which tablespaces are to be restored in the OID = tablespace_path; OID = tablespace_path … format. If the backup is to be restored to a remote host (specified by the remote_host parameter), then the tablespace must exist on the remote host.

allow_incremental_backups (optional)

Set to enabled to permit incremental backups.

description (optional)

Specify the database server description.

For detailed information about configuring the optional parameters in the server section, refer to the BART Installation and Upgrade Guide available at:

https://www.enterprisedb.com/edb-docs/

  • Retention_policy
  • xlog_method
  • wal_compression
  • copy_wals_during_restore
  • thread_count
  • batch_size
  • scan_interval
  • mbm_scan_timeout
  • workers