pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Missing docs: setting up replication slots for standbys
5+ messages / 3 participants
[nested] [flat]

* Missing docs: setting up replication slots for standbys
@ 2014-09-04 05:43 Josh Berkus <josh@agliodbs.com>
  2014-09-04 05:48 ` Re: Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
  2014-09-04 06:03 ` Re: Missing docs: setting up replication slots for standbys Andres Freund <andres@2ndquadrant.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Josh Berkus @ 2014-09-04 05:43 UTC (permalink / raw)
  To: pgsql-docs; +Cc: Andres Freund <andres@2ndquadrant.com>


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?

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Missing docs: setting up replication slots for standbys
  2014-09-04 05:43 Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
@ 2014-09-04 05:48 ` Josh Berkus <josh@agliodbs.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Josh Berkus @ 2014-09-04 05:48 UTC (permalink / raw)
  To: pgsql-docs

On 09/03/2014 10:43 PM, 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?

Searching ... it is possible.  However, the way to do so is actually
scattered among 5 different doc pages.  I'm not sure that I'm up for the
surgery required to make this make sense to users ... anybody else have
the energy/time?

The relevant pages in the docs are these:

http://www.postgresql.org/docs/9.4/static/standby-settings.html
http://www.postgresql.org/docs/9.4/static/functions-admin.html#FUNCTIONS-REPLICATION
http://www.postgresql.org/docs/9.4/static/logicaldecoding-explanation.html#AEN66111
http://www.postgresql.org/docs/9.4/static/warm-standby.html#STREAMING-REPLICATION

... otherwise, I'll just write a blog or postgresguide or something.

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Missing docs: setting up replication slots for standbys
  2014-09-04 05:43 Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
@ 2014-09-04 06:03 ` Andres Freund <andres@2ndquadrant.com>
  2014-09-04 06:06   ` Re: Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Andres Freund @ 2014-09-04 06:03 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Missing docs: setting up replication slots for standbys
  2014-09-04 05:43 Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
  2014-09-04 06:03 ` Re: Missing docs: setting up replication slots for standbys Andres Freund <andres@2ndquadrant.com>
@ 2014-09-04 06:06   ` Josh Berkus <josh@agliodbs.com>
  2014-09-04 13:22     ` Re: Missing docs: setting up replication slots for standbys Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Josh Berkus @ 2014-09-04 06:06 UTC (permalink / raw)
  To: pgsql-docs

On 09/03/2014 11:03 PM, Andres Freund wrote:
> 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.

Huh.  I can't seem to find any way to navigate to that page.  What is it
supposed to be under?


-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Missing docs: setting up replication slots for standbys
  2014-09-04 05:43 Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
  2014-09-04 06:03 ` Re: Missing docs: setting up replication slots for standbys Andres Freund <andres@2ndquadrant.com>
  2014-09-04 06:06   ` Re: Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
@ 2014-09-04 13:22     ` Michael Paquier <michael.paquier@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Paquier @ 2014-09-04 13:22 UTC (permalink / raw)
  To: Josh Berkus <josh@agliodbs.com>; +Cc: pgsql-docs

On Thu, Sep 4, 2014 at 3:06 PM, Josh Berkus <josh@agliodbs.com> wrote:
> On 09/03/2014 11:03 PM, Andres Freund wrote:
>> and I'm pretty sure primary_slot_name and such is configured at the
>> appropriate place too.
>
> Huh.  I can't seem to find any way to navigate to that page.  What is it
> supposed to be under?
Category seems adapted:
Chapter 25. High Availability, Load Balancing, and Replication
25.2. Log-Shipping Standby Servers
-- 
Michael


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



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2014-09-04 13:22 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 05:43 Missing docs: setting up replication slots for standbys Josh Berkus <josh@agliodbs.com>
2014-09-04 05:48 ` Josh Berkus <josh@agliodbs.com>
2014-09-04 06:03 ` Andres Freund <andres@2ndquadrant.com>
2014-09-04 06:06   ` Josh Berkus <josh@agliodbs.com>
2014-09-04 13:22     ` Michael Paquier <michael.paquier@gmail.com>

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