pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedPg_basebackup does not do aything
5+ messages / 3 participants
[nested] [flat]
* Pg_basebackup does not do aything
@ 2014-06-25 19:58 thomas simon <tsimon@neteven.com>
2014-06-25 20:49 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: thomas simon @ 2014-06-25 19:58 UTC (permalink / raw)
To: pgsql-admin
Hello,
I have a configuration in master (A) /slave (B) streaming replication.
I bought a third server (C), and I want to use C as my next master server.
In a first time, i would like to sync C as a slave, and in a second time
i would like to promote C to master, and change my current master (A) to
slave (the third server (B) would be out of the equation)
So I tried to use pg_basebackup on C, either synced on B if possible
(cascading replication), or in A if it is needed, but when i use the
command, nothing happened
My command is : pg_basebackup -D /data/postgresql/9.3/main -P -v -h
MASTER -U replicator -X s
(this command worked when I used it on my current slave)
In view pg_stat_replication on master, I have this (1st is my streaming
on slave, 2nd is the pg_basebackup I try to use)
506 | 5828189 | replicator | walreceiver | 172.25.1.2
| | 48022 | 2014-06-25 21:54:34.561107+02 |
streaming | 3E3/597E0000 | 3E3/597A0000 | 3E3/597A0000 |
3E3/5977F290 | 0 | async
512 | 5828189 | replicator | pg_basebackup | 172.25.1.3
| | 45573 | 2014-06-25 21:54:39.324114+02 |
backup | 0/0 | 3DD/BDF88000 | 3DD/BDF88000 |
3DD/BDF67C98 | 0 | async
I try to use it on master and slave, but it does the same thing (nothing)
I am wrong in the way I try to use replication ?
Thanks
Thomas
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Pg_basebackup does not do aything
2014-06-25 19:58 Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
@ 2014-06-25 20:49 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-25 22:24 ` Re: Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
0 siblings, 1 reply; 5+ messages in thread
From: Matheus de Oliveira @ 2014-06-25 20:49 UTC (permalink / raw)
To: thomas simon <tsimon@neteven.com>; +Cc: pgsql-admin
On Wed, Jun 25, 2014 at 4:58 PM, thomas simon <tsimon@neteven.com> wrote:
> My command is : pg_basebackup -D /data/postgresql/9.3/main -P -v -h
> MASTER -U replicator -X s
I'm betting you are just waiting for a "spread" checkpoint. If that is the
case, you can issue a CHECKPOINT command on the master and see if your
backup start running, or you you can use "--checkpoint=fast" option for
pg_basebackup.
--
Matheus de Oliveira
Analista de Banco de Dados
Dextra Sistemas - MPS.Br nível F!
www.dextra.com.br/postgres
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Pg_basebackup does not do aything
2014-06-25 19:58 Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
2014-06-25 20:49 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
@ 2014-06-25 22:24 ` thomas simon <tsimon@neteven.com>
2014-06-26 15:38 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: thomas simon @ 2014-06-25 22:24 UTC (permalink / raw)
To: Matheus de Oliveira <matioli.matheus@gmail.com>; +Cc: pgsql-admin
Yes, it did the trick !
Thanks Matheus
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) ?
And what I am supposed to use with parameter "restore_command" ?
In this case, my new slave will not start if i dont start it just after
the end of the pg_basebackup ?
Le 25/06/2014 22:49, Matheus de Oliveira a écrit :
>
> On Wed, Jun 25, 2014 at 4:58 PM, thomas simon <tsimon@neteven.com
> <mailto:tsimon@neteven.com>> wrote:
>
> My command is : pg_basebackup -D /data/postgresql/9.3/main -P -v
> -h MASTER -U replicator -X s
>
>
> I'm betting you are just waiting for a "spread" checkpoint. If that is
> the case, you can issue a CHECKPOINT command on the master and see if
> your backup start running, or you you can use "--checkpoint=fast"
> option for pg_basebackup.
>
>
> --
> Matheus de Oliveira
> Analista de Banco de Dados
> Dextra Sistemas - MPS.Br nível F!
> www.dextra.com.br/postgres <http://www.dextra.com.br/postgres/;
>
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Pg_basebackup does not do aything
2014-06-25 19:58 Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
2014-06-25 20:49 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-25 22:24 ` Re: Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
@ 2014-06-26 15:38 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-26 17:16 ` Re: Pg_basebackup does not do aything John Scalia <jayknowsunix@gmail.com>
0 siblings, 1 reply; 5+ messages in thread
From: Matheus de Oliveira @ 2014-06-26 15:38 UTC (permalink / raw)
To: thomas simon <tsimon@neteven.com>; +Cc: pgsql-admin
On Wed, Jun 25, 2014 at 7:24 PM, thomas simon <tsimon@neteven.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
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: Pg_basebackup does not do aything
2014-06-25 19:58 Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
2014-06-25 20:49 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-25 22:24 ` Re: Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
2014-06-26 15:38 ` Re: Pg_basebackup does not do aything Matheus de Oliveira <matioli.matheus@gmail.com>
@ 2014-06-26 17:16 ` John Scalia <jayknowsunix@gmail.com>
0 siblings, 0 replies; 5+ messages in thread
From: John Scalia @ 2014-06-26 17:16 UTC (permalink / raw)
To: Matheus de Oliveira <matioli.matheus@gmail.com>; thomas simon <tsimon@neteven.com>; +Cc: pgsql-admin
From your last message:
> 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.
>
According to the postgresql documentation at 25.2.3 Preparing the Master for Standby Servers, Set up continuous archiving on the primary to an archive directory accessible from the
standby.
I took this to mean the archive_command = "scp %p postgres@<IP of standby>:/<directory on standby>"
And yes, you can add a ";" at the end of this and specify a second server. That's what I'm doing. Oh, and you have to setup ssh keyrings so the scp will not prompt for a password.
Anyway, I got the impression that the primary should push and the standby's should not pull WAL segments from this part of the docs. Although, I can see how you could just specify
the scp in the restore_command and do the pull. I just don't know the safety of doing that.
--
Jay
--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2014-06-26 17:16 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-06-25 19:58 Pg_basebackup does not do aything thomas simon <tsimon@neteven.com>
2014-06-25 20:49 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-25 22:24 ` thomas simon <tsimon@neteven.com>
2014-06-26 15:38 ` Matheus de Oliveira <matioli.matheus@gmail.com>
2014-06-26 17:16 ` John Scalia <jayknowsunix@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