Re: How to start slave after pg_basebackup. Why min_wal_size andwal_keep_segments are duplicated - Mailing list pgsql-general

From Paul Förster
Subject Re: How to start slave after pg_basebackup. Why min_wal_size andwal_keep_segments are duplicated
Date
Msg-id 58EE62CB-0436-41DF-A97F-6A2F07FB48FF@gmail.com
Whole thread Raw
In response to Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated  ("Andrus" <kobruleht2@hot.ee>)
List pgsql-general
Hi Andrus,

> On 01. Jun, 2020, at 12:26, Andrus <kobruleht2@hot.ee> wrote:
> My script does the same thing as your comands.

no, it does not. And as long as you refuse to understand that, I can't help you.

> I want to create replication server.

no, you want to create a streaming replica.

> Old cluster is empty, from initdb. Backup is not needed

then why the mv stuff?

> pg_basebackup uses environment varuables if not specified in command line. So my script does the same thing.

have you looked at the other options?

> I tried
> sudo --user=postgres pg_basebackup ....
> but got error
> could not change directory to "/root": Permission denied

try
sudo su - postgres pg_basebackup ....

Note the "-"! It's essential to get the environment of postgres, which is what you want.

Cheers,
Paul


pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Re: How to start slave after pg_basebackup. Why min_wal_size and wal_keep_segments are duplicated
Next
From: Julien Rouhaud
Date:
Subject: Re: Vanishing unique constraint