0% found this document useful (0 votes)
19 views

Pgbackrest Installation and Configu

Pgbackrest Installation

Uploaded by

Hagir Ibrahim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

Pgbackrest Installation and Configu

Pgbackrest Installation

Uploaded by

Hagir Ibrahim
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Pgbackrest Installation and configuration steps:

1- Installation
A new host named db-primary is created to contain the demo cluster and run
pgBackRest examples.
pgBackRest supports 32-bit distributions that build Perl with 64-bit integer
support.

1- db-primary ⇒ Check for 64-bit integers

$sudo -u postgres perl -V | grep USE_64_BIT_INT


USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS

If pgBackRest has been installed before it's best to be sure that no prior copies
of it are still installed
2- db-primary ⇒ Remove prior pgBackRest installations

$sudo rm -f /usr/bin/pgbackrest
$sudo rm -f /usr/bin/pg_backrest
$sudo rm -rf /usr/lib/perl5/BackRest
$sudo rm -rf /usr/share/perl5/BackRest
$sudo rm -rf /usr/lib/perl5/pgBackRest
$sudo rm -rf /usr/share/perl5/pgBackRest

3- db-primary ⇒ Install required Perl packages


$sudo apt-get install libdbd-pg-perl libio-socket-ssl-perl libxml-libxml-perl

4-db-primary ⇒ Download version 1.29 of pgBackRest


$sudo wget -q -O - \
https://github.com/pgbackrest/pgbackrest/archive/release/1.29.tar.gz | \
sudo tar zx -C /root

5-db-primary ⇒ Install pgBackRest


$sudo cp -r /root/pgbackrest-release-1.29/lib/pgBackRest \
/usr/share/perl5
$sudo find /usr/share/perl5/pgBackRest -type f -exec chmod 644 {} +
$sudo find /usr/share/perl5/pgBackRest -type d -exec chmod 755 {} +
$sudo cp /root/pgbackrest-release-1.29/bin/pgbackrest /usr/bin/pgbackrest
$sudo chmod 755 /usr/bin/pgbackrest
$sudo mkdir -m 770 /var/log/pgbackrest
$sudo chown postgres:postgres /var/log/pgbackrest
$sudo touch /etc/pgbackrest.conf
$sudo chmod 640 /etc/pgbackrest.conf
$sudo chown postgres:postgres /etc/pgbackrest.conf

6- db-primary ⇒ Build and Install C Library


sudo sh -c 'cd /root/pgbackrest-release-1.29/libc && \
perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'
sudo make -C /root/pgbackrest-release-1.29/libc test
sudo make -C /root/pgbackrest-release-1.29/libc install

7-db-primary ⇒ Make sure the installation worked


sudo -u postgres pgbackrest
pgBackRest 1.29 - General help

Usage:
pgbackrest [options] [command]

Commands:
archive-get Get a WAL segment from the archive.
archive-push Push a WAL segment to the archive.
backup Backup a database cluster.
check Check the configuration.
expire Expire backups that exceed retention.
help Get help.
info Retrieve information about backups.
restore Restore a database cluster.
stanza-create Create the required stanza data.
stanza-delete Delete a stanza.
stanza-upgrade Upgrade a stanza.
start Allow pgBackRest processes to run.
stop Stop pgBackRest processes from running.
version Get version.

Use 'pgbackrest help [command]' for more information.

You might also like