Re: Taking rsynced base-backup without wal-archiving enabled

From: Soni M <diptatapa(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Rene Romero Benavides <rene(dot)romero(dot)b(at)gmail(dot)com>, juergen(dot)fuchsberger(at)uni-graz(dot)at, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Taking rsynced base-backup without wal-archiving enabled
Date: 2014-08-05 00:42:11
Message-ID: CAAMgDXkbsgOWQd1mOXRTTvmRrc=Sxgae3nrgEF=Jf=uVOKHdNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

i think you could try pg_basebackup tools. it has options to achieve same
thing as you wanted. but need pgdata on destination emptied. if you really
need to do the exact thing as you stated, then you need to set postgres to
keep high enough number of xlog files on master to ensure that needed xlog
files not removed prior to completed backup. but no guarantee, since the
database activity is not a static one.

On Mon, Aug 4, 2014 at 11:15 PM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Mon, Jun 23, 2014 at 09:28:06PM -0500, Rene Romero Benavides wrote:
> > It depends on the database transactional activity,
> > observe how many new wal files are generated during a period equivalent
> to what
> > it takes to do your base backup. I would set it to twice that number.
> Take into
> > account that a checkpoint is issued at the beginning of the process. If
> you're
> > lazy just try setting it to something very high such as 256 or more to
> prevent
> > wal files being recycled during the process.
> >
> >
> > 2014-06-23 2:12 GMT-05:00 J rgen Fuchsberger <juergen(dot)fuchsberger(at)gmx(dot)at
> >:
> >
> > Hi all,
> >
> > Can I do a consistent file-system-level backup using the following
> > procedure:
> >
> > 1) SELECT pg_start_backup(...)
> > 2) rsync postgres data dir to another server
> > 3) SELECT pg_stop_backup()
> > 4) rsync pg_xlog directory
> >
> > >From what I understand this should be similar to running
> pg_basebackup
> > using the -x parameter, correct? One caveat seems to be that
> > wal_keep_segments should be set "high enough". Can anybody tell what
> > "high enough" usually is?
>
> I am coming late to this thread, but it seems easier for the user to set
> archive_command to something meaningful during start/stop backup, and
> set it to /bin/true at other times. I realize they can't turn
> archive_mode on/off without a restart.
>
> --
> Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
> EnterpriseDB http://enterprisedb.com
>
> + Everyone has their own god. +
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Regards,

Soni Maula Harriz

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andreas 2014-08-05 03:32:30 How to get PG 9.3 for a RaspberryPI (Debian Wheezy)?
Previous Message David G Johnston 2014-08-04 23:11:22 Re: Joining on CTE is unusually slow?