Re: Creating new cluster by copying directory? - Mailing list pgsql-admin

From Jerry Sievers
Subject Re: Creating new cluster by copying directory?
Date
Msg-id 87zjts6cn8.fsf@comcast.net
Whole thread Raw
In response to Re: Creating new cluster by copying directory?  (Wells Oliver <wellsoliver@gmail.com>)
Responses Re: Creating new cluster by copying directory?  (Wells Oliver <wellsoliver@gmail.com>)
List pgsql-admin
Wells Oliver <wellsoliver@gmail.com> writes:

> So it's safe to copy the files in /var/lib/postgresql/9.1/main to /var/lib/postgresql/9.1/test while main is running?

Yes, provided that you put main in backup mode and then do a PITR when
you bring up this new test instance.

If your main DB is running but absolutely idle, you might get away
just starting it in which case the postmaster will do a regular crash
recovery but I'll presume your source instance 'main' isn't idle.

Study the manual sections relating to backup/PITR.

HTH

> On Thu, Jul 11, 2013 at 1:41 PM, Gilberto Castillo <gilberto.castillo@etecsa.cu> wrote:
>
>     > All: it would take ~4 hours to pg_restore a backup. I want to quickly
>     > create a duplicate cluster (for testing). My idea:
>     >
>     > 1. pg_ctlcreatecluster 9.1 test
>     > 2. rm /var/lib/postgresql/9.1/test/*
>     > 2. cp /var/lib/postgresql/9.1/main /var/lib/postgresql/9.1/test
>     > 3. pg_ctlcluster 9.1 test start
>     >
>     > Is this viable? If not, is there another way to create a duplicate cluster
>     > in a timely fashion?
>
>     Test Repmgr works with the same philosophy. ;-)
>
>     Saludos,
>     Gilberto Castillo
>     La Habana, Cuba
>
>     ---
>     This message was processed by Kaspersky Mail Gateway 5.6.28/RELEASE running at host imx3.etecsa.cu
>     Visit our web-site: <http://www.kaspersky.com>, <http://www.viruslist.com>
>
> --
> Wells Oliver
> wellsoliver@gmail.com
>

--
Jerry Sievers
Postgres DBA/Development Consulting
e: postgres.consulting@comcast.net
p: 312.241.7800


pgsql-admin by date:

Previous
From: "Gilberto Castillo"
Date:
Subject: Re: Creating new cluster by copying directory?
Next
From: Wells Oliver
Date:
Subject: Re: Creating new cluster by copying directory?