Posts

Showing posts with the label pgBackRest

EDB - pgBackRest - Part III: RESTORE

  Theory The restore command automatically defaults to selecting the latest backup from the first repository where backups exist. The order in which the repositories are checked is dictated by the pgbackrest.conf (e.g. repo1 will be checked before repo2). To select from a specific repository, the --repo option can be passed (e.g. --repo=1). The --set option can be passed if a backup other than the latest is desired. Restoration Scenarios: Restoring the backup on a different host Restoring a single database from the Postgres cluster Restoring the backup to a specific point in time Restoring only the delta changes Restoring the backup on a different host to start as a streaming standby 1. Verify backup information [enterprisedb@edb-nhatrang ~]$ pgbackrest info --stanza=employees 2. Restoring the backup on a different host (IP : 192.168.56.77) Setup Passwordless SSH Connection between Backup Server (192.168.56.79) and Database Server (192.168.56.77) Backup Server  ss...

EDB - pgBackRest - Part II: Configuration & Backup

Theory A stanza is the configuration for a PostgreSQL database cluster that defines where it is located, how it will be backed up, archiving options, etc. Most db servers will only have one PostgreSQL database cluster and therefore one stanza, whereas backup servers will have a stanza for every database cluster that needs to be backed up. The stanza-delete command removes data in the repository associated with a stanza. Use this command with caution — it will permanently remove all backups and archives from the pgBackRest repository for the specified stanza. A. CONFIGURATION 1. Create backup location [root@edb-nhatrang /]# mkdir -p /backup/pgbackrest [root@edb-nhatrang /]# chown -R enterprisedb: /backup/ 2. Database Cluster Configuration Enable archive mode ON Set archive_command = ‘pgbackrest --stanza=employees archive-push %p’ Get data_directory = ‘/u01/edb/as16/data’ edb=# show archive_mode ;  archive_mode  --------------  on (1 row) edb=# show archive_command ...

EDB - pgBackRest - Part I: Installation

In this section, we will install pgBackRest using with  EPAS  (EDB Enterprise Advance Server). So we need to pay attention to something such as: User is enterprisedb , not postgres Grant right privileges to enterprisedb user 1. Configuring Postgres YUM repository [root@edb-nhatrang ~]# dnf repolist  [root@edb-nhatrang ~]# dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm [root@edb-nhatrang ~]# dnf repolist  2. Configuring EPEL Repository [root@edb-nhatrang ~]# dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm [root@edb-nhatrang ~]# dnf repolist  3. Install pgBackRest [root@edb-nhatrang ~]# dnf install pgbackrest Using EDB Postgres Advanced Server, the enterprisedb system user will execute the pgbackrest command. The following commands will change the ownership of the pgBackRest directories: [root@edb-nhatrang ~]# chown -R enterprisedb: /var/lib/pgbackrest [root@ed...