FATAL: hot standby is not possible because max_connections = 100 is a lower setting than on the master server (its value was 500) FATAL: hot standby is not possible because max_prepared_transactions = 0 is a lower setting than on the master server (its value was 50)
当所有的归档WAL恢复完毕,无法读取到其他更新的归档日志后,恢复就会自动结束,并且recovery.conf会被更名为recovery.done,防止意外重新进入restore过程。 恢复完毕后,可以允许客户端连接到服务器。 注意,恢复的最后阶段,日志中会出现No such file or directory字样的提示,这是正常的,因为恢复过程已经无法读取到其他的归档日志文件或时间线history文件。
1 2 3 4 5 6 7 8 9 10 11 12
2015-12-0709:24:42 CST \[4906-5\] LOG: consistent recovery state reached at 1/86008798 cp: cannot stat ‘/var/backups/postgresql/archive/000000010000000100000087’: No such file or directory 2015-12-0709:24:42 CST \[4906-6\] LOG: redo done at 1/86008798 2015-12-0709:24:42 CST \[4906-7\] LOG: last completed transaction was at log time 2015-12-0708:57:51.075265+08 2015-12-0709:24:42 CST \[4906-8\] LOG: restored log file "000000010000000100000086"from archive cp: cannot stat ‘/var/backups/postgresql/archive/00000002.history’: No such file or directory 2015-12-0709:24:42 CST \[4906-9\] LOG: selected new timeline ID: 2 cp: cannot stat ‘/var/backups/postgresql/archive/00000001.history’: No such file or directory 2015-12-0709:24:42 CST \[4906-10\] LOG: archive recovery complete 2015-12-0709:24:42 CST \[4906-11\] LOG: MultiXact member wraparound protections are now enabled 2015-12-0709:24:42 CST \[4924-1\] LOG: autovacuum launcher started 2015-12-0709:24:42 CST \[4905-1\] LOG: database system is ready to accept connections
postgres=# select name, setting from pg_catalog.pg_settings where name like 'archive%' or name = 'wal_level'; name setting -----------------+--------------------------------------------------------------------------- archive_command ssh node5 test ! -f /var/backups/postgresql/archive/%f && scp %p node5:/var/backups/postgresql/archive/%f archive_mode on archive_timeout 0 wal_level archive (4 rows)