Backup in a master-slave setup ?

922 views
Skip to first unread message

mani...@gmail.com

unread,
Apr 2, 2015, 3:29:39 AM4/2/15
to pgba...@googlegroups.com
Hi everyone

Currently I have two postgresql server, bdd01 and bdd02. bdd01 is the master and bdd02 is the slave (stream replication, read-only).

I try to set Barman but I'm stuck because I don't know how to backup these servers :

* I cannot backup bdd01 because it already has a archive_command for stream replication to bdd02 (barman needs its own archive_command).

* I cannot backup bdd02 because Barman exit with "DETAILS: Unable to start a backup because of server recovery state" which is a normal state for a slave Postgresql.

Is my setup bad ? Is there something I can do with Barman ?

Regards,

Xavier C.

mani...@gmail.com

unread,
Apr 2, 2015, 3:42:07 AM4/2/15
to pgba...@googlegroups.com
Hm, answering to myself, but according to the documentation, this is possible with Concurrent Backup and pgespresso. Unfortunately the requirements are PostgreSQL 9.2/9.3 but I use 9.1 because this is the stable version available in Debian Wheezy.

If there is another way I'm highly interested.

Thanks.

Xavier C.

Giulio Calacoci

unread,
Apr 2, 2015, 7:05:16 AM4/2/15
to pgba...@googlegroups.com
Hi Xavier,

if you are using streaming replication, usually WAL shipping from master to slave is not necessary. 
Postgres uses the connection that you configured with the primary_conninfo parameter to stream WAL files between master and slave

If the streaming replication is active, usually using also continuous WAL archiving
on the slave is not necessary, just be sure that the wal_keep_segments for the master is correctly configured, 
to avoid early recycle of the WAL segments.
Then you can configure the archive_command on the master server for shipping WAL to barman.

Regards
Giulio




--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Giulio Calacoci - 2ndQuadrant Italia
 PostgreSQL Training, Services and Support
 giulio....@2ndQuadrant.it | www.2ndQuadrant.it 

mani...@gmail.com

unread,
Apr 2, 2015, 10:25:40 AM4/2/15
to pgba...@googlegroups.com
Thank you Giulio.

You are right, I just realized that the archive_command line in my postgresql.conf was intended to the former backup system (not in use anymore) not for replication. So I will edit it for barman.

Regards,

Xavier C.
 giulio.calacoci@2ndQuadrant.it | www.2ndQuadrant.it 

Narendran Narayanaswamy

unread,
Sep 10, 2015, 1:33:11 PM9/10/15
to Barman, Backup and Recovery Manager for PostgreSQL
Hi,

I have a question on this. 

I have a postgres master-slave setup 10.0.1.230 (master) streaming WALs to 10.0.1.231 (slave). Now, I want to setup barman on .231 pointing to the databases in slave, but when I do this and take a backup, 

Starting backup for server master in /var/lib/data/bar_vol/barman_backups/barman_base/20150910T172001
ERROR: Backup failed issuing start backup command.
DETAILS: Unable to start a backup because of server recovery state

How do I accomplish this or is it not possible for me to do it without pointing to master ?

-Naren

Giulio Calacoci

unread,
Sep 14, 2015, 3:39:09 AM9/14/15
to pgba...@googlegroups.com
Hi Narendran,

this is normal if you don't have the pgespresso extension installed. please read carefully here: 


and here:


Regards
Giulio

--
--
You received this message because you are subscribed to the "Barman for PostgreSQL" group.
To post to this group, send email to pgba...@googlegroups.com
To unsubscribe from this group, send email to
pgbarman+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/pgbarman?hl=en?hl=en-GB

---
You received this message because you are subscribed to the Google Groups "Barman, Backup and Recovery Manager for PostgreSQL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pgbarman+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
 Giulio Calacoci - 2ndQuadrant Italia
 PostgreSQL Training, Services and Support
 giulio....@2ndQuadrant.it | www.2ndQuadrant.it 
Reply all
Reply to author
Forward
0 new messages