Re: Log Shipping

From: Joseph Kregloh <jkregloh(at)sproutloud(dot)com>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Log Shipping
Date: 2016-05-31 20:46:13
Message-ID: CAAW2xfeikUY2K-sjSUVsL2+8+V4sSDUAk8PrNqnivRGkARyNDQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, May 31, 2016 at 4:12 PM, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
wrote:

> Joseph Kregloh wrote:
> > It is my understanding that if PostgeSQL has log shipping enabled, if for
> > whatever reason it cannot ship the file the master server will hold it.
> But
> > for how long?
>
> Forever (which means it dies because of running out of space in the
> partition containing pg_xlog).
>
> > Secondly, I have 2 servers I ship log files to using the following
> script:
> >
> > #!/usr/local/bin/bash
> >
> > # Slave 1
> > rsync -a $1 pgi(at)192(dot)168(dot)1(dot)105:archive/$2 < /dev/null;
> >
> > # Slave 2
> > rsync -a $1 pg(at)192(dot)168(dot)1(dot)93:archive/$2 < /dev/null;
> >
> > In this case if Slave 1 is up but Slave 2 is down. It will ship the log
> > file to Slave 1 but not Slave 2 and move one. Thereby Slave 2 will now be
> > out of sync, correct?
>
> You could cause the script to return failure if either of these copies
> fail, and return success if once both replicas have the file
> (considering that one replica might already have the file from a
> previous run of your script); that way, the master will retain the file
> until both replicas have it, and remove the file once both replicas have
> it. Of course, you want to avoid copying the file again to the replica
> that already had the file, without getting confused by a partially
> written file.
>

Excellent, thanks for the reply.

-Joseph

>
> --
> Álvaro Herrera http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alexander M. Sauer-Budge 2016-05-31 20:59:59 Row security policies documentation question
Previous Message Alan Hodgson 2016-05-31 20:45:05 Re: Checkpoint Err on Startup of Rsynced System