标签: barman

WAL 存档:失败(请确保 WAL 运输已设置)

我正在尝试将 Barman 配置为备份。当我做一个barman check replica我不断得到:

Server replica:
WAL archive: FAILED (please make sure WAL shipping is setup)
PostgreSQL: OK
superuser: OK
wal_level: OK
directories: OK
retention policy settings: OK
backup maximum age: FAILED (interval provided: 1 day, latest backup age: No available backups)
compression settings: OK
failed backups: OK (there are 0 failed backups)
minimum redundancy requirements: FAILED (have 0 backups, expected at least 2)
ssh: OK (PostgreSQL server)
not in recovery: FAILED (cannot perform exclusive backup on …
Run Code Online (Sandbox Code Playgroud)

postgresql barman postgresql-9.6

6
推荐指数
1
解决办法
1万
查看次数

无法通过酒保接收 WAL 文件

我一直在挠头解决以下错误,但没有取得太大进展:

$ barman switch-wal --force --archive --archive-timeout 180 pg

The WAL file 0000000100000059000000FF has been closed on server 'pg'
Waiting for the WAL file 0000000100000059000000FF from server 'pg' (max: 180 seconds)
ERROR: The WAL file 0000000100000059000000FF has not been received in 180 seconds
Run Code Online (Sandbox Code Playgroud)

我之前在一次性 VPS 上配置了酒保,一切正常。但是当我尝试在我们最终的 EC2 实例上复制它时,我遇到了上面提到的问题。我确保了以下内容(即使我不记得在 VPS 上这样做过):

  • 来自酒保的 SSH => pg 正在工作
  • 来自 pg 的 SSH => barman 正在工作
  • “pg”上的所有防火墙规则都已暂时禁用

这里可能是什么问题?

编辑:添加输出barman check pg

Server pg:
2017-12-08 05:56:31,841 [14559] barman.server ERROR: Check 'WAL archive' failed …
Run Code Online (Sandbox Code Playgroud)

postgresql backup write-ahead-logging barman pg-basebackup

5
推荐指数
1
解决办法
9234
查看次数

是否可以在不停机的情况下迁移 postgresql 数据库?

我的 Centos 上有一个 Postgresql 数据库,我使用 barman 来备份我的数据库,我的问题是是否可以在不停机的情况下将我的数据库迁移到另一台服务器?我知道一些使用 pg_start_backup() 停机时间较短的解决方案,酒保也可以处理它,但是有没有办法在没有停机时间的情况下做到这一点?还有一个问题是,迁移它的最佳方式是什么?

postgresql migration barman

3
推荐指数
1
解决办法
5478
查看次数

酒保无法连接:fe_sendauth:未提供密码

我正在尝试设置到酒保服务器的流复制。

酒保配置非常基本,我正在使用backup_method = postgres.

[barman]
barman_home = /var/lib/barman
barman_user = barman
log_file = /var/log/barman/barman.log
log_level = DEBUG
archiver = true
backup_method = postgres
backup_options = concurrent_backup
compression = gzip
minimum_redundancy = 1
retention_policy = RECOVERY WINDOW OF 7 DAYS
retention_policy_mode = auto
streaming_archiver = true
wal_retention_policy = main
configuration_files_directory = /etc/barman.conf.d
Run Code Online (Sandbox Code Playgroud)

我会调用数据库服务器pg

[pg]
description = "pg"
ssh_command = ssh postgres@pg.example.com
conninfo = user=barman dbname=postgres host=pg.example.com port=5432
Run Code Online (Sandbox Code Playgroud)

我已经配置了 hba 规则并在's home中设置了一个.pgpass文件。barman/var/lib/barman/.pgpass

与服务器的测试连接pg工作正常: …

postgresql backup barman

2
推荐指数
1
解决办法
3505
查看次数

为了减少恢复时间(并节省空间):使用 Barman 备份时是否可以忽略某些 PostgreSQL 13 表(或模式)?

我们的 PostgreSQL 数据库之一中有一些大型临时表/临时表。其中的数据可以在数据库恢复后从其他数据库自动重新生成,并且不是业务关键型数据。使用 Barman 备份时有没有办法忽略这些表?它们都在一个模式中。

这是为了减少恢复时间并节省空间。

也许我们可以使用某种持久临时表?表空间?

我们有这些表是因为我们做 ETL 时很方便。但不被任何应用程序或客户端使用。

还有其他替代方法可以做类似的事情吗?


我读过的一些文档:

https://www.pgbarman.org/index.html

http://docs.pgbarman.org/release/2.12/

postgresql backup barman

2
推荐指数
1
解决办法
330
查看次数

运行 pg_resetxlog 后 PostgreSQL 损坏

我们在 Ubuntu 14.04 上使用 PostgreSQL 9.3 版。这个 PostgreSQL 服务器在我们所有的应用服务器 (Odoo) 之间共享,所以我们让它在单独的环境中运行。

星期六,我们在此数据库服务器上发现磁盘已满问题。在我们进一步调查中,我们发现备份服务器(酒保)已关闭。因此所有存档日志都保留在数据库服务器上。这占用了整个磁盘。我们的数据库备份服务器可能在一个月前停止工作。

通过谷歌搜索,我们找到了一个解决方案,即通过重置 pg_xlog 文件来解决这个问题。所以我们使用 pg_restxlog 命令清理日志文件。正如论坛所说,磁盘已清除,我们重新启动了服务器。但是没有找到数据库:-(。我们使用 psql - list 命令列出。到目前为止没有任何效果。我们也无法从酒保恢复备份。然后我们继续调查,我们发现所有数据都在基本文件夹下保持安全Postgres 的主要数据路径。

我们执行重置日志的步骤如下。

  1. 尝试停止数据库服务器

    须藤服务 postgresql 停止

  2. 以 Postgres 用户身份登录

    须藤 su - postgres

  3. 运行重置命令。

    /usr/lib/postgresql/9.3/bin/pg_resetxlog -f /var/lib/postgresql/9.3/main/

  4. 禁用 postgres.conf 文件中的酒保配置以停止备份过程一段时间。

  5. 并重启服务器

/var/lib/postgresql/9.3/main/的文件内容

postgres@server2:~$ du -h 9.3/main/
12K     9.3/main/pg_notify
28M     9.3/main/base/2735749
73M     9.3/main/base/4172290
46M     9.3/main/base/4410494
81M     9.3/main/base/3002089
43M     9.3/main/base/4282962
47M     9.3/main/base/3377227
130M    9.3/main/base/4098067
44M     9.3/main/base/1682791
58M     9.3/main/base/3377231
4.0K    9.3/main/base/pgsql_tmp
6.1M    9.3/main/base/12030
41M     9.3/main/base/4280118
54M     9.3/main/base/3149391
45M     9.3/main/base/4202614
49M     9.3/main/base/3344071
45M …
Run Code Online (Sandbox Code Playgroud)

postgresql postgresql-9.3 barman

0
推荐指数
1
解决办法
2842
查看次数