Table of Contents Previous Next


4 Configuration : 4.1 Configuring the BART Host

This section describes the basic setup steps on the BART host. As you perform these steps, there are parameters in the BART configuration file (BART_HOME/etc/bart.cfg) that correspond to these settings. Set these parameters in the BART configuration file as you proceed through the steps.
Note: Use the bart.cfg.sample file to create the bart.cfg file in which the parameters must be set.
Note: The port parameter setting is only required if the database server listens on a port other than 5444.
[BART]. Identifies the global section of the configuration file. This parameter is required and must be named BART.
bart_host. IP address of the host on which BART is installed. The value for this parameter must be specified in the form bart_user@bart_host_address where bart_user is the operating system user account on the BART host that is used to run BART and owns the BART backup catalog directory. bart_host_address is the IP address of the BART host. This parameter is required.
backup_path. Specifies the file system parent directory where all BART database server backups and archived WAL files are stored. This parameter is required.
pg_basebackup_path. Specifies the path to the pg_basebackup program that you installed on the BART host. See Section 2.1.3 for information on restrictions that may apply depending upon the version of pg_basebackup chosen. This parameter is required.
xlog_method. Determines how the transaction log is collected during execution of pg_basebackup through the BACKUP subcommand. Set to fetch to collect the transaction log files after the backup has completed. Set to stream to stream the transaction log in parallel with the full base backup creation. If stream is used, the max_wal_senders configuration parameter in the postgresql.conf file for affected database servers must account for an additional session for the streaming of the transaction log, (that is, the setting must be a minimum of 2). The setting of the xlog_method parameter in the server section of the BART configuration file overrides the setting of xlog_method in the global section for that particular database server. If omitted in the server section, the setting of xlog_method in the global section is used. If the xlog_method parameter is not specified in either section, the default is fetch.
retention_policy. Determines when an active backup should be marked as obsolete, and hence, be a candidate for deletion. The setting can be either max_number BACKUPS, max_number DAYS, max_number WEEKS, or max_number MONTHS where max_number is a positive integer. If all of the keywords BACKUPS, DAYS, WEEKS, and MONTHS are omitted, the specified integer is interpreted as max_number BACKUPS by default. The setting of the retention_policy parameter in the server section of the BART configuration file overrides the setting of retention_policy in the global section for that particular database server. If omitted in the server section, the setting of retention_policy in the global section is used. If the retention_policy parameter is not specified in either section, then no additional backups are marked as obsolete when the MANAGE subcommand is used. See Section 5.2 for information on managing backups using a retention policy.
wal_compression. Enables the compression of archived WAL files in the BART backup catalog when the MANAGE subcommand is invoked. Set to enabled to compress the archived WALS files in gzip format. Set to disabled to leave the files uncompressed. Note: The gzip compression program must be in the BART user account’s PATH. Note: Compression of archived WAL files is not permitted for database servers on which incremental backups are to be taken. The setting of the wal_compression parameter in the server section of the BART configuration file overrides the setting of wal_compression in the global section for that particular database server. If omitted in the server section, the setting of wal_compression in the global section is used. If the wal_compression parameter is not specified in either section, the default is disabled. See Section 5.4.7 for information on using the MANAGE subcommand for WAL compression.
copy_wals_during_restore. Determines how the archived WAL files are collected when invoking the RESTORE subcommand. 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. Set to disabled to retrieve the archived WAL files directly from the BART backup catalog during the database server archive recovery. The BART generated restore_command parameter in the recovery.conf file reflects which of the two options is used. If the RESTORE subcommand is invoked with the -c option, then the archived WAL files are copied from the BART backup catalog to the restore_path/archived_wals directory, thus overriding any setting of the copy_wals_during_restore parameter in the BART configuration file. If the RESTORE subcommand is invoked without the -c option, then the following determines how the archived WAL files are retrieved: An explicit setting of the copy_wals_during_restore parameter in the server section of the BART configuration file overrides the setting of copy_wals_during_restore in the global section for that particular database server. If omitted in the server section, the setting of copy_wals_during_restore in the global section is used. If the copy_wals_during_restore parameter is not explicitly set in either section, the default is disabled. See Section 5.4.8 for additional information.
logfile. Specifies the path to the BART log file. Output from the bart program is written to this file. This parameter is optional. If no path to a log file is specified after logfile =, or if the parameter is commented out, BART does not create a log file. Note: During the course of BART usage, any error message you may receive regarding the BART log file is typically caused by the presence of an existing log file that is not owned by the current BART user account. To resolve the problem, delete or rename the existing log file and allow BART to create a new one owned by the current BART user account.
scanner_logfile. Specifies the path to the WAL scanner log file. Output from the bart-scanner program is written to this file. This parameter is optional. If no path to a log file is specified after scanner_logfile =, or if the parameter is commented out, BART does not create a WAL scanner log file. Note: During the course of the WAL scanner usage, any error message you may receive regarding the WAL scanner log file is typically caused by the presence of an existing log file that is not owned by the current BART user account. To resolve the problem, delete or rename the existing log file and allow BART to create a new one owned by the current BART user account.
Step 1: Verify that the pg_basebackup utility program is installed on the BART host. If you have not already done so, see Section 3.2 for instructions.
The pg_basebackup program in directory POSTGRES_INSTALL_HOME/bin is invoked by BART for taking full base backups.
In the BART configuration file set the pg_basebackup_path parameter to the location of the pg_basebackup program as shown in the following example:
Step 2: Create or select the BART user account.
The BART user account must run the bart program and the bart-scanner program.
For example, enterprisedb or postgres can be selected as the BART user account when the managed database servers are Advanced Server or PostgreSQL, respectively.
An account name of bartuser is used for the following examples.
Step 3: Set the environment variables for the BART user account.
PATH. The simplest and recommended setting is for the PATH environment variable to include the BART_HOME/bin directory. Doing so allows the BART user to invoke BART from any current working directory. Without doing so, the BART user must invoke BART from within BART_HOME/bin as the current working directory. In that case, the current working directory must be included in the PATH environment variable. The bart-scanner program located within the BART_HOME/bin directory is called by the bart program in certain circumstances. See Section 5.3 for additional information.
LD_LIBRARY_PATH. The LD_LIBRARY_PATH environment variable may need to include the directory containing the libpq library. This directory is POSTGRES_INSTALL_HOME/lib. See Section 5.3 for information on setting LD_LIBRARY_PATH.
Step 4: Create the BART backup catalog.
In the following example, the BART configuration file specifies /opt/backup as the parent directory for the BART backup catalog:
When you invoke the bart command line program with the INIT subcommand or in fact, with any BART subcommand, BART creates a subdirectory for each database server listed in the configuration file if the subdirectory had not already been created by BART.
Step 5: It is suggested that you leave the logfile configuration parameter set to its default value of /tmp/bart.log. This file is created the first time you invoke the bart command line program.
If for some reason you want to change your BART user account during the course of BART usage, you must delete the /tmp/bart.log file and let BART create a new log file owned by the new BART user account.
The same procedure applies to the scanner_logfile configuration parameter for the bart-scanner program.
Step 6: Set any of the other optional global parameters listed at the beginning of this section. The settings of these parameters apply to all database servers, but can be overridden within each database server section.
Step 7: Invoke the CHECK-CONFIG subcommand omitting the -s option in order to check the global parameters. See Section 5.4.1 for information on the CHECK-CONFIG subcommand.
Step 8: Add parameters for your first set of database servers in the BART configuration file. See Section 4.2.5 for the definition of the database server parameters.

4 Configuration : 4.1 Configuring the BART Host

Table of Contents Previous Next