pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Josh Berkus <josh@agliodbs.com>
Cc: pgsql-docs@postgreSQL.org
Subject: Re: Missing docs: setting up replication slots for standbys
Date: Thu, 4 Sep 2014 08:03:18 +0200
Message-ID: <20140904060318.GD3625@alap3.anarazel.de> (raw)
In-Reply-To: <5407FBF7.5070204@agliodbs.com>
References: <5407FBF7.5070204@agliodbs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-docs>

On 2014-09-03 22:43:19 -0700, Josh Berkus wrote:
> 
> Section 46.2.2 has this:
> 
> Note: PostgreSQL also has streaming replication slots (see Section
> 25.2.5), but they are used somewhat differently there.
> 
> Section 25.2.5 has this:
> 
>  You can avoid this by setting wal_keep_segments to a value large enough
> to ensure that WAL segments are not recycled too early, or by
> configuring a replication slot for the standby.
> 
> ... however, absolutely nowhere is it explained how to configure a
> replication slot for a streaming replica.  Is it, in fact, possible to
> do so?

It actually is explained. I don't have a built source handy right now,
so chapter numbers... But at least the following is there:

   <sect3 id="streaming-replication-slots-config">
    <title>Configuration Example</title>
    <para>
     You can create a replication slot like this:
<programlisting>
postgres=# SELECT * FROM pg_create_physical_replication_slot('node_a_slot');
  slot_name  | xlog_position
-------------+---------------
 node_a_slot |

postgres=# SELECT * FROM pg_replication_slots;
  slot_name  | slot_type | datoid | database | active | xmin | restart_lsn
-------------+-----------+--------+----------+--------+------+-------------
 node_a_slot | physical  |        |          | f      |      |
(1 row)
</programlisting>
     To configure the standby to use this slot, <varname>primary_slot_name</>
     should be configured in the standby's <filename>recovery.conf</>.
     Here is a simple example:
<programlisting>
standby_mode = 'on'
primary_conninfo = 'host=192.168.1.50 port=5432 user=foo password=foopass'
primary_slot_name = 'node_a_slot'
</programlisting>

and I'm pretty sure primary_slot_name and such is configured at the
appropriate place too.

That's not to say it can't be be expanded and/or better linked...

Greetings,

Andres Freund

-- 
 Andres Freund	                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



view thread (5+ messages)  latest in thread

Message-ID: <20140904060318.GD3625@alap3.anarazel.de>
Permalink:  ../20140904060318.GD3625@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20140904060318.GD3625@alap3.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: andres@2ndquadrant.com, josh@agliodbs.com
  Subject: Re: Missing docs: setting up replication slots for standbys
  In-Reply-To: <20140904060318.GD3625@alap3.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox