estou tentando usar "barman-wal-archive" não consigo descobrir onde corrigir o problema ou como depurá-lo, de qualquer maneira, há um novo barman 2.10 e é log:
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'
a propósito, quando eu emito barman-wal-archive no servidor barman, ele pede a senha:
[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
um pouco de log do 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!
Essa coisa é que eu vejo primeiro o WAL é recebido e, em seguida, todo o processo fica preso nesse primeiro WAL. e a mesma mensagem de erro é reproduzida novamente? Como definir quais permissões estão faltando?
Eu dei acesso total a /usr/lib/python2.7/site-packages/* para todos os usuários no servidor barman. As permissões do Barman parecem arquivo, pois o WAL pode ser criado pelo barman.
O que eu perdi na minha configuração?
Tentou :
[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
ele disse - "não foi recebido", o arquivo está no diretório wal, mas o processo é interrompido com erro. tudo bem termos 4 linhas de "Processando segmentos xlog do arquivamento de arquivos para o servidor postgres"
atualizado eu tenho cifs (samba) montado e barman deve usá-lo. É o mesmo problema aberto aqui: https://sourceforge.net/p/pgbarman/tickets/80/
fez isso! cifs deve ser montado com vers=1.0 assim:
Outros 2.0, 2.1 e 3.0 - não ajudam.
chato, mas funciona
NB se você tentar recuperar/restaurar o banco de dados - todas as permissões no servidor de restauração serão as mesmas que estão no servidor barman!