Обсуждение: pgbackrest Help Required

Поиск
Список
Период
Сортировка

pgbackrest Help Required

От
Inzamam Shafiq
Дата:
Hi Folks,

Hope you are doing well.

I am in process of configuring pgbackrest, I have followed documents and configured backup from backup server. I have a setup of Primary and Hot Standby, when I configured pgbackrest the standby DB got un-synced and now I am unable to recover it, can anyone help or share a good document where we can implement pgbackrest where streaming replication is already in place using traditional pg_basebackup method?

Note: I want to configure pgbackrest and to take backup from standby DB, however streaming replication is already there, where the archive and restore commands are configured using traditional zip method.

Thanks.

Regards,

Inzamam Shafiq
Sr. DBA

Re: pgbackrest Help Required

От
Stephen Frost
Дата:
Greetings,

* Inzamam Shafiq (inzamam.shafiq@hotmail.com) wrote:
> I am in process of configuring pgbackrest, I have followed documents and configured backup from backup server. I have
asetup of Primary and Hot Standby, when I configured pgbackrest the standby DB got un-synced and now I am unable to
recoverit, can anyone help or share a good document where we can implement pgbackrest where streaming replication is
alreadyin place using traditional pg_basebackup method? 
>
> Note: I want to configure pgbackrest and to take backup from standby DB, however streaming replication is already
there,where the archive and restore commands are configured using traditional zip method. 

Not sure what 'traditional zip method' means here, but if you've copied
the shell script out of the documentation, that's not a safe
configuration.

In configuration of pgbackrest, simply configure each of the PG hosts
and the repo and then set backup-standby=y.  You'll need to make sure
that the archive_command is set to pgbackrest, of course.  Having an
existing streaming replication setup is perfectly fine and pgbackrest
won't interfere with that.  You will want to set your restore command
to pgbackrest also though, in case streaming fails.

Thanks,

Stephen

Вложения

Re: pgbackrest Help Required

От
Inzamam Shafiq
Дата:
Hi Stephen,

Thanks for your response.

> Not sure what 'traditional zip method' means here, but if you've copied
the shell script out of the documentation, that's not a safe
configuration.

Conventional zip method means my archive_command and restore_command parameters are as follows,

archive_command = 'if test ! -d "/archives/"; then mkdir -p "/archives/"; fi; test ! -f "/archives/%f" && gzip < "%p" > "/archives/%f.gz"'

restore_command = 'gunzip < "/archives/%f".gz > "%p"'


> In configuration of pgbackrest, simply configure each of the PG hosts
and the repo and then set backup-standby=y.  You'll need to make sure
that the archive_command is set to pgbackrest, of course.  Having an
existing streaming replication setup is perfectly fine and pgbackrest
won't interfere with that.  You will want to set your restore command
to pgbackrest also though, in case streaming fails.

I have done configurations, I just need a confirmation whether I did it right or still there needs some improvement. it will be helpful if I can have a documentation where someone has primary and standby in place and he had configured pgbackrest without disturbing the replication. I have followed below steps, please have a look at them and suggest any imporvements if requried.

  1. Configure passwordless SSH connectivity between hosts 
  2. Configure NFS for shared drive between hosts 
  3. Stop Standby Cluster
  4. Prepare Primary node for pgbackrest and replication 
  5. Configure pgbackrest to backup Primary node 
  6. Setup Standby node for pgbackrest and resume replication  
    1. Configure Standby cluster for pgbackrest and check backup info 
    2. If standby is having replication issues, then --delta restore using pgbackrest 
    3. Check the replication 
  1. Test Streaming Replication 
  2. Edit pgbackrest.conf on Standby Node for backup 
  3. Perform backup from Standby 
  4. Test Steaming Replication again  

Regards,

Inzamam Shafiq
Sr. DBA


From: Stephen Frost
Sent: Tuesday, September 27, 2022 8:39 PM
To: Inzamam Shafiq
Cc: pgsql-general@lists.postgresql.org
Subject: Re: pgbackrest Help Required

Greetings,

* Inzamam Shafiq (inzamam.shafiq@hotmail.com) wrote:
> I am in process of configuring pgbackrest, I have followed documents and configured backup from backup server. I have a setup of Primary and Hot Standby, when I configured pgbackrest the standby DB got un-synced and now I am unable to recover it, can anyone help or share a good document where we can implement pgbackrest where streaming replication is already in place using traditional pg_basebackup method?
>
> Note: I want to configure pgbackrest and to take backup from standby DB, however streaming replication is already there, where the archive and restore commands are configured using traditional zip method.

Not sure what 'traditional zip method' means here, but if you've copied
the shell script out of the documentation, that's not a safe
configuration.

In configuration of pgbackrest, simply configure each of the PG hosts
and the repo and then set backup-standby=y.  You'll need to make sure
that the archive_command is set to pgbackrest, of course.  Having an
existing streaming replication setup is perfectly fine and pgbackrest
won't interfere with that.  You will want to set your restore command
to pgbackrest also though, in case streaming fails.

Thanks,

Stephen