AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / dba / 问题 / 246650
Accepted
Channa
Channa
Asked: 2019-08-31 06:00:29 +0800 CST2019-08-31 06:00:29 +0800 CST 2019-08-31 06:00:29 +0800 CST

11.5 中的 postgresql recovery.conf 文件位置

  • 772

我是postgres的新手。我们需要对 postgres 数据库进行增量备份,并且我们必须能够执行 PITR。我在互联网上搜索了很多,并试图找出 postgres 11.5 的增量 + PITR 的任何文章引用方法。但是,我找不到太多,发现https://www.scalingpostgres.com/tutorials/postgresql-backup-point-in-time-recovery/

有意义的。我开始解决那里提到的步骤。但是在#add recovery.conf

    # add recovery.conf
    nano /var/lib/postgresql/10/main/recovery.conf 

文章说要在主目录中创建 recovery.conf。但是,根据 11.5 安装,没有主目录。目录结构如下:

    /var/lib/pgsql/11/data
    [root@local-pos-52 data]# ls -ltr
      total 96
      -rw-------. 1 postgres postgres 23971 Aug 30 16:05 postgresql.conf
      drwx------. 6 postgres postgres    50 Aug 30 16:07 base
      -rw-------. 1 postgres postgres  4370 Aug 30 16:12 pg_hba.conf
       drwx------. 2 postgres postgres     6 Aug 30 16:12 pg_replslot
       drwx------. 2 postgres postgres    17 Aug 30 19:04 pg_notify
       -rw-------. 1 postgres postgres    58 Aug 30 19:04 postmaster.opts
       -rw-------. 1 postgres postgres    30 Aug 30 19:04 current_logfiles
        drwx------. 2 postgres postgres     6 Aug 30 19:04 pg_stat
        drwx------. 4 postgres postgres    65 Aug 30 19:04 pg_logical
        drwx------. 3 postgres postgres  4096 Aug 30 19:04 pg_wal
       -rw-------. 1 postgres postgres    96 Aug 30 19:04 postmaster.pid
        drwx------. 2 postgres postgres  4096 Aug 30 19:04 global
        drwx------. 2 postgres postgres    60 Aug 30 19:19 pg_stat_tmp
        -rw-------. 1 postgres postgres     3 Aug 30  2019 PG_VERSION
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_twophase
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_tblspc
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_snapshots
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_serial
        drwx------. 4 postgres postgres    34 Aug 30  2019 pg_multixact
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_dynshmem
        drwx------. 2 postgres postgres     6 Aug 30  2019 pg_commit_ts
        -rw-------. 1 postgres postgres 23891 Aug 30  2019 postgresql.conf- 
       bak
       -rw-------. 1 postgres postgres    88 Aug 30  2019 
       postgresql.auto.conf
       -rw-------. 1 postgres postgres  1636 Aug 30  2019 pg_ident.conf
      -rw-------. 1 postgres postgres  4269 Aug 30  2019 pg_hba.conf-bak
       drwx------. 2 postgres postgres    17 Aug 30  2019 pg_xact
       drwx------. 2 postgres postgres    17 Aug 30  2019 pg_subtrans
       drwx------. 2 postgres postgres    31 Aug 30  2019 log

此外,在此安装中的 /var/lib 位置没有创建名为“postgresql”的文件夹。

我尝试仅在此路径“/var/lib/pgsql/11/data”上创建 recovery.conf。但是,在那之后,当我重新启动 postgres 服务时,它没有工作。

如果有人指定在哪里创建recovery.conf,将不胜感激,以便它实际工作或共享文档/链接以实现增量备份以及postgres 11.5的PITR

提前感谢您的帮助!

postgresql backup
  • 1 1 个回答
  • 2058 Views

1 个回答

  • Voted
  1. Best Answer
    Laurenz Albe
    2019-08-31T06:05:11+08:002019-08-31T06:05:11+08:00

    这就是您通过以下教程获得的。最好了解过程(如文档中所述),这样就不会发生这样的问题。

    你必须放置recovery.conf在数据目录中。数据目录是所在的目录postgresql.conf,除非data_directory参数中的说明postgresql.conf不同。

    • 1

相关问题

  • 运行时间偏移延迟复制的最佳实践

  • Oracle 中的数据库备份 - 导出数据库还是使用其他工具?

  • 存储过程可以防止 SQL 注入吗?

  • PostgreSQL 中 UniProt 的生物序列

  • PostgreSQL 9.0 Replication 和 Slony-I 有什么区别?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目

    • 12 个回答
  • Marko Smith

    如何让sqlplus的输出出现在一行中?

    • 3 个回答
  • Marko Smith

    选择具有最大日期或最晚日期的日期

    • 3 个回答
  • Marko Smith

    如何列出 PostgreSQL 中的所有模式?

    • 4 个回答
  • Marko Smith

    列出指定表的所有列

    • 5 个回答
  • Marko Smith

    如何在不修改我自己的 tnsnames.ora 的情况下使用 sqlplus 连接到位于另一台主机上的 Oracle 数据库

    • 4 个回答
  • Marko Smith

    你如何mysqldump特定的表?

    • 4 个回答
  • Marko Smith

    使用 psql 列出数据库权限

    • 10 个回答
  • Marko Smith

    如何从 PostgreSQL 中的选择查询中将值插入表中?

    • 4 个回答
  • Marko Smith

    如何使用 psql 列出所有数据库和表?

    • 7 个回答
  • Martin Hope
    Jin 连接到 PostgreSQL 服务器:致命:主机没有 pg_hba.conf 条目 2014-12-02 02:54:58 +0800 CST
  • Martin Hope
    Stéphane 如何列出 PostgreSQL 中的所有模式? 2013-04-16 11:19:16 +0800 CST
  • Martin Hope
    Mike Walsh 为什么事务日志不断增长或空间不足? 2012-12-05 18:11:22 +0800 CST
  • Martin Hope
    Stephane Rolland 列出指定表的所有列 2012-08-14 04:44:44 +0800 CST
  • Martin Hope
    haxney MySQL 能否合理地对数十亿行执行查询? 2012-07-03 11:36:13 +0800 CST
  • Martin Hope
    qazwsx 如何监控大型 .sql 文件的导入进度? 2012-05-03 08:54:41 +0800 CST
  • Martin Hope
    markdorison 你如何mysqldump特定的表? 2011-12-17 12:39:37 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 对 SQL 查询进行计时? 2011-06-04 02:22:54 +0800 CST
  • Martin Hope
    Jonas 如何从 PostgreSQL 中的选择查询中将值插入表中? 2011-05-28 00:33:05 +0800 CST
  • Martin Hope
    Jonas 如何使用 psql 列出所有数据库和表? 2011-02-18 00:45:49 +0800 CST

热门标签

sql-server mysql postgresql sql-server-2014 sql-server-2016 oracle sql-server-2008 database-design query-performance sql-server-2017

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve