public inbox for [email protected]  
help / color / mirror / Atom feed
From: rams nalabolu <[email protected]>
To: Ron Johnson <[email protected]>
Cc: Pgsql-admin <[email protected]>
Subject: Re: pg_basebackup: error: could not create directory
Date: Thu, 5 Sep 2024 08:49:27 -0500
Message-ID: <CAHq7gtCC5ENrix5ey4cYTsPEv-3+kPRdvnvidWVr+KQiTQFvXg@mail.gmail.com> (raw)
In-Reply-To: <CANzqJaALNsvzraoMRKRaXoR6EvYomE_CTyY+FdAh9iT3-KgQfg@mail.gmail.com>
References: <SY0PR01MB9296C4A820754E1CB0CB0EADD29D2@SY0PR01MB9296.ausprd01.prod.outlook.com>
	<CANzqJaALNsvzraoMRKRaXoR6EvYomE_CTyY+FdAh9iT3-KgQfg@mail.gmail.com>

I’m not sure what’s the use case. But if you are taking the base backup
with default format you need to make sure all tablespace directories should
be empty as it tries to create backup file under it. So try with tar format
and make sure -D directory is empty then it will create all tablespace
backups in that directory with <<tablespace our>>.tar and you should be
good.
While doing PITR or setting HA server you need to create table space
directory on target server and copy the corresponding tar file and untar
it. You will get tablespace directory information from tablespace_map file
from backup.



On Thu, Sep 5, 2024 at 8:00 AM Ron Johnson <[email protected]> wrote:

> On Thu, Sep 5, 2024 at 3:41 AM Samir Mamun <[email protected]>
> wrote:
>
>> Hi,
>>
>>
>>
>> Need help with replication setup, pg_basebackup failing with:
>>
>>
>>
>> pg_basebackup -P -R -X stream -c fast -h <node_name> -U <user_name> -p
>> <port#> -D  <dat_location> -v
>>
>> Password:
>>
>> pg_basebackup: initiating base backup, waiting for checkpoint to complete
>>
>> pg_basebackup: checkpoint completed
>>
>> pg_basebackup: write-ahead log start point: 6/67000028 on timeline 2
>>
>> pg_basebackup: starting background WAL receiver
>>
>> pg_basebackup: created temporary replication slot "pg_basebackup_3720137"
>>
>> pg_basebackup: error: could not create directory "……": File exists
>>
>
> It's explicitly telling you the problem: a file already exists in the
> replicated $PGDATA.
>
>
>> pg_basebackup: removing contents of data directory "…………"
>>
>> pg_basebackup: changes to tablespace directories will not be undone
>>
>
>
> --
> Death to America, and butter sauce.
> Iraq lobster!
>


view thread (5+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: pg_basebackup: error: could not create directory
  In-Reply-To: <CAHq7gtCC5ENrix5ey4cYTsPEv-3+kPRdvnvidWVr+KQiTQFvXg@mail.gmail.com>

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

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox