pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Support <admin@e-blokos.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: pg_basebackup cannot compress to STDOUNT
Date: Sat, 9 May 2020 03:13:19 -0700
Message-ID: <e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com> (raw)
In-Reply-To: <E46B9A27-0482-4780-A169-5684E8E5119E@gmail.com>
References: <d2d908f2-27a2-15d5-4672-56eeaecd21f0@e-blokos.com>
	<22a6f05d-1bf3-1ea1-d32b-c44b08ed5767@aklaver.com>
	<70a49d18-c6cb-69e3-1ea8-ef09ebb5b579@e-blokos.com>
	<E46B9A27-0482-4780-A169-5684E8E5119E@gmail.com>

On 5/8/2020 11:51 PM, Paul Förster wrote:

> Hi Admin,
>
>> On 08. May, 2020, at 21:31, Support <admin@e-blokos.com> wrote:
>> 2) Command run?
>> ssh postgres@nodeXXX "pg_basebackup -h /run/postgresql -Ft -D- | pigz -c -p2 " | pigz -cd -p2 | tar -xf- -C /usr/local/pgsql/data
> I don't get it, sorry. Do I understand you correctly here that you want an online backup or a *remotely* running PostgreSQL instance on your local machine?
>
> If so, why not just let pg_basebackup connect remotely and let it do its magic? Something like this:
>
> $ mkdir -p /usr/local/pgsql/data
> $ cd /usr/local/pgsql/data
> $ pg_basebackup -D /run/postgresql -Fp -P -v -h nodeXXX -p 5432 -U replicator
> $ pg_ctl start
>
> You'd have to have a role with replication privs or superuser and you'd have to adapt the port of course.
>
> No need to take care of any WALs manually. It is all taken care of by pg_basebackup. The only real drawback is that if you have tablespaces, you'd have to create all directories of the tablespaces beforehand, which is why we removed them again after initially having tried the feature.
>
> That's basically, how I create async replicas on out site, which is why I additionally add -R to the above command.
>
> Cheers,
> Paul
>
The trick of my command above is to get the transfer faster in one 
compressed file going through the network.





view thread (8+ messages)

Message-ID: <e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com>
Permalink:  ../e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com/
Also on:    postgresql.org/message-id/e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: admin@e-blokos.com
  Subject: Re: pg_basebackup cannot compress to STDOUNT
  In-Reply-To: <e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com>
  References: <d2d908f2-27a2-15d5-4672-56eeaecd21f0@e-blokos.com> <22a6f05d-1bf3-1ea1-d32b-c44b08ed5767@aklaver.com> <70a49d18-c6cb-69e3-1ea8-ef09ebb5b579@e-blokos.com> <E46B9A27-0482-4780-A169-5684E8E5119E@gmail.com> <e6e24cc6-9b3f-aafd-b2b4-2902527f2a2f@e-blokos.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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