pg_basebackup恢复:unrecognized configuration parameter "restore_command"
问题描述:2022年最后一个工作日,时间过的真快,一晃又一年过去了,祝愿看到的各位元旦快乐。
使用pg_basebackup进行pg的备份恢复,在恢复的过程中,配置文件添加恢复的参数,一直启动报错。
在postgre.conf和postgres.auto.conf中都添加尝试了。类似下列报错,都启动失败
PG版本:pg_ctl (PostgreSQL) 10.1
LOG: unrecognized configuration parameter "restore_command" in file "/var/lib/postgresql/9.6/main/postgresql.auto.conf" line 5 LOG: unrecognized configuration parameter "recovery_target_name" in file "/var/lib/postgresql/9.6/main/postgresql.auto.conf" line 6 FATAL: configuration file "/var/lib/postgresql/9.6/main/postgresql.auto.conf" contains errors
$ pg_ctl -D /u01/app/pgsql/data start waiting for server to start....2022-06-01 17:42:41.472 GMT [7645] LOG: unrecognized configuration parameter "restore_command" in file "/u01/app/pgsql/11/data/postgresql.conf" line 64 2022-06-01 17:42:41.472 GMT [7645] LOG: unrecognized configuration parameter "recovery_target_timeline" in file "/u01/app/pgsql/data/postgresql.conf" line 65 2022-06-01 17:42:41.472 GMT [7645] FATAL: configuration file "/u01/app/pgsql/11/data/postgresql.conf" contains errors stopped waiting
后来更换了pg版本,换成(PostgreSQL) 13.6,跟10的版本区别就是13的postgres.conf文件中可以找到相关的恢复参数,但是被注释掉了,10的postgres.conf文件中就没有相关的参数,不支持相关的恢复参数。
而且postgres.auto.conf上边系统给到的注释,就是不要手动去编辑这个文件,他会在alter system command命令中生成配置。
但是很多恢复文档都是直接去修改这个文件,没有测试,不知道原理是什么。
# vim postgres.conf
基于时间线恢复
基于备份点恢复
基于时间点进行恢复
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?