pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Srinivasa T N <seenutn@gmail.com>
To: PostgreSQL General <pgsql-general@lists.postgresql.org>
Subject: Re: Replicating an existing (huge) database
Date: Mon, 28 Nov 2022 11:24:32 +0100
Message-ID: <7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at> (raw)
In-Reply-To: <CAFruNdeXBDzHvQGBPfvc+cbKKTq=WsJKTzdKYkhMpLsG3RtGdA@mail.gmail.com>
References: <CAFruNdeXBDzHvQGBPfvc+cbKKTq=WsJKTzdKYkhMpLsG3RtGdA@mail.gmail.com>

On Mon, 2022-11-28 at 15:47 +0530, Srinivasa T N wrote:
> I am using postgresql 12.  As part of streaming replication setup, I run pg_basebackup
> on the slave which copies the database from master to slave.  But the database is huge
> and it takes around 2 to 3 days for the pg_basebackup to finish.  When pg_basebackup
> is running, a huge number of wal files are generated on the master which occupies a lot
> of space (even though it is for 2-3 days, disk space is low).
> Is there any other way to start replication without using pg_baseback?

There is the "low level backup API" (pg_start_backup() and pg_stop_backup()) that
allows you to copy the data yourself, for example with storage snapshots, which
can be much faster.  The essential process is like with pg_basebackup, but you
can use more efficient methods to copy the data.

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com





view thread (3+ messages)  latest in thread

Message-ID: <7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at>
Permalink:  ../7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at/
Also on:    postgresql.org/message-id/7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at

 · 

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-general@postgresql.org
  Cc: laurenz.albe@cybertec.at, seenutn@gmail.com
  Subject: Re: Replicating an existing (huge) database
  In-Reply-To: <7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at>
  References: <CAFruNdeXBDzHvQGBPfvc+cbKKTq=WsJKTzdKYkhMpLsG3RtGdA@mail.gmail.com> <7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at>

* 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