Re: Pausing log shipping for streaming replication

From: Joseph Kregloh <jkregloh(at)sproutloud(dot)com>
To: Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
Cc: PostgreSQL General Discussion Forum <pgsql-general(at)postgresql(dot)org>
Subject: Re: Pausing log shipping for streaming replication
Date: 2014-12-16 15:36:31
Message-ID: CAAW2xfcgy0J0gxmRWZDrB+01Y95X9esq-2oA=q46H+sYPbXp3A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Dec 15, 2014 at 7:12 PM, Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
wrote:

>
> On 16 Dec 2014 01:13, "Joseph Kregloh" <jkregloh(at)sproutloud(dot)com> wrote:
> >
> > Hello,
> >
> > I have a master multi slave streaming replication setup. One master and
> two slaves. I need to do some maintenance on one of the slaves as one of
> the drives died however there is some other weird things going on in that
> array that I would need to investigate. So I am expecting the machine to be
> down at least two hours.
> >
> > I remember reading that if a master cannot connect to the slave it would
> hold the log file from shipping. Is there any other way to hold the file
> until the slave comes back online? Would it affect both slaves not getting
> their files shipped over?
> >
> > The good thing is that the slave in question is not serving any
> connections.
> >
> > From what I remember emptying out the archive_command would pause log
> shipping. Can the same be done by issuing a pg_stop_backup()?
>
> Are you using streaming replication or log shipping? I believe both are
> different. Can you share you archive_command and recovery.conf content?
>
> Streaming replication.

archive_command:
archive_command = '/usr/local/pgsql/data/log_shipper.sh "%p" "%f"'

log_shipper.sh
#!/usr/local/bin/bash
rsync -a $1 pgprod(at)prod-db-slave:archive/$2 < /dev/null;
rsync -a $1 pgprod(at)prod-db-slave:p3_wal_files/$2 < /dev/null; # Temp
storage for WAL files

recovery.conf
standby_mode = 'on'
primary_conninfo = 'host=prod-db port=5434 user=USER password=PW'
trigger_file = '/tmp/pgsql_prod_db.trigger'
restore_command = 'cp -f /usr/local/pgsql/archive/%f %p < /dev/null'
archive_cleanup_command = 'pg_archivecleanup /usr/local/pgsql/archive/ %r'

>
> > Thanks,
> > -Joseph Kregloh
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2014-12-16 15:41:20 Re: pg_dump
Previous Message Tom Lane 2014-12-16 15:30:16 Re: Full text search prefix matching