【问题标题】:Postgres FATAL: hot standby is not possible because wal_level was not set to "replica" or higher on the master serverPostgres FATAL:无法进行热备用,因为主服务器上的 wal_level 未设置为“副本”或更高
【发布时间】:2020-03-16 22:03:37
【问题描述】:

我在 Linux 两个节点上配置 postgres 9.6(1 个主节点,另一个是从节点) https://www.howtoforge.com/tutorial/how-to-install-and-configure-master-slave-replication-with-postgresql-96-on-centos-7/

按照上面的注释做了所有配置,主节点在注释配置后运行,

但是在我启动从节点时在从节点配置表单给出注释后,在从节点的日志中收到以下消息:

< 2020-03-17 01:12:07.408 +04 > LOG:  database system was interrupted while in recovery at log time 2020-03-17 00:37:30 +04
< 2020-03-17 01:12:07.408 +04 > HINT:  If this has occurred more than once some data might be corrupted and you might need to choose an earlier recovery target.
< 2020-03-17 01:12:07.420 +04 > LOG:  entering standby mode
< 2020-03-17 01:12:07.422 +04 > WARNING:  WAL was generated with wal_level=minimal, data may be missing
< 2020-03-17 01:12:07.422 +04 > HINT:  This happens if you temporarily set wal_level=minimal without taking a new base backup.
< 2020-03-17 01:12:07.422 +04 > FATAL:  hot standby is not possible because wal_level was not set to "replica" or higher on the master server
< 2020-03-17 01:12:07.422 +04 > HINT:  Either set wal_level to "replica" on the master, or turn off hot_standby here.
< 2020-03-17 01:12:07.423 +04 > LOG:  startup process (PID 20755) exited with exit code 1
< 2020-03-17 01:12:07.423 +04 > LOG:  aborting startup due to startup process failure
< 2020-03-17 01:12:07.425 +04 > LOG:  database system is shut down

对 postgres 很陌生,想知道我是否遗漏了某些东西,或者我关注的笔记遗漏了某些东西。

谷歌了一些,但不幸的是找不到任何东西。

【问题讨论】:

  • 在主服务器上运行 show wal_level; 会给您带来什么?
  • 感谢您的快速响应:master 的输出是:-bash-4.2$ psql -c "show wal_level;" wal_level ----------- 副本(1 行)
  • 专家您好,请对我所面临的问题有任何帮助。无法克服它。

标签: postgresql postgresql-9.6


【解决方案1】:

在您进行基本备份时,wal_level 必须设置为副本或更高。看起来您将 wal_level 更改为副本为时已晚。扔掉你的旧副本并再次运行 pg_basebackup。

您为什么使用 9.6?如果您只是第一次设置,您应该使用最新的稳定版本 12。

【讨论】:

  • 你好 J,postgres 版本 12 是否适用于 linux,因为使用下面的 url 显示 postgres 10 是适用于 linux 的最高版本,我决定发布 - 1,
  • 从该页面,“请注意:EDB 不再为 PostgreSQL 11 及更高版本提供 Linux 安装程序,鼓励用户使用平台原生包”。我从没想过首先使用 Linux 的 EDB 安装程序,也许他们停止使用它们是因为没有多少其他人这样做。我改为使用 yum 或 apt,可能会将它们指向 PostgreSQL 自己的存储库。
猜你喜欢
  • 2021-01-03
  • 2022-11-24
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-05-05
  • 2018-03-15
相关资源
最近更新 更多