Quick Start Guide for RHEL/CentOS 8 v2.6
This tutorial demonstrates using the
dnf command to install and configure the EDB Backup and Recovery Tool (BART) 2.6 on a CentOS 8 host with minimal configuration settings. The tutorial assumes that the user has some knowledge of installation and system administration procedures and has administrative privileges on the host.
For detailed information about BART installation and configuration, see the BART Installation and Upgrade Guide available at the EDB website.
BART is tested with the following database versions:
- Advanced Server - 9.6, 10, 11, 12, and 13.
- PostgreSQL - 9.6, 10, 11, 12, and 13.
The following steps describe installing BART on CentOS 8.x OS.
Assume superuser privileges and use
dnfto create the repository configuration file:
Create an EDB user account to request credentials to the EDB repository; for a user account visit the EnterpriseDB website.
Use your choice of editor to open the repository configuration file (named
edb.repo, located in
/etc/yum.repos.d), set the
enabledparameter value to
1, and replace the
passwordplaceholders in the
baseurlspecification with the username and password of a registered EnterpriseDB user.
Update the cache:
Install an Advanced Server or PostgreSQL database server.
To install Advanced Server, execute the following command:
Use sudo to assume the identity of the
Create an Advanced Server cluster named
acctgon listener port
enterprisedbuser, start the cluster:
You can check the status of the cluster with the following command:
The BART host server is not required to have an Advanced Server or PostgreSQL installation, but must include a copy of the Postgres
pg_basebackuputility program, and Boost Libraries 1.66 version for CentOS 8.
If you do not already have the
pg_basebackupprogram installed on the BART host, you can use the following command to install a limited number of files that include the
As a root user, use the following command to install the BART RPM package:
bart program and
bart-scanner) is installed in the
/usr/edb/bart/bin directory, referred to as
<BART_HOME>. Repeat the installation process described in this section to install BART on all remote hosts where incremental backups are to be restored.
Before configuring BART, establish the BART user account (the operating system user) to run the BART command line program. Then, to configure the BART host and each database server that is to be managed by BART, perform the following steps:
Assume superuser privileges, create the directory that will hold the BART backup catalog, and assign its ownership (with restrictive privileges) to the BART user account:
In this example,
bartuseris the BART user account and
/opt/backupis the BART backup catalog.
Navigate to the
/usr/edb/bart/etcdirectory and copy the
bart.cfg.samplefile to create the BART configuration file (
Open the BART configuration file (
bart.cfg) using an editor of your choice and scroll through the BART configuration file to edit the file as required; sample settings are included for your reference. You must add the mandatory parameters to the
[ServerName]sections. Default values may be used for optional parameters. For detailed information about parameter settings, see the BART Installation and Upgrade Guide, available at the EDB website.
Parameters set in the
[BART]section are applicable to all BART managed database servers, while parameters set in the
[ServerName]section are applicable only to the specific server;
In the following example, only mandatory parameters are set:
The following table describes only mandatory parameters:
|Use this field to specify the BART user and the IP address of the host on which the BART utility is installed. Specify the value in the form of |
|Use this field to specify the path where all BART backups and archived WAL files will be stored. Ensure the BART user account holds privileges to create subdirectories and files within the location specified in the |
|Use this field to specify the path to the pg_basebackup utility (|
|Specify the name of the database server to be backed up (for example, [EPAS12]).|
|Specify the IP address of the database server to be configured for backup.|
|Specify the replication database user name used by BART to establish the connection to the database server for full backups.|
|Specify the Linux operating system user account that owns the database cluster.|
As a BART user, navigate to
/usr/edb/bart/binand invoke the following subcommand (omitting the
-soption) to verify the [BART] section parameter settings:
Authorize SSH/SCP access between the server and the BART host without a password prompt.
Create a replication database user for each database server that BART manages.
To enable continuous WAL archiving for any database server for which BART is to perform a backup, modify the
replicaor higher (for Postgres 9.6 or later)
archive_command(if it is not set in the
max_wal_sendersto a value high enough to leave at least one session available for the backup.
After setting the parameters, restart the database server.
To start the WAL scanner, navigate to
/usr/edb/bart/binas a BART user and execute the following command:
If you are using the default
archive_command, then navigate to
/usr/edb/bart/binas a BART user, run the
INITsubcommand without the
-ooption, and restart the database server:
<server_name>is the name of the database server to be backed up.
If you have customized the
archive_commandsetting in the
bart.cfgfile, run the
INITsubcommand with the
-ooption to override any existing Postgresql
archive_commandsetting in the
postgresql.auto.conffile, and restart the database server.
To verify the database server parameter settings, as a BART user navigate to
/usr/edb/bart/binand invoke the
CHECK-CONFIGsubcommand with the -s option:
BART is now configured successfully. For detailed information about using BART, see the EDB Backup and Recovery Tool User Guide available at the EDB website.
Creating a Passwordless Connection
The following example enables SSH/SCP access on a CentOS 7.x host; similar (platform-specific) steps will apply to other platforms/versions. You must create a passwordless connection between the BART host (SSH/SCP client) and the database server (target SSH/SCP server), as well as a passwordless connection between the database server (SSH/SCP client) and the BART host (target SSH/SCP server).
Log in as the user account on the BART host that will be initiating the SSH or SCP connection and navigate to the user account’s home directory and check for an existing
.sshsubdirectory. If the
.sshdirectory does not exist, create one with the required privileges.
As a root user navigate to
/usr/edb/bart, open the
/etc/ssh/sshd_configfile and set the
Reload the configuration file:
If you get any SSH or SCP errors, examine the log file (
As a BART user, use the following command to generate the public key file; you can accept the default responses:
The public key file named
id_rsa.pubis created in the
SCPto make a temporary copy of the public key file on the target server:
target_user, log into the target server using
ssh target_user@host_addresscommand and navigate to the user account’s home directory to check if there is an existing
.sshsubdirectory. If it does not exist, create one with the required privileges.
Append the temporary client’s public key file,
tmp.pub, to the
authorized_keysfile does not exist, create a new file, but be careful not to completely replace any existing
Ensure only the file owner (and not other groups or users) has access to
Delete the temporary public key file:
Now, when logged into the BART host as a user, there should be no prompt for a password when you are connecting to the target database server:
Creating a Passwordless Connection Between the Database Server and the BART Host
If backups are to be taken from a given database server host, but restored to a different database server host, the passwordless SSH/SCP connections must be configured from the BART host to the database server host from which the backup is to be taken as well as from the BART host to the database server host to which the backup is to be restored.
An example of how to create a passwordless connection is documented in the EDB Backup and Recovery Reference Guide, available at the EDB website.
Even when the Advanced Server database is on the same host as BART, and the Advanced Server database cluster owner is also the BART user account, a passwordless SSH/SCP connection must be established from the same user account to itself.
On the database server, navigate into the target user account’s home directory to check for an existing
.sshsubdirectory. If it does does not exist, create one in the user account’s home directory with the required privileges.
As a database server user, generate the public key file:
Create a temporary copy of the public key file:
As a target user, log into the BART host and navigate to the user account’s home directory to check if there is an existing
.sshsubdirectory. If it does not exist, create one with the required privileges:
Append the client’s temporary public key file to the
authorized_keys file does not exist, create a new file, but do not completely replace any existing
Ensure that only the file owner (and not other groups or users) has access to
Delete the temporary public key file:
Now, when logged into the database server as a user, there should be no prompt for a password when you are connecting to the BART host:
Creating a Replication Database User
To create a replication database user (a superuser), connect to the database server with the psql client, and invoke the following PostgreSQL command:
Specify this replication database user in the
userparameter of the
The pg_hba.conf file must minimally permit the replication database user to have access to the database. The IP address from which the replication database user has access to the database is the BART host location. The replication database user must also be included in the
pg_hba.conffile as a replication database connection if
pg_basebackupis to be used for taking any backups.
To ensure there is no password prompt when connecting to the database server with the replication database user, a recommended method is to use the
.pgpassfile located in the BART user account’s home directory (if it does not exist, you need to create the
.pgpassfile with the required privileges). The
.pgpassfile must contain an entry for each BART managed database server, and its corresponding replication database user and password.