简体   繁体   English

无法打开文件“./.postgresql.conf.swp”:权限被拒绝

[英]could not open file "./.postgresql.conf.swp": Permission denied

i am getting permission denied error while taking backup using pg_basebackup.使用 pg_basebackup 进行备份时出现权限被拒绝错误。

/usr/pgsql-11/bin/pg_basebackup -h127.0.0.1 -U thbbackup -D backup -Ft -z -P
Password:
238546/238575 kB (99%), 1/1 tablespace
pg_basebackup: could not get write-ahead log end position from server: ERROR:  could not open file "./.postgresql.conf.swp": Permission denied
pg_basebackup: removing data directory "backup"

You have probably forgotten the file postgresql.conf open in a text editor (vim).您可能忘记了在文本编辑器 (vim) 中打开的 postgresql.conf 文件。 If you open this conf file again then the text editor should complain saying it is already open so, you can just delete this as .swp file it is a temporary file anyway.如果你再次打开这个 conf 文件,那么文本编辑器应该会抱怨它已经打开,所以你可以将它作为 .swp 文件删除,它无论如何都是一个临时文件。

"When you edit a file in Vim, you have probably noticed the (temporary) .swp file that gets created. By default it'll be in the same location as the file that you are editing (although you can change this). The swap file contains the info about changes made to the file (or buffer)." “当您在 Vim 中编辑文件时,您可能已经注意到创建的(临时).swp 文件。默认情况下,它与您正在编辑的文件位于同一位置(尽管您可以更改此位置)。交换文件包含有关对文件(或缓冲区)所做更改的信息。”

In this case it looks like a swap file from an open editor or previously orphaned.在这种情况下,它看起来像是来自打开的编辑器或以前孤立的交换文件。 In general, Postgres needs ownership of all files in the data directory for a pg_basebackup.通常,Postgres 需要对 pg_basebackup 的数据目录中的所有文件拥有所有权。 I have seen this failure on files with root:root or other ownership residing in the data directory.我在数据目录中具有root:root或其他所有权的文件上看到了这种失败。 After running chown postgres:postgres [filename] on the target files, pg_basebackup should be able to run successfully.在目标文件上运行chown postgres:postgres [filename]后,pg_basebackup 应该能够成功运行。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 PostgreSQL 11 共享内存错误:无法打开共享内存段“/PostgreSQL.XXXXXXXX”:没有这样的文件或目录 - PostgreSQL 11 Shared Memory Error: could not open shared memory segment "/PostgreSQL.XXXXXXXX": No such file or directory 错误:[050]:无法获取文件“/tmp/pgbackrest/demo-archive.lock”的锁定:权限被拒绝 - ERROR: [050]: unable to acquire lock on file '/tmp/pgbackrest/demo-archive.lock': Permission denied pg_restore:[tar archiver] 在 tar 存档中找不到文件“toc.dat”的 header:- [PostgreSQL-11] pg admin 4 - pg_restore: [tar archiver] could not find header for file "toc.dat" in tar archive :- [PostgreSQL-11] pg admin 4 pg_ctl.exe 无法以自定义 postgresql.conf 启动 - pg_ctl.exe fails to start with custom postgresql.conf 云 SQL - PostgreSQL - 由于缺少超级用户权限,导入失败 - Cloud SQL - PostgreSQL - Import failed due to the lack of superuser permission 如何为PostgreSQL中的特定表提供写权限? - How to provide write permission for specific tables in PostgreSQL? 如何正确编写 PostgreSQL 百分比查询? - How could I correctly write PostgreSQL query for percentages? PostgreSQL 服务器连接错误:无法连接到服务器 - PostgreSQL server Connection error: could not connect to server 在Windows 10上将JSON文件导入Postgresql 11 - Importing a JSON file into Postgresql 11 on Windows 10 日志文件自动更改-PostgreSQL - Log file is changed automaticaly - PostgreSQL
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM