[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-admin
Subject:    Re: [ADMIN] switching replication from standard asynch to slots
From:       Vladimir Borodin <root () simply ! name>
Date:       2016-12-12 6:41:36
Message-ID: EA68DEB3-2807-4180-9B6C-3C7DF19C56EF () simply ! name
[Download RAW message or body]

Hi.

> 9 дек. 2016 г., в 22:48, Mike Broers <mbroers@gmail.com> написал(а):
> 
> I have a few production environments that use vanilla streaming replication.  (9.5 \
> and 9.6) 
> I'm curious if I can create the replication slot on the primary host, shutdown \
> postgres on the secondary replica, update the recovery.conf to include the \
> primary_slot_name, and restart postgres on the replica to effectively 'switch' over \
> to use the slot for streaming without repriming with a fresh pg_basebackup.   
> Also curious if I get into a pickle because of limits in pgsql_xlog disk space if I \
> can just shut down the replica, remove the slot information, and do whatever \
> cleanup is required on the primary and restart the replica with the slot \
> information removed from the recovery.conf and go back to vanilla streaming \
> replication without repriming. 
> Anyone do this kind of slot/streaming switcheroo?

Yep, we have used both of described scenarios, they work. Note that in the second \
case you would probably need a valid restore_command in recovery.conf.

> 
> Mike
> 
> 


--
May the force be with you…
https://simply.name


[Attachment #3 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; \
-webkit-line-break: after-white-space;" class="">Hi.<div class=""><br \
class=""><div><blockquote type="cite" class=""><div class="">9 дек. 2016 г., в \
22:48, Mike Broers &lt;<a href="mailto:mbroers@gmail.com" \
class="">mbroers@gmail.com</a>&gt; написал(а):</div><br \
class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I have a few \
production environments that use vanilla streaming replication. &nbsp;(9.5 and \
9.6)<div class=""><br class=""></div><div class="">I'm curious if I can create the \
replication slot on the primary host, shutdown postgres on the secondary replica, \
update the recovery.conf to include the primary_slot_name, and restart postgres on \
the replica to effectively 'switch' over to use the slot for streaming without \
repriming with a fresh pg_basebackup. &nbsp;</div><div class=""><br \
class=""></div><div class="">Also curious if I get into a pickle because of limits in \
pgsql_xlog disk space if I can just shut down the replica, remove the slot \
information, and do whatever cleanup is required on the primary and restart the \
replica with the slot information removed from the recovery.conf and go back to \
vanilla streaming replication without repriming.</div><div class=""><br \
class=""></div><div class="">Anyone do this kind of slot/streaming \
switcheroo?</div></div></div></blockquote><div><br class=""></div><div>Yep, we have \
used both of described scenarios, they work. Note that in the second case you would \
probably need a valid restore_command in recovery.conf.</div><br class=""><blockquote \
type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br \
class=""></div><div class="">Mike</div><div class=""><div class=""><br \
class=""></div><div class=""><br class=""></div></div></div> \
</div></blockquote></div><br class=""><div class=""> <div style="color: rgb(0, 0, 0); \
font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; \
font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; \
text-align: start; text-indent: 0px; text-transform: none; white-space: normal; \
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br \
class="Apple-interchange-newline">--</div><div style="color: rgb(0, 0, 0); \
font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; \
font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; \
text-align: start; text-indent: 0px; text-transform: none; white-space: normal; \
widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">May the \
force be with you…</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; \
font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; \
letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; \
text-indent: 0px; text-transform: none; white-space: normal; widows: auto; \
word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a \
href="https://simply.name" class="">https://simply.name</a></div> </div>

<br class=""></div></body></html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic