Re: Pg_basebackup does not do aything

From: Matheus de Oliveira <matioli(dot)matheus(at)gmail(dot)com>
To: thomas simon <tsimon(at)neteven(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Pg_basebackup does not do aything
Date: 2014-06-26 15:38:33
Message-ID: CAJghg4LOTYVyKdR2O8rcPx5rDjOhAC9Dz+hK608pS-mG2qNH5w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Jun 25, 2014 at 7:24 PM, thomas simon <tsimon(at)neteven(dot)com> wrote:

> Yes, it did the trick !
> Thanks Matheus
>
>
You're welcome. Just know that this may cause some I/O storm if you have
many dirty data in your buffer caches.

> Something I don't understand is how my 2nd slave will be synced to
> master, because master's archive command only sent WAL files to 1st slave.
> Does I have to archive on both slaves ? (is it possible) ?
>

Streaming Replication (configured by primary_conninfo) does not need to use
archives, instead PG uses one dedicated process on each server (wal sender
and wal receiver) that sends records of WAL from the sender (a master or
another slave in cascading replication scenario) to the receiver.

So, you can, but you don't necessarily *need* to send the archives to the
slaves.

> And what I am supposed to use with parameter "restore_command" ?
>

It is recommended to configure it to grab archive files from somewhere (can
be from other node) if you have archiving enabled. So, if the receiver
can't keep up with the sender (e.g. when the WAL files are rotated and the
sender does not have the files the receiver wants anymore), it can get the
files it need from archiving.

> In this case, my new slave will not start if i dont start it just after
> the end of the pg_basebackup ?
>

Yes. You have to start it after pg_basebackup. It is also recommended to
use "-X stream" option for pg_basebackup, it will copy the necessary WAL
files to the slave, and so it can start faster. Be aware that you'll need
two slots of max_wal_sender to accomplish that (one for the data backup and
other for the WAL files).

--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message John Scalia 2014-06-26 16:48:44 Re: Wal archive way behind in streaming replication
Previous Message thomas simon 2014-06-25 22:24:02 Re: Pg_basebackup does not do aything