Re: Replicating an existing (huge) database - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Replicating an existing (huge) database
Date
Msg-id 7036a495a71b92e96c1a4f4fbd9ba0b520bf9acf.camel@cybertec.at
Whole thread Raw
In response to Replicating an existing (huge) database  (Srinivasa T N <seenutn@gmail.com>)
List pgsql-general
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



pgsql-general by date:

Previous
From: Srinivasa T N
Date:
Subject: Replicating an existing (huge) database
Next
From: Torsten Förtsch
Date:
Subject: Re: Replicating an existing (huge) database