pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
replication question
13+ messages / 9 participants
[nested] [flat]

* replication question
@ 2005-02-14 14:18  Fred Blaise <fred.blaise@excilan.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Fred Blaise @ 2005-02-14 14:18 UTC (permalink / raw)
  To: pgsql-general

Hello

I am running postgres 7.4.6 on 2 BSDi boxes. One is live, the other one
is a failover. I would like to implement a master-slave replication
process.

I believe replication has been included in the base package since 7.3.x.

Do you have any good pointers/how-to to direct me to?

Thanks for the help.

Best,

        ))fred

Attachments:

  signature.asc (application/pgp-signature, 188B) download

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

* Re: replication question
@ 2005-02-14 14:24  Robby Russell <robby@planetargon.com>
  parent: Fred Blaise <fred.blaise@excilan.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Robby Russell @ 2005-02-14 14:24 UTC (permalink / raw)
  To: Fred Blaise <fred.blaise@excilan.com>; +Cc: pgsql-general

On Mon, 2005-02-14 at 15:18 +0100, Fred Blaise wrote:
> Hello
> 
> I am running postgres 7.4.6 on 2 BSDi boxes. One is live, the other one
> is a failover. I would like to implement a master-slave replication
> process.
> 
> I believe replication has been included in the base package since 7.3.x.
> 
> Do you have any good pointers/how-to to direct me to?
> 
> Thanks for the help.
> 
> Best,
> 


Try Slony:

http://www.onlamp.com/pub/a/onlamp/2004/11/18/slony.html

-Robby


-- 
/***************************************
* Robby Russell | Owner.Developer.Geek
* PLANET ARGON  | www.planetargon.com
* Portland, OR  | robby@planetargon.com
* 503.351.4730  | blog.planetargon.com
* PHP/PostgreSQL Hosting & Development
* --- Now hosting Ruby on Rails Apps ---
****************************************/




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

* Replication Question
@ 2016-01-28 14:22  Bala Venkat <akpgeek@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Bala Venkat @ 2016-01-28 14:22 UTC (permalink / raw)
  To: pgsql-general

Hi there -

           We have a set up where there is One master streaming to 3 Slaves
.  2 slaves are in our DR environment. One is the prod environment.

          Wanted to make the DR as primary. I know we can make the one of
the slave in DR to primary. If I want to keep the other slave as slave
connecting to the new Master DR , is it possible ? or I have to set the
whole streaming process again in DR ?  Can you please share your experience
?


Regards

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

* Re: Replication Question
@ 2016-01-28 17:04  Andreas Kretschmer <akretschmer@spamfence.net>
  parent: Bala Venkat <akpgeek@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Andreas Kretschmer @ 2016-01-28 17:04 UTC (permalink / raw)
  To: pgsql-general

Bala Venkat <akpgeek@gmail.com> wrote:

> Hi there -
> 
>            We have a set up where there is One master streaming to 3 Slaves . 
> 2 slaves are in our DR environment. One is the prod environment. 
> 
>           Wanted to make the DR as primary. I know we can make the one of the
> slave in DR to primary. If I want to keep the other slave as slave connecting
> to the new Master DR , is it possible ? or I have to set the whole streaming
> process again in DR ?  Can you please share your experience ?

should be possible, but you have to change the recovery.conf to point
out to the new master, and, of course, the new master should stream the
wals (wal_sender, proper pg_hba.conf and so on).


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.                              (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly."   (unknown)
Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°


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



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

* Re: Replication Question
@ 2016-02-02 16:42  Bala Venkat <akpgeek@gmail.com>
  parent: Andreas Kretschmer <akretschmer@spamfence.net>
  0 siblings, 0 replies; 13+ messages in thread

From: Bala Venkat @ 2016-02-02 16:42 UTC (permalink / raw)
  To: Andreas Kretschmer <akretschmer@spamfence.net>; +Cc: pgsql-general

Thanks for the help. We need an upgrade on the DB for the solution. I
checked your suggestion and it works on versions from 9.1 and above

Regards

On Thu, Jan 28, 2016 at 12:04 PM, Andreas Kretschmer <
akretschmer@spamfence.net> wrote:

> Bala Venkat <akpgeek@gmail.com> wrote:
>
> > Hi there -
> >
> >            We have a set up where there is One master streaming to 3
> Slaves .
> > 2 slaves are in our DR environment. One is the prod environment.
> >
> >           Wanted to make the DR as primary. I know we can make the one
> of the
> > slave in DR to primary. If I want to keep the other slave as slave
> connecting
> > to the new Master DR , is it possible ? or I have to set the whole
> streaming
> > process again in DR ?  Can you please share your experience ?
>
> should be possible, but you have to change the recovery.conf to point
> out to the new master, and, of course, the new master should stream the
> wals (wal_sender, proper pg_hba.conf and so on).
>
>
> Andreas
> --
> Really, I'm not out to destroy Microsoft. That will just be a completely
> unintentional side effect.                              (Linus Torvalds)
> "If I was god, I would recompile penguin with --enable-fly."   (unknown)
> Kaufbach, Saxony, Germany, Europe.              N 51.05082°, E 13.56889°
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

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

* Replication question
@ 2018-10-22 13:53  Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  0 siblings, 4 replies; 13+ messages in thread

From: Scot Kreienkamp @ 2018-10-22 13:53 UTC (permalink / raw)
  To: pgsql-general

Hi everyone,

We just moved to PG9.6 from 9.1 (yeah, not my choice to wait this long).  In 9.1 I had to make the archive location (NFS in my case) available to all the mirrors running PG so that they could catch up whenever they fell behind.  I thought I read somewhere that in 9.6, as long as the WAL log is available on disk or in the archive the replication server will provide that to the replication client, and my archive NFS mount didn't have to be available to all replication clients.  It doesn't seem to be operating that way though.  Did I completely remember that wrong or did I misunderstand something?



Scot Kreienkamp | Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive | Monroe, Michigan 48162  | * 734-384-6403 | | * 7349151444 | *  Scot.Kreienkamp@la-z-boy.com<mailto:%7BE-mail%7D>
www<http://www.la-z-boy.com/>.la-z-boy.com<http://www.la-z-boy.com/; | facebook.<https://www.facebook.com/lazboy>com<https://www.facebook.com/lazboy>/<https://www.facebo...; | twitter.com/lazboy<https://twitter.com/lazboy; | youtube.com/<https://www.youtube.com/user/lazboy>lazboy<https://www.youtube.com/user/lazboy;

[cid:lzbVertical_hres.jpg]



This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.

Attachments:

lzbVertical_hres.jpg (image/jpeg, 20.8K) download view image
^ permalink raw reply [nested|flat] 13+ messages in thread

* Re: Replication question
@ 2018-10-22 13:57  Don Seiler <don@seiler.us>
  parent: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  3 siblings, 1 reply; 13+ messages in thread

From: Don Seiler @ 2018-10-22 13:57 UTC (permalink / raw)
  To: Scot.Kreienkamp@la-z-boy.com; +Cc: pgsql-general

>
> I thought I read somewhere that in 9.6, as long as the WAL log is
> available on disk or in the archive the replication server will provide
> that to the replication client, and my archive NFS mount didn’t have to be
> available to all replication clients.
>

Streaming replication will only read from the WAL files in the
$PGDATA/pg_xlog directory. It will not read from archives. So, yes, you
would need your NFS mount on the replica (or otherwise copy the archive
files to the replica).

Don.

-- 
Don Seiler
www.seiler.us

Attachments:

lzbVertical_hres.jpg (image/jpeg, 20.8K) download view image
^ permalink raw reply [nested|flat] 13+ messages in thread

* RE: Replication question
@ 2018-10-22 14:04  Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  parent: Don Seiler <don@seiler.us>
  0 siblings, 0 replies; 13+ messages in thread

From: Scot Kreienkamp @ 2018-10-22 14:04 UTC (permalink / raw)
  To: Don Seiler <don@seiler.us>; +Cc: pgsql-general

Dang, I thought that sounded too good to be true.  Oh well.

Thanks for setting me straight.


Scot Kreienkamp |Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive| Monroe, Michigan 48162 | Office: 734-384-6403 | | Mobile: 7349151444 | Email: Scot.Kreienkamp@la-z-boy.com
From: Don Seiler [mailto:don@seiler.us]
Sent: Monday, October 22, 2018 9:58 AM
To: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Replication question

I thought I read somewhere that in 9.6, as long as the WAL log is available on disk or in the archive the replication server will provide that to the replication client, and my archive NFS mount didn’t have to be available to all replication clients.

Streaming replication will only read from the WAL files in the $PGDATA/pg_xlog directory. It will not read from archives. So, yes, you would need your NFS mount on the replica (or otherwise copy the archive files to the replica).

Don.

--
Don Seiler
www.seiler.us<http://www.seiler.us;

This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.


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

* Re: Replication question
@ 2018-10-22 14:04  Andreas Kretschmer <andreas@a-kretschmer.de>
  parent: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  3 siblings, 0 replies; 13+ messages in thread

From: Andreas Kretschmer @ 2018-10-22 14:04 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org



Am 22.10.2018 um 15:53 schrieb Scot Kreienkamp:
> I thought I read somewhere that in 9.6, as long as the WAL log is 
> available on disk or in the archive the replication server will 
> provide that to the replication client, and my archive NFS mount 
> didn’t have to be available to all replication clients.  It doesn’t 
> seem to be operating that way though.  Did I completely remember that 
> wrong or did I misunderstand something?

no, but you can define a "restore_command" within your recovery_conf.

https://www.postgresql.org/docs/current/static/continuous-archiving.html


Regards, Andreas

-- 
2ndQuadrant - The PostgreSQL Support Company.
www.2ndQuadrant.com





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

* Re: Replication question
@ 2018-10-22 15:42  Jeff Janes <jeff.janes@gmail.com>
  parent: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  3 siblings, 1 reply; 13+ messages in thread

From: Jeff Janes @ 2018-10-22 15:42 UTC (permalink / raw)
  To: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>; +Cc: pgsql-general

On Mon, Oct 22, 2018, 9:54 AM Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
wrote:

> Hi everyone,
>
>
>
> We just moved to PG9.6 from 9.1 (yeah, not my choice to wait this long).
> In 9.1 I had to make the archive location (NFS in my case) available to all
> the mirrors running PG so that they could catch up whenever they fell
> behind.  I thought I read somewhere that in 9.6, as long as the WAL log is
> available on disk or in the archive the replication server will provide
> that to the replication client, and my archive NFS mount didn’t have to be
> available to all replication clients.  It doesn’t seem to be operating that
> way though.  Did I completely remember that wrong or did I misunderstand
> something?
>

The master won't read from the archives for you in order to send to an
replica.  But using replication slots, you can keep the needed log files
right in pg_xlog/pg_wal until all replicas get what they need (assuming the
disk is large enough).  Then you don't need an archive at all for
replication purposes, still might for pitr purposes.

Perhaps this is what you heard about.

Cheers,

Jeff

>
>

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

* RE: Replication question
@ 2018-10-22 17:20  Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  parent: Jeff Janes <jeff.janes@gmail.com>
  0 siblings, 1 reply; 13+ messages in thread

From: Scot Kreienkamp @ 2018-10-22 17:20 UTC (permalink / raw)
  To: Jeff Janes <jeff.janes@gmail.com>; +Cc: pgsql-general

I remember thinking it was pulling from archive with the restore command if necessary to augment what it had on disk.  If that was the case I wanted to configure it.  I don’t care for the replication slots due to the possible disk space issue as we don’t run shifts around the clock.  So I’ll have to mount the archive via NFS like I had before, not a big deal.

As an alternative to NFS I was thinking about making the archives available via HTTPD and using wget or curl in my script instead of a copy from NFS.  That seems like it would work better from the remote sites.


Scot Kreienkamp |Senior Systems Engineer | La-Z-Boy Corporate
One La-Z-Boy Drive| Monroe, Michigan 48162 | Office: 734-384-6403 | | Mobile: 7349151444 | Email: Scot.Kreienkamp@la-z-boy.com
From: Jeff Janes [mailto:jeff.janes@gmail.com]
Sent: Monday, October 22, 2018 11:43 AM
To: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
Cc: Postgres General <pgsql-general@postgresql.org>
Subject: Re: Replication question


On Mon, Oct 22, 2018, 9:54 AM Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com<mailto:Scot.Kreienkamp@la-z-boy.com>> wrote:
Hi everyone,

We just moved to PG9.6 from 9.1 (yeah, not my choice to wait this long).  In 9.1 I had to make the archive location (NFS in my case) available to all the mirrors running PG so that they could catch up whenever they fell behind.  I thought I read somewhere that in 9.6, as long as the WAL log is available on disk or in the archive the replication server will provide that to the replication client, and my archive NFS mount didn’t have to be available to all replication clients.  It doesn’t seem to be operating that way though.  Did I completely remember that wrong or did I misunderstand something?

The master won't read from the archives for you in order to send to an replica.  But using replication slots, you can keep the needed log files right in pg_xlog/pg_wal until all replicas get what they need (assuming the disk is large enough).  Then you don't need an archive at all for replication purposes, still might for pitr purposes.

Perhaps this is what you heard about.

Cheers,

Jeff



This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.


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

* Re: Replication question
@ 2018-10-22 17:32  Andres Freund <andres@anarazel.de>
  parent: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  3 siblings, 0 replies; 13+ messages in thread

From: Andres Freund @ 2018-10-22 17:32 UTC (permalink / raw)
  To: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>; +Cc: pgsql-general

Hi,

On 2018-10-22 13:53:40 +0000, Scot Kreienkamp wrote:
> We just moved to PG9.6 from 9.1 (yeah, not my choice to wait this long).  In 9.1 I had to make the archive location (NFS in my case) available to all the mirrors running PG so that they could catch up whenever they fell behind.  I thought I read somewhere that in 9.6, as long as the WAL log is available on disk or in the archive the replication server will provide that to the replication client, and my archive NFS mount didn't have to be available to all replication clients.  It doesn't seem to be operating that way though.  Did I completely remember that wrong or did I misunderstand something?

You can configure it that way with replication slots.  That obviously
requires enough space. It also, as the data is stored on the primary,
can't protect against loosing the entire primary (nor will an nfs served
archive if it's hosted on the primary).


> This message is intended only for the individual or entity to which it is addressed.  It may contain privileged, confidential information which is exempt from disclosure under applicable laws.  If you are not the intended recipient, you are strictly prohibited from disseminating or distributing this information (other than to the intended recipient) or copying this information.  If you have received this communication in error, please notify us immediately by e-mail or by telephone at the above number. Thank you.

GNGNGNG.

Greetings,

Andres Freund




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

* Re: Replication question
@ 2018-10-23 13:06  Jeff Janes <jeff.janes@gmail.com>
  parent: Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
  0 siblings, 0 replies; 13+ messages in thread

From: Jeff Janes @ 2018-10-23 13:06 UTC (permalink / raw)
  To: Scot.Kreienkamp@la-z-boy.com; +Cc: pgsql-general

On Mon, Oct 22, 2018 at 1:20 PM Scot Kreienkamp <
Scot.Kreienkamp@la-z-boy.com> wrote:

> I remember thinking it was pulling from archive with the restore command
> if necessary to augment what it had on disk.  If that was the case I wanted
> to configure it.  I don’t care for the replication slots due to the
> possible disk space issue as we don’t run shifts around the clock.  So I’ll
> have to mount the archive via NFS like I had before, not a big deal.
>

If the archive partition fills up, then your archive command will start
failing, which means your pg_xlog will also start filling up.  If you can
dedicate the same amount of space to the new pg_xlog as you currently have
dedicated to pg_wal + archive partition, then there should be no increased
risk of running out of disk space.  Except that you can have
archive_command compress the WAL files upon archival, which can save a lot
of space.  Of course there are a variety of reasons that that might not
work, like you use small fast disk for pg_xlog and big slow ones for
archive, or pg_xlog is your problem while archive is some other guy's
problem.  But it is something to consider.


> As an alternative to NFS I was thinking about making the archives
> available via HTTPD and using wget or curl in my script instead of a copy
> from NFS.  That seems like it would work better from the remote sites.
>
>
>
Yeah, or rsync or scp.

Cheers,

Jeff

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


end of thread, other threads:[~2018-10-23 13:06 UTC | newest]

Thread overview: 13+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-14 14:18 replication question Fred Blaise <fred.blaise@excilan.com>
2005-02-14 14:24 ` Robby Russell <robby@planetargon.com>
2016-01-28 14:22 Replication Question Bala Venkat <akpgeek@gmail.com>
2016-01-28 17:04 ` Re: Replication Question Andreas Kretschmer <akretschmer@spamfence.net>
2016-02-02 16:42   ` Re: Replication Question Bala Venkat <akpgeek@gmail.com>
2018-10-22 13:53 Replication question Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
2018-10-22 13:57 ` Re: Replication question Don Seiler <don@seiler.us>
2018-10-22 14:04   ` RE: Replication question Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
2018-10-22 14:04 ` Re: Replication question Andreas Kretschmer <andreas@a-kretschmer.de>
2018-10-22 15:42 ` Re: Replication question Jeff Janes <jeff.janes@gmail.com>
2018-10-22 17:20   ` RE: Replication question Scot Kreienkamp <Scot.Kreienkamp@la-z-boy.com>
2018-10-23 13:06     ` Re: Replication question Jeff Janes <jeff.janes@gmail.com>
2018-10-22 17:32 ` Re: Replication question Andres Freund <andres@anarazel.de>

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