无法在 PostgreSQL 中以特定时间执行 PITRU
Can not do PITR with specific time in PotgreSQL
我正在使用以下设置执行 PITR 并收到如下错误。
archive_command = 'test ! -f /usr/wal_archive/%f && cp %p /usr/wal_archive/%f'
restore_command = 'cp /usr/wal_archive/%f "%p"'
recovery_target_time = '2020-12-09 15:20:00.0'
recovery_target_timeline = 'latest'
错误:
2020-12-09 17:43:43.029 IST [39613] LOG: invalid checkpoint record
2020-12-09 17:43:43.029 IST [39613] FATAL: could not locate required checkpoint record
2020-12-09 17:43:43.029 IST [39613] HINT: If you are restoring from a backup, touch "/var/lib/postgresql/12/main/recovery.signal" and add required recovery options. If you are not restoring from a backup, try removing the file "/var/lib/postgresql/12/main/backup_label". Be careful: removing "/var/lib/postgresql/12/main/backup_label" will result in a corrupt cluster if restoring from a backup.
2020-12-09 17:43:43.030 IST [39612] LOG: startup process (PID 39613) exited with exit code 1
2020-12-09 17:43:43.030 IST [39612] LOG: aborting startup due to startup process failure
2020-12-09 17:43:43.031 IST [39612] LOG: database system is shut down pg_ctl: could not start server Examine the log output.`
有什么提示吗?
如果所有内容都在 the documentation 中详细说明,为什么人们会阅读博客?
- Set recovery configuration settings in
postgresql.conf
(see Section 19.5.4) and create a file recovery.signal
in the cluster data directory. You might also want to temporarily modify pg_hba.conf
to prevent ordinary users from connecting until you are sure the recovery was successful.
我正在使用以下设置执行 PITR 并收到如下错误。
archive_command = 'test ! -f /usr/wal_archive/%f && cp %p /usr/wal_archive/%f'
restore_command = 'cp /usr/wal_archive/%f "%p"'
recovery_target_time = '2020-12-09 15:20:00.0'
recovery_target_timeline = 'latest'
错误:
2020-12-09 17:43:43.029 IST [39613] LOG: invalid checkpoint record
2020-12-09 17:43:43.029 IST [39613] FATAL: could not locate required checkpoint record
2020-12-09 17:43:43.029 IST [39613] HINT: If you are restoring from a backup, touch "/var/lib/postgresql/12/main/recovery.signal" and add required recovery options. If you are not restoring from a backup, try removing the file "/var/lib/postgresql/12/main/backup_label". Be careful: removing "/var/lib/postgresql/12/main/backup_label" will result in a corrupt cluster if restoring from a backup.
2020-12-09 17:43:43.030 IST [39612] LOG: startup process (PID 39613) exited with exit code 1
2020-12-09 17:43:43.030 IST [39612] LOG: aborting startup due to startup process failure
2020-12-09 17:43:43.031 IST [39612] LOG: database system is shut down pg_ctl: could not start server Examine the log output.`
有什么提示吗?
如果所有内容都在 the documentation 中详细说明,为什么人们会阅读博客?
- Set recovery configuration settings in
postgresql.conf
(see Section 19.5.4) and create a filerecovery.signal
in the cluster data directory. You might also want to temporarily modifypg_hba.conf
to prevent ordinary users from connecting until you are sure the recovery was successful.