首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >barman & Dockerized : check : FAILED (barman命令超时)

barman & Dockerized : check : FAILED (barman命令超时)
EN

Database Administration用户
提问于 2020-02-18 22:45:49
回答 2查看 948关注 0票数 1

我试图将barman配置为备份在Docker容器中运行的PostgreSQL 11数据库。barman v2.10直接安装在Ubuntu18.04.3主机上。

barman check pgsql给出了错误:

检查超时:失败(酒保检查命令超时)

Output of barman check pgsql

代码语言:javascript
复制
$ time barman check pgsql
Server pgsql:
    check timeout: FAILED (barman check command timed out)

real    0m36.978s
user    0m0.336s
sys 0m0.025s

但是,使用psql使用相同的凭据立即连接到同一个数据库没有问题:

Output of psql

代码语言:javascript
复制
$ psql -h 172.xxx.xxx.xxx -p 5432 -U postgres --dbname=app_development
Password for user postgres: 
psql (11.7 (Ubuntu 11.7-1.pgdg18.04+1), server 11.6)
Type "help" for help.

app_development=# 

问题: barman的问题可能是什么?

/etc/barman.d/pgsql.conf

代码语言:javascript
复制
[pgsql]
description =  "PostgreSQL server"
conninfo = host=172.xxx.xxx.xxx port=5432 user=postgres password=mypassword dbname=app_development
ssh_command = ssh -p 2222 postgres@127.0.0.1
backup_method = rsync
parallel_jobs = 1
reuse_backup = link
archiver = on

/etc/barman.conf

代码语言:javascript
复制
[barman]
barman_home = /var/lib/barman/pg
barman_user = barman

backup_options = exclusive_backup
compression = gzip
network_compression = true
bandwidth_limit = 0
immediate_checkpoint = true
last_backup_maximum_age = 2 DAYS
retention_policy = RECOVERY WINDOW OF 3 MONTHS
minimum_redundancy = 2
log_file = /var/log/barman/barman.log
log_level = DEBUG

/var/log/barman/barman.log

代码语言:javascript
复制
2020-02-19 02:05:58,241 [21079] barman.config DEBUG: Including configuration file: pgsql.conf
2020-02-19 02:05:58,242 [21079] barman.cli DEBUG: Initialised Barman version 2.10 (config: /etc/barman.conf, args: {'color': 'auto', 'quiet': False, 'debug': False, 'format': 'console', 'server_name': ['pgsql'], 'nagios': False, 'command': 'check'})
2020-02-19 02:05:58,249 [21079] barman.server DEBUG: Retention policy for server pgsql: RECOVERY WINDOW OF 3 MONTHS
2020-02-19 02:05:58,249 [21079] barman.server DEBUG: WAL retention policy for server pgsql: MAIN
2020-02-19 02:05:58,250 [21079] barman.server DEBUG: Starting check: 'WAL archive'
2020-02-19 02:05:58,250 [21079] barman.server DEBUG: Starting check: 'empty incoming directory'
2020-02-19 02:05:58,250 [21079] barman.server DEBUG: Starting check: 'empty streaming directory'
2020-02-19 02:05:58,250 [21079] barman.server DEBUG: Starting check: 'PostgreSQL'
2020-02-19 02:06:01,606 [21088] barman.config DEBUG: Including configuration file: pgsql.conf
2020-02-19 02:06:01,607 [21088] barman.cli DEBUG: Initialised Barman version 2.10 (config: /etc/barman.conf, args: {'color': 'auto', 'quiet': True, 'debug': False, 'format': 'console', 'keep_descriptors': False, 'command': 'cron'})
2020-02-19 02:06:01,613 [21088] barman.server DEBUG: Retention policy for server pgsql: RECOVERY WINDOW OF 3 MONTHS
2020-02-19 02:06:01,613 [21088] barman.server DEBUG: WAL retention policy for server pgsql: MAIN
2020-02-19 02:06:01,613 [21088] barman.command_wrappers DEBUG: BarmanSubProcess: ['/usr/bin/python3', '/usr/bin/barman', '-c', '/etc/barman.conf', '-q', 'archive-wal', 'pgsql']
2020-02-19 02:06:01,615 [21088] barman.command_wrappers DEBUG: BarmanSubProcess: subprocess started. pid: 21089
2020-02-19 02:06:01,915 [21089] barman.config DEBUG: Including configuration file: pgsql.conf
2020-02-19 02:06:01,916 [21089] barman.cli DEBUG: Initialised Barman version 2.10 (config: /etc/barman.conf, args: {'color': 'auto', 'quiet': True, 'debug': False, 'format': 'console', 'config': '/etc/barman.conf', 'server_name': 'pgsql', 'command': 'archive_wal'})
2020-02-19 02:06:01,922 [21089] barman.server DEBUG: Retention policy for server pgsql: RECOVERY WINDOW OF 3 MONTHS
2020-02-19 02:06:01,922 [21089] barman.server DEBUG: WAL retention policy for server pgsql: MAIN
2020-02-19 02:06:01,939 [21089] barman.server DEBUG: Starting archive-wal for server pgsql
2020-02-19 02:06:01,939 [21089] barman.wal_archiver INFO: No xlog segments found from file archival for pgsql.
2020-02-19 02:06:35,308 [21079] barman.server DEBUG: Check command timed out executing 'PostgreSQL' check
2020-02-19 02:06:35,309 [21079] barman.server ERROR: Check 'check timeout' failed for server 'pgsql'
EN

回答 2

Database Administration用户

发布于 2020-04-11 05:46:00

太棒了,

增加检查超时时间。

in /etc/barman.conf

代码语言:javascript
复制
check_timeout = 60
票数 0
EN

Database Administration用户

发布于 2020-05-27 07:15:33

井。尝试使用barman命令代替固定超时:

代码语言:javascript
复制
barman cron
barman switch-wal 

当向barman备份配置中添加一个新的服务器时,我也面临着同样的问题。这一切都发生了。在检查stackoverlog和barman之后,我注意到如果数据库不是很忙,那么在新的服务器配置期间就不会生成wal(Xlog)。如果数据库很忙,并且生成了wal或xlog,那么这个问题将不会显示。要解决这个问题,您可以让酒保手动询问postgresql服务器交换机wal(xlog)。命令是开关-瓦尔。另外,酒保官需要每分钟都由crond在后援中运行。

希望以上的经验可以帮助你。

如果你喜欢答案,请投赞成票。

票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/259964

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档