Re: Turn off streaming replication - leaving Master running - Mailing list pgsql-general

From Jeff Janes
Subject Re: Turn off streaming replication - leaving Master running
Date
Msg-id CAMkU=1wV24EmzVOjqqV=_QeqjVzDT3qThOT9gQTihQzGS7oSkQ@mail.gmail.com
Whole thread Raw
In response to Re: Turn off streaming replication - leaving Master running  (Andy Erskine <andy.erskine@jds.net.au>)
Responses Re: Turn off streaming replication - leaving Master running
List pgsql-general
On Sun, Jun 28, 2015 at 11:34 PM, Andy Erskine <andy.erskine@jds.net.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

pgsql-general by date:

Previous
From: Andy Erskine
Date:
Subject: Re: Turn off streaming replication - leaving Master running
Next
From: John R Pierce
Date:
Subject: Re: Turn off streaming replication - leaving Master running