Linux

barman + postgresql 在 barman 恢復後無法啟動

  • August 6, 2017

我使用調酒師 ( http://www.pgbarman.org/ ) 在我的 linux redhat 機器上進行備份和恢復

恢復後,我們啟動 postgresql 如下

systemctl start postgresql.service

但是postgresql沒有啟動

從日誌:

 /var/lib/pgsql/backups/data/pg_log

我們看到以下錯誤

requested recovery stop point is before consistent recovery point

請指教這個致命錯誤的含義是什麼?

more pg_log


LOG:  database system was interrupted; last known up at 2017-08-06 07:30:49 UTC
LOG:  restored log file "00000008.history" from archive
LOG:  starting point-in-time recovery to 2017-08-06 07:30:49.813508+00
LOG:  restored log file "0000000800000000000000C1" from archive
LOG:  redo starts at 0/C1000080
LOG:  recovery stopping before commit of transaction 96139, time 2017-08-06 07:30:49.855629+00
LOG:  redo done at 0/C1001B90
FATAL:  requested recovery stop point is before consistent recovery point
LOG:  startup process (PID 55858) exited with exit code 1
LOG:  terminating any other active server processes

範例 - 當我啟動 postgres 服務時:

 systemctl start postgresql.service
 Job for postgresql.service failed because the control process exited with 
 error code. See "systemctl status postgresql.service" and "journalctl -xe" 
 for details.


 ls
 backup_label.old     pg_hba.conf                   pg_hba.conf.2017-08-
 03_13:08  pg_snapshots  pg_xlog                           
 postgresql.conf.2017-08-03_13:03
 barman_xlog          pg_hba.conf.2017-08-03_12:07  pg_ident.conf                 
 pg_stat_tmp   postgresql.conf                   postgresql.conf.2017-08-
 03_13:08
 base                 pg_hba.conf.2017-08-03_12:22  pg_log                        
 pg_subtrans   postgresql.conf.2017-08-03_12:07  postgresql.conf.origin
 global               pg_hba.conf.2017-08-03_12:24  pg_multixact                  
 pg_tblspc     postgresql.conf.2017-08-03_12:22  postmaster.opts
 pg_clog              pg_hba.conf.2017-08-03_12:28  pg_notify                     
 pg_twophase   postgresql.conf.2017-08-03_12:24  recovery.done
 pg_hba_bak.conf.old  pg_hba.conf.2017-08-03_13:03  pg_serial                     
 PG_VERSION    postgresql.conf.2017-08-03_12:28

recover.conf恢復後忘記刪除文件。

只有 PiTR 需要此文件,正常 DB 操作不需要此文件。解決方案是簡單地刪除它。

引用自:https://serverfault.com/questions/867100