Re: pg_basebackup: return value 1: reason?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Andrej Vanek <andrej(dot)vanek(dot)sk(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_basebackup: return value 1: reason?
Date: 2016-04-16 23:09:34
Message-ID: 5712C62E.5090105@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/16/2016 02:24 PM, Andrej Vanek wrote:
> Hello,
>
> my setup is:
> 1 master
> 1 synchronous slave (up and running)
> 2 asynchronous slave (up and running)
> Now I'm setting up asynchronous slave: first step of this setup is
> pg_basebackup connecting to master.
>
> Indirections are because it is encapsulated in a script. This script is
> aimed to serve for automated replication recovery. This script is
> launched by crm_mon -d daemon.
>
> You are right to check without indirections: now I tried to run the
> command directly from command line without variables- it works fine...
>
> This means: no problem in pg_basebackup itself
>
> but some problem in environment of process launched from crm_mon daemon.
> Thanks for your hint (remove indirections). Pg_basebackup works fine
> when launched from command-line..
> Unfortenutely I have still no clue how to solve the issue- su works. I

Is the su - even necessary?

pg_basebackup is a Postgres client program you can specify the user you
want it to connect to using -U.

Or do you need the script to run as postgres in order to get permissions
on wherever you are creating the backup directory?

> have to find out why pg_basebackup cannot fork when launched from crm_mon.

I assume crm_mon is this:

http://linux.die.net/man/8/crm_mon

from Pacemaker.

I do not use Pacemaker, but I am pretty sure that running what is a
monitoring program in daemon mode and then shelling out to another
program is not workable. The docs seem to bear this out:

http://clusterlabs.org/wiki/PgSQL_Replicated_Cluster#Installation

https://github.com/smbambling/pgsql_ha_cluster/wiki/Building-A-Highly-Available-Multi-Node-PostgreSQL-Cluster

> Best Regards, Andrej
>
> 2016-04-16 1:17 GMT+02:00 Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>>:
>

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jinhua Luo 2016-04-17 07:55:41 what's the exact command definition in read committed isolation level?
Previous Message Andrej Vanek 2016-04-16 21:28:58 Re: pg_basebackup: return value 1: reason?