Re: Cascade streaming replication + wal_files - Pgsql 9.2

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Patrick B <patrickbakerbr(at)gmail(dot)com>, Sameer Kumar <sameer(dot)kumar(at)ashnik(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cascade streaming replication + wal_files - Pgsql 9.2
Date: 2016-07-15 15:01:39
Message-ID: 2c7adbc7-781e-3bd8-bb32-067f18ceb58c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/15/2016 04:16 AM, Patrick B wrote:
> Hi guys,/*(I'm sending this email here because it has the same subject,
> wal_files)*/
>
> I'm setting up a new slave server, using Postgres 9.2. This new slave
> server I'll call: New_slave.
>
> I ran this command, from the new_slave server. It will connects to my
> other slave and copy the DB.
>
> ssh postgres(at)slave05 'pg_basebackup --pgdata=- --format=tar
> --label=new_slave --progress --host=localhost --port=5432
> --username=replicator --xlog' | tar -x --no-same-owner
>
>
>
> That took me 10 days, as I'm copying +2TB. Note that I'm not
> using *--xlog-method=stream*, but I was copying the wal_files manually
> to the new_slave server. By the time the command above (pg_basebackup)
> finished, there was 1TB of wal_files.
>
> I started to recovery the Database, setting the
> recovery.conf.recovery_command.
>
> and then I got this error:
>
> WAL segment `../wal_archive/000000020000171B000000D9` not found
>
>
> So.. shit.. I don't know what happened, but I checked the master server
> and actually that file wasn't shipped into the new_server. I don't know why.
>
>
>
> *Questions:*
> 1 - Do you have any recommendations? I'll have to perform that again.
>
> 2 - If I use pg_basebackup with -xlog-stream, do I have to have
> wal_shippment to the new_slave? Or the basebackup command would take
> care of them?
>
> *Using the pg_basebackup with stream should be?*
>
> ssh postgres(at)slave05 'pg_basebackup --pgdata=- --format=tar
> --label=new_slave --xlog-method=stream --progress
> --host=localhost --port=5432 --username=replicator --xlog' | tar
> -x --no-same-owner
>
>
> 3 - Instead of using pg_basebackup like that, should I dump into local
> disk(on the slave05 server) and then copy to the new_slave?

That has been suggested:

https://www.postgresql.org/message-id/f72572aa-fd8c-87e8-69d8-bfc7e25f05d1%402ndquadrant.com
>
> Cheers

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2016-07-15 15:07:18 Re: migrating data from an old postgres version
Previous Message Willy-Bas Loos 2016-07-15 14:55:05 Re: migrating data from an old postgres version