pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Vladimir Borodin <root@simply.name>
To: Alexey Klyukin <alexk@hintbits.com>
Cc: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: base backup from the standby without pg_basebackup
Date: Thu, 2 Apr 2015 15:07:33 +0300
Message-ID: <A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name> (raw)
In-Reply-To: <CAAS3tyKqkHXqgzZkTekRY2DYzJQfm1LfRU3FFPYQwEX3Q-9xxg@mail.gmail.com>
References: <CAAS3tyKqkHXqgzZkTekRY2DYzJQfm1LfRU3FFPYQwEX3Q-9xxg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

Hi, Alexey.

> 2 апр. 2015 г., в 13:13, Alexey Klyukin <alexk@hintbits.com> написал(а):
> 
> Hello,
> 
> We had an issue with backing up one of our master servers, since a
> base backup increased the load on the master, resulting in slowdowns
> in the application working with that database. While there are ways to
> overcome this problem by using nice on the backend process doing the
> backup or throttling the network connection, we've decided to use a
> less complicated route of producing a base backup from an almost idle
> standby server.
> 
> We don't use pg_basebackup, but our own tool, which does the rsync +
> compression and also symlinks some directories from pg_data (such as
> pg_log or pg_xlog) to the locations on different partitions. So, the
> question is, how would one make a base backup from the [async] standby
> without using pg_basebackup. Our steps were the following:
> 
> - make sure WAL files from the master are archived and reachable on
> the new replica host (via NFS).
> - run pg_start_backup('label') on the master
> - initialise a new cluster, rsync  files from the replica, create a
> recovery.conf and so on (made by our tool)
> - run pg_stop_backup() on the master.
> 
> The new replica did start and were restoring WAL files for a while,
> but eventually we came across the PANIC message:
> 
> 2015-03-18 19:10:52.943 CET,,,17293,,55083494.438d,922,,2015-03-17
> 15:05:08 CET,1/0,0,PANIC,XX000,"WAL contains references to invalid
> pages",,,,,"xlog redo visible: rel 1663/16414/24453; blk 26569",,,,""
> 
> We did check the disk on that system (and now rechecking the memory),
> but so far the hardware itself looks ok, which makes me wonder if the
> procedure above is flawed? What would be the proper way to produce a
> base backup from the standby without using pg_basebackup?

I would recommend using barman. If you still want to use your own solution, you could look at how barman actually does it. It has an ability to take backups from replics and uses pgespresso [1] extension for it.

[0] http://docs.pgbarman.org/#main_features
[1] https://github.com/2ndquadrant-it/pgespresso

> 
> Both master and replicas are running PostgreSQL 9.3.5.
> 
> Kind regards,
> -- 
> Alexey Klyukin
> 
> 
> -- 
> Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-admin


--
May the force be with you…
https://simply.name

view thread (9+ messages)  latest in thread

Message-ID: <A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name>
Permalink:  ../A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name/
Also on:    postgresql.org/message-id/A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: root@simply.name, alexk@hintbits.com
  Subject: Re: base backup from the standby without pg_basebackup
  In-Reply-To: <A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name>
  References: <CAAS3tyKqkHXqgzZkTekRY2DYzJQfm1LfRU3FFPYQwEX3Q-9xxg@mail.gmail.com> <A730A2F6-26CF-42ED-8B72-7B65EDD29467@simply.name>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox