需要检查 Postgres 备份

Need to check Postgres backups

最近,我们接到了支持 Postgres 数据库的需求。我来自 NoSql 背景,这是我第一次接触 postgres。我们获得了服务器名称和对 Postgres 用户的 sudo 访问权限。要求是使服务器具有高可用性并熟悉数据库。我能够登录到服务器并能够使用 psql interactive shell (\l) 和用户 (\du) 查看数据库。我有几个问题。

  1. 我的任务是创建一个具有基本权限的用户进行基本监控,我使用下面的方法创建了

    -bash-4.2$ createuser --interactive joe
    Shall the new role be a superuser? (y/n) n
    Shall the new role be allowed to create databases? (y/n) n
    Shall the new role be allowed to create more new roles? (y/n) n
    Password:
    -bash-4.2$ psql
    Password:
    psql (9.4.15)
    Type "help" for help.
    
  2. 我需要检查是否安排了数据库备份。谁能指导我如何检查?

  3. 我还需要创建服务器的高可用性。我的计划是我将在另一台服务器上安装 Postgres,并将备份所有数据库并将其恢复到该新服务器中。我要关注的link是http://www.postgresqltutorial.com/postgresql-copy-database/.

给我一些建议

都是好问题!

#1 监控用户

看来您掌握了基本知识。不确定您的用户是否需要比这更多的权限。

#2 是否安排了备份

您将在 Postgres 之外工作以安排备份。它通常通过使用 cron (Unix) 或任务计划程序 (windows) 来启动 pg_dump 作业来完成。

#3 高可用性

将数据库复制到另一个位置很好(我会这样做,然后在那里玩 "get familiar with the database"),但这不是高可用性。在网络上搜索 "Postgresql Streaming Replication",您会找到大量有关如何执行此操作的教程。

哦,您可能想在网络上搜索 "postgresql when it's not your job" 以找到关于 Postgres DBA 入门的精彩介绍。