我正在尝试使用“barman-wal-archive”找不到解决问题的位置或如何调试它,无论如何有一个全新的 barman 2.10 并且它是日志:
2019-12-16 10:44:08,908 [16653] barman.server INFO: Received file '0000000100000004000000A3' with checksum 'e3fced48b20b874fc34e89dc0ce87adf' by put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:44:08,913 [16653] barman.server ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:44:13,132 [16670] barman.server INFO: Received file '0000000100000004000000A3' with checksum 'e3fced48b20b874fc34e89dc0ce87adf' by put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:44:13,137 [16670] barman.server ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:45:02,234 [16725] barman.wal_archiver INFO: Found 1 xlog segments from file archival for postgres-server. Archive all segments in one run.
2019-12-16 10:45:02,234 [16725] barman.wal_archiver INFO: Archiving segment 1 of 1 from file archival: postgres-server/0000000100000004000000A3
2019-12-16 10:45:16,625 [16743] barman.server INFO: Received file '0000000100000004000000A3' with checksum 'e3fced48b20b874fc34e89dc0ce87adf' by put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:45:16,638 [16743] barman.cli ERROR: [Errno 13] Permission denied
See log file for more details.
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/barman/cli.py", line 1355, in main
p.dispatch(pre_call=global_config)
File "/usr/lib/python2.7/site-packages/argh/helpers.py", line 55, in dispatch
return dispatch(self, *args, **kwargs)
File "/usr/lib/python2.7/site-packages/argh/dispatching.py", line 174, in dispatch
for line in lines:
File "/usr/lib/python2.7/site-packages/argh/dispatching.py", line 277, in _execute_command
for line in result:
File "/usr/lib/python2.7/site-packages/argh/dispatching.py", line 231, in _call
result = function(namespace_obj)
File "/usr/lib/python2.7/site-packages/barman/cli.py", line 912, in put_wal
server.put_wal(stream)
File "/usr/lib/python2.7/site-packages/barman/server.py", line 1904, in put_wal
fsync_file(item.path)
File "/usr/lib/python2.7/site-packages/barman/utils.py", line 332, in fsync_file
os.fsync(file_fd)
OSError: [Errno 13] Permission denied
2019-12-16 10:45:20,840 [16759] barman.server INFO: Received file '0000000100000004000000A3' with checksum 'e3fced48b20b874fc34e89dc0ce87adf' by put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:45:20,845 [16759] barman.server ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:45:25,059 [16776] barman.server INFO: Received file '0000000100000004000000A3' with checksum 'e3fced48b20b874fc34e89dc0ce87adf' by put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:45:25,064 [16776] barman.server ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
2019-12-16 10:46:01,647 [16827] barman.wal_archiver INFO: Found 1 xlog seg
postgres-server.conf
[postgres-server]
description = "Saint Petersburg PostgreSQL server to test backups"
conninfo = host=192.3.2.1 user=barman dbname=postgres
backup_method = postgres
# backup_method = rsync
archiver = on
postgresql.conf
archive_mode = on
wal_level = 'replica'
archive_command = 'barman-wal-archive barman-server postgres-server %p'
顺便说一句,当我在酒保服务器上发出 barman-wal-archive 时,它会要求输入密码:
[barman@barman-server ~]$ barman-wal-archive --test barman-server postgres-server DUMMY
barman@ldn-postgres-barman's password:
Ready to accept WAL files for the server postgres-server
[postgres@postgres-server ~] barman-wal-archive --test barman-server postgres-server DUMMY
Ready to accept WAL files for the server postgres-server
一些postgres日志:
2019-12-16 19:06:50.074 MSK,,,14552,,5df79de2.38d8,197,,2019-12-16 18:08:18 MSK,,0,LOG,00000,"archive command failed with exit code 1","The failed archive command was: barman-wal-archive barman-server postgres-server pg_wal/0000000100000004000000A3",,,,,,,,""
2019-12-16 19:06:54.306 MSK,,,14552,,5df79de2.38d8,198,,2019-12-16 18:08:18 MSK,,0,LOG,00000,"archive command failed with exit code 1","The failed archive command was: barman-wal-archive barman-server postgres-server pg_wal/0000000100000004000000A3",,,,,,,,""
2019-12-16 19:06:58.509 MSK,,,14552,,5df79de2.38d8,199,,2019-12-16 18:08:18 MSK,,0,LOG,00000,"archive command failed with exit code 1","The failed archive command was: barman-wal-archive barman-server postgres-server pg_wal/0000000100000004000000A3",,,,,,,,""
2019-12-16 19:06:58.509 MSK,,,14552,,5df79de2.38d8,200,,2019-12-16 18:08:18 MSK,,0,WARNING,01000,"archiving write-ahead log file ""0000000100000004000000A3"" failed too many times, will try again later",,,,,,,,,""
EXCEPTION: [Errno 13] Permission denied
See log file for more details.
ERROR: Remote 'barman put-wal' command has failed!
ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
ERROR: Remote 'barman put-wal' command has failed!
ERROR: Impossible to write already existing file '0000000100000004000000A3' in put-wal for server 'postgres-server' (SSH host: 192.3.2.1)
ERROR: Remote 'barman put-wal' command has failed!
这件事是我看到第一个 WAL 被接收,然后整个过程就停留在第一个 WAL 上。并且再次重现相同的错误消息?如何定义缺少哪些权限?
我将 /usr/lib/python2.7/site-packages/* 的完全访问权限授予了酒保服务器上的所有用户。酒保权限似乎是文件,因为 WAL 可以由酒保创建。
我在配置中错过了什么?
试过:
[barman@barman-server ~]$ barman switch-wal --force --archive postgres-server
The WAL file 0000000100000004000000A8 has been closed on server 'postgres-server'
Waiting for the WAL file 0000000100000004000000A8 from server 'postgres-server' (max: 30 seconds)
Processing xlog segments from file archival for postgres-server
0000000100000004000000A7
Processing xlog segments from file archival for postgres-server
0000000100000004000000A7
Processing xlog segments from file archival for postgres-server
0000000100000004000000A7
Processing xlog segments from file archival for postgres-server
0000000100000004000000A7
ERROR: The WAL file 0000000100000004000000A8 has not been received in 30 seconds
它说 - “未收到”,文件在 wal 目录中,但过程因错误而中断。我们有 4 行“为 postgres-server 处理文件归档中的 xlog 段”是否可以?
更新。我安装了 cifs (samba) 并且酒保想使用它。这是与此处相同的未解决问题:https ://sourceforge.net/p/pgbarman/tickets/80/
做到了!cifs 应该像这样安装vers=1.0:
其他 2.0、2.1 和 3.0 - 没有帮助。
不酷,但有效
注意,如果您尝试恢复/恢复数据库 - 恢复服务器上的所有权限都将与酒保服务器上的权限相同!