Bha*_*ath 6 postgresql streaming scalability archiving database-replication
我试图在postgresql 9.0上运行流复制.我按照链接中提到的步骤进行操作:http://brandonkonkle.com/blog/2010/oct/20/postgres-9-streaming-replication-and-django-balanc/
当我尝试在postgresql上执行归档命令时,我收到警告,要求我无休止地等待.我按以下顺序执行命令:
SELECT pg_start_backup('base_backup');
cd /var/lib/postgresql/9.0/
sudo tar -cjf ~/postgres-data.tar.bz2 main
SELECT pg_stop_backup();
Run Code Online (Sandbox Code Playgroud)
为此,我得到以下输出:
NOTICE: pg_stop_backup cleanup done, waiting for required WAL segments to be archived
WARNING: pg_stop_backup still waiting for all required WAL segments to be archived (60 seconds elapsed)
HINT: Check that your archive_command is executing properly. pg_stop_backup can be cancelled safely, but the database backup will not be usable without all the WAL segments.
WARNING: pg_stop_backup still waiting for all required WAL segments to be archived (120 seconds elapsed)
HINT: Check that your archive_command is executing properly. pg_stop_backup can be cancelled safely, but the database backup will not be usable without all the WAL segments.
Run Code Online (Sandbox Code Playgroud)
这继续保持下去,警告永远不会结束.如果有人遇到这个问题,请告诉我.
archive_command您是否已按照您指定的链接中的描述设置了?它实际上是否正确地将 xlog 文件复制到安全位置?服务器的输出表明事实并非如此,并且内部正在积压pg_xlog
我似乎记得您实际上并不需要在服务器上启用存档才能将其用作副本中的主服务器。您确实需要wal_level设置为hot_standby。完成该设置后,您的副本可以连接到主服务器以独立于传统的 xlog 归档过程来传输 xlog 记录。所以尝试设置archive_mode=off.
编辑:更详细地阅读链接,您需要设置 archive_mode 来创建基本备份,这是有意义的。因此,要么修复存档命令,以便您可以正确进行基本备份,要么在服务器停止时进行基本备份。