Configuring a Database Server¶
To configure a database server, you must:
- Authorize SSH/SCP access to the server.
- Create and configure a replication database user.
- Enable WAL archiving of the server.
- Verify the server configuration settings.
You must authorize SSH/SCP access and set up a replication database user before restarting the database server with WAL archiving enabled.
Setting up a Replication Database User¶
To set up a replication database user:
- Choose a database user to serve as the replication database user (a superuser) for each Postgres database server to be managed by BART.
- Modify the
pg_hba.conffile to allow the replication database user to access the
template1database. Include the replication database user in the
pg_hba.conffile as a
pg_basebackupis to be used for taking any backups.
- Specify the replication database user for the database server in the
BART configuration file in the
Enabling WAL Archiving¶
To enable WAL archiving, set the following parameters in the
postgresql.conf file for any database server for which BART is to perform a backup. Set:
archivefor Postgres 9.5 or to
replicafor Postgres 9.6 or later.
archive_commandto copy the WAL files to the BART backup catalog.
max_wal_sendersto a value high enough to leave at least one session available for the backup. If the
xlog_method=streamparameter setting is to be used by this server, the
max_wal_senderssetting must account for an additional session for transaction log streaming.
INIT subcommand with the
-o option to override any existing
archive_command setting in the
postgresql.conf or the
After verifying that the full path of the BART backup catalog has been created, restart the database server to initiate WAL archiving.
Start the WAL scanner by executing the following command:
Verifying Configuration Setting¶
CHECK-CONFIGsubcommand with the
–soption to verify the parameter settings in the database server configuration for which the
-soption is specified.
In addition, the following
postgresql.conf parameters for the database
server must be properly set and activated for certain processes:
cluster_ownerparameter must be set to the user account owning the database cluster directory.
- A password-less SSH/SCP connection must be set between the BART user
and the user account specified by the
- The BART
userparameter must specify a database superuser.
pg_hba.conffile must contain a replication entry for the database superuser specified by the BART
archive_modeparameter in the
postgresql.conffile must be enabled.
archive_commandparameter in the
postgresql.conffile must be set.
allow_incremental_backupsparameter in the BART configuration file must be enabled for database servers for which incremental backups are to be taken.
- Archiving of WAL files to the BART backup catalog must be in process.
- The WAL scanner program must be running.