Thread: Pg_auto_failover
I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :
ERROR Failed to ensure empty directory "//backup" : Permission denied
Error Failed initialise standby server , see above for details.
Where is it located?
Can someone please help
Can someone please help
---------- Forwarded message ---------
From: Sonam Sharma <sonams1209@gmail.com>
Date: Tue, Sep 24, 2019, 9:11 PM
Subject: Pg_auto_failover
To: pgsql-general <pgsql-general@postgresql.org>
From: Sonam Sharma <sonams1209@gmail.com>
Date: Tue, Sep 24, 2019, 9:11 PM
Subject: Pg_auto_failover
To: pgsql-general <pgsql-general@postgresql.org>
I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :
ERROR Failed to ensure empty directory "//backup" : Permission denied
Error Failed initialise standby server , see above for details.
Where is it located?
Can someone please help
On Sep 24, 2019, at 10:22 AM, Sonam Sharma <sonams1209@gmail.com> wrote:Can someone please help---------- Forwarded message ---------
From: Sonam Sharma <sonams1209@gmail.com>
Date: Tue, Sep 24, 2019, 9:11 PM
Subject: Pg_auto_failover
To: pgsql-general <pgsql-general@postgresql.org>I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :ERROR Failed to ensure empty directory "//backup" : Permission deniedError Failed initialise standby server , see above for details.Where is it located?Can someone please help
What os, what version of postgres. How was it installed
> On Sep 24, 2019, at 9:41 AM, Sonam Sharma <sonams1209@gmail.com> wrote: > > I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondaryit's failing with below : > > ERROR Failed to ensure empty directory "//backup" : Permission denied > Error Failed initialise standby server , see above for details. > > Where is it located? > > Can someone please help “//backup” looks like a typo in the configuration
Hi Rob,
Os : Linux rhel x86_64
Postgres version : 11.2
Installed the rpm of pg_auto_failover and then set up the monitor, primary. Secondary is failing with given error
On Tue, Sep 24, 2019, 10:11 PM Rob Sargent <robjsargent@gmail.com> wrote:
> On Sep 24, 2019, at 9:41 AM, Sonam Sharma <sonams1209@gmail.com> wrote:
>
> I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :
>
> ERROR Failed to ensure empty directory "//backup" : Permission denied
> Error Failed initialise standby server , see above for details.
>
> Where is it located?
>
> Can someone please help
“//backup” looks like a typo in the configuration
> On Sep 24, 2019, at 11:38 AM, Sonam Sharma <sonams1209@gmail.com> wrote: > > Hi Rob, > Os : Linux rhel x86_64 > Postgres version : 11.2 > Installed the rpm of pg_auto_failover and then set up the monitor, primary. Secondary is failing with given error > Well //backup is a valid reference to /backup (double slash simply gets reduced to single slash). Does /backup exist andif so, is it empty. Can you find “//backup” (or even “backup”) anywhere in the parts you “set up”?
Hi Rob,
I have no where mentioned /backup. I have manually create backup inside / folder to check why it's giving the error. The /backup folder is empty only.
On Tue, Sep 24, 2019, 11:15 PM Rob Sargent <robjsargent@gmail.com> wrote:
> On Sep 24, 2019, at 11:38 AM, Sonam Sharma <sonams1209@gmail.com> wrote:
>
> Hi Rob,
> Os : Linux rhel x86_64
> Postgres version : 11.2
> Installed the rpm of pg_auto_failover and then set up the monitor, primary. Secondary is failing with given error
>
Well //backup is a valid reference to /backup (double slash simply gets reduced to single slash). Does /backup exist and if so, is it empty. Can you find “//backup” (or even “backup”) anywhere in the parts you “set up”?
On Tue, Sep 24, 2019 at 8:41 AM Sonam Sharma <sonams1209@gmail.com> wrote:
I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :ERROR Failed to ensure empty directory "//backup" : Permission deniedError Failed initialise standby server , see above for details.
If you're using the tool from Citus, per https://github.com/citusdata/pg_auto_failover/blob/d8ba26f47a60eaf1e1dc63ae67279553984d84f5/src/bin/pg_autoctl/file_utils.c#L112
Is the problem literally that the OS user executing the commands does not have sufficient permission to work in that directory? If you are creating your data directory manually in "/", you might want to create a directory under that path that the user executing the commands has sufficient permission to modify (delete, create, write to)
My user has permission to touch inside the Fs.
I am not getting why it is checking for /backup.
Any suggestions on this , what else I can check
On Wed, Sep 25, 2019, 12:15 AM bricklen <bricklen@gmail.com> wrote:
On Tue, Sep 24, 2019 at 8:41 AM Sonam Sharma <sonams1209@gmail.com> wrote:I was setting up pg_auto_failover. Have successfully set up and monitor and primary instance. While setting up secondary it's failing with below :ERROR Failed to ensure empty directory "//backup" : Permission deniedError Failed initialise standby server , see above for details.If you're using the tool from Citus, per https://github.com/citusdata/pg_auto_failover/blob/d8ba26f47a60eaf1e1dc63ae67279553984d84f5/src/bin/pg_autoctl/file_utils.c#L112Is the problem literally that the OS user executing the commands does not have sufficient permission to work in that directory? If you are creating your data directory manually in "/", you might want to create a directory under that path that the user executing the commands has sufficient permission to modify (delete, create, write to)
On 9/25/19 8:55 AM, Sonam Sharma wrote: > My user has permission to touch inside the Fs. > I am not getting why it is checking for /backup. > > Any suggestions on this , what else I can check In addition to the code already linked to, I would look at https://github.com/citusdata/pg_auto_failover/blob/1290edd0bab54c627f577cf4462bd16a56b20a1a/src/bin/pg_autoctl/pgctl.c#L429-L437 You see that pg_auto_failover is trying to `mkdir -p $pgdata/../backup` (where pgdata is a C variable, not a shell/environment variable). You might want to read through the rest of that code to see where pgdata is coming from, and see if it's being set correctly. Do you really want /backup at the root level? Clearly whatever user is running pg_basebackup doesn't have permission to make that directory. But maybe that's okay and the directory should be somewhere else. -- Paul ~{:-) pj@illuminatedcomputing.com
Thanks Paul, I am able to set up. Does pg_auto_failover only works on v10 and v11.
I am having 9.5 on production.
On Wed, Sep 25, 2019, 11:40 PM Paul Jungwirth <pj@illuminatedcomputing.com> wrote:
On 9/25/19 8:55 AM, Sonam Sharma wrote:
> My user has permission to touch inside the Fs.
> I am not getting why it is checking for /backup.
>
> Any suggestions on this , what else I can check
In addition to the code already linked to, I would look at
https://github.com/citusdata/pg_auto_failover/blob/1290edd0bab54c627f577cf4462bd16a56b20a1a/src/bin/pg_autoctl/pgctl.c#L429-L437
You see that pg_auto_failover is trying to `mkdir -p $pgdata/../backup`
(where pgdata is a C variable, not a shell/environment variable). You
might want to read through the rest of that code to see where pgdata is
coming from, and see if it's being set correctly. Do you really want
/backup at the root level?
Clearly whatever user is running pg_basebackup doesn't have permission
to make that directory. But maybe that's okay and the directory should
be somewhere else.
--
Paul ~{:-)
pj@illuminatedcomputing.com
It seems it does, only 10 and 11 as of this:
"We support Postgres 10 and Postgres 11. "
On Sat, Sep 28, 2019 at 8:44 AM Sonam Sharma <sonams1209@gmail.com> wrote:
Thanks Paul, I am able to set up. Does pg_auto_failover only works on v10 and v11.I am having 9.5 on production.On Wed, Sep 25, 2019, 11:40 PM Paul Jungwirth <pj@illuminatedcomputing.com> wrote:On 9/25/19 8:55 AM, Sonam Sharma wrote:
> My user has permission to touch inside the Fs.
> I am not getting why it is checking for /backup.
>
> Any suggestions on this , what else I can check
In addition to the code already linked to, I would look at
https://github.com/citusdata/pg_auto_failover/blob/1290edd0bab54c627f577cf4462bd16a56b20a1a/src/bin/pg_autoctl/pgctl.c#L429-L437
You see that pg_auto_failover is trying to `mkdir -p $pgdata/../backup`
(where pgdata is a C variable, not a shell/environment variable). You
might want to read through the rest of that code to see where pgdata is
coming from, and see if it's being set correctly. Do you really want
/backup at the root level?
Clearly whatever user is running pg_basebackup doesn't have permission
to make that directory. But maybe that's okay and the directory should
be somewhere else.
--
Paul ~{:-)
pj@illuminatedcomputing.com