Re: Turn off streaming replication - leaving Master running

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Andy Erskine <andy(dot)erskine(at)jds(dot)net(dot)au>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Turn off streaming replication - leaving Master running
Date: 2015-06-29 07:06:45
Message-ID: CAMkU=1wV24EmzVOjqqV=_QeqjVzDT3qThOT9gQTihQzGS7oSkQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jun 28, 2015 at 11:34 PM, Andy Erskine <andy(dot)erskine(at)jds(dot)net(dot)au>
wrote:

> no snapshot available .. i don't mind running basebackup once i've
> finished my test.
>
> So if someone could help with the steps to turn off replication and bring
> secondary up as a standalone db that would be great
> thanks.
>

If people are used to connecting the standby in order to run production
queries (to spare load from the master), then make sure they know they
can't do that anymore. Configure the network to block them, change
pg_hba.conf, etc.

Make sure that it is not in archive mode, or at least that it isn't
archiving to the same directory as master is.

Shut it down, remove (or rename) the recovery.conf file, and start it back
up again. Instead of doing this you could use the trigger file (configured
in recovery.conf) or pg_ctl promote, but I wouldn't do that. You don't
want to make it look like you have promoted it to master, when that is not
what you have done.

But since you want a clone, what is the point of first setting up
streaming, and then breaking it? Just use pg_basebackup to set up a clone
directly, without ever having started streaming. It seems like you are
just going to confuse yourself about what is a standby meant for fail over,
and what is a clone meant for testing. With possibly disastrous
consequences.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2015-06-29 07:08:38 Re: Turn off streaming replication - leaving Master running
Previous Message Andy Erskine 2015-06-29 06:58:37 Re: Turn off streaming replication - leaving Master running