PostgreSQL Primary & Standby Setup with pgBackRest ๐ ๏ธ
Learn to set up a PostgreSQL cluster with primary and standby servers using pgBackRest for reliable backups. Step-by-step guide.

Automation Avenue
8.0K views โข Jul 12, 2024

About this video
Step-by-step tutorial on how to configure Postgres / PostgreSQL cluster that includes primary ( master ) and standby ( slave / secondary ) server replicating from primary.
We will then add PgBackRest that will be taking backups to remote location ( we will use AWS S3 bucket for that purpose, but PgBackrest allows you to choose any other storage you want ).
Once we have that, we will perform various failover and recovery tasks to see how we can failover from primary to standby if primary PostgreSQL server goes down, and how to recover when both - primary and standby go down and we have to use PgBackrest and our remote backup to make the Postgres cluster back up and running again.
We will be configuring PostgreSQL 16 on Ubuntu 24.04 LTS, but you can follow this tutorial for other Postgres versions and other linux distributions as the installation and configuration of Postgres doesnt differ much in other environments.
This material is also available as Udemy training, please see the link below:
https://www.udemy.com/course/postgresql-with-pgbackrest/?referralCode=2FB4A92A394261CCA412
== TIMESTAMPS ==
0:00 What are we going to build
2:15 Build and configure Ubuntu 24.04 servers for Postgresql 16
6:20 Postgres installation process
9:20 Configuring pg_hba.conf
10:35 Create database in postgresql
12:10 Create primary and secondary database
14:05 Configuring postgresql.conf file
14:25 why we need to configure โlisten addressesโ in postgresql.conf
16:35 Further configuration of secondary postgres server
17:10 pg_basebackup command explained and run
25:15 Installing and configuring PgBackrest
26:00 Create SSH connectivity between both servers
32:10 Configuing pgbackrest.conf file
39:00 Creating full postgres backup with pgbackrest command
42:00 Failover from primary to secondary postgres database
43:45 Recover postgres from remote location
๐ฅ๐ฅ Learn Devops and Cloud on our platform: https://www.automation-avenue.com
๐ง info@automation-avenue.com
== 29 ==
We will then add PgBackRest that will be taking backups to remote location ( we will use AWS S3 bucket for that purpose, but PgBackrest allows you to choose any other storage you want ).
Once we have that, we will perform various failover and recovery tasks to see how we can failover from primary to standby if primary PostgreSQL server goes down, and how to recover when both - primary and standby go down and we have to use PgBackrest and our remote backup to make the Postgres cluster back up and running again.
We will be configuring PostgreSQL 16 on Ubuntu 24.04 LTS, but you can follow this tutorial for other Postgres versions and other linux distributions as the installation and configuration of Postgres doesnt differ much in other environments.
This material is also available as Udemy training, please see the link below:
https://www.udemy.com/course/postgresql-with-pgbackrest/?referralCode=2FB4A92A394261CCA412
== TIMESTAMPS ==
0:00 What are we going to build
2:15 Build and configure Ubuntu 24.04 servers for Postgresql 16
6:20 Postgres installation process
9:20 Configuring pg_hba.conf
10:35 Create database in postgresql
12:10 Create primary and secondary database
14:05 Configuring postgresql.conf file
14:25 why we need to configure โlisten addressesโ in postgresql.conf
16:35 Further configuration of secondary postgres server
17:10 pg_basebackup command explained and run
25:15 Installing and configuring PgBackrest
26:00 Create SSH connectivity between both servers
32:10 Configuing pgbackrest.conf file
39:00 Creating full postgres backup with pgbackrest command
42:00 Failover from primary to secondary postgres database
43:45 Recover postgres from remote location
๐ฅ๐ฅ Learn Devops and Cloud on our platform: https://www.automation-avenue.com
๐ง info@automation-avenue.com
== 29 ==
Video Information
Views
8.0K
Likes
224
Duration
46:55
Published
Jul 12, 2024
User Reviews
4.6
(1) Related Trending Topics
LIVE TRENDSRelated trending topics. Click any trend to explore more videos.