Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error from postgresql 9.0 archiving while configuring hot streaming replication

I am trying to get streaming replication running on postgresql 9.0. I am following the steps as mentioned in the link : http://brandonkonkle.com/blog/2010/oct/20/postgres-9-streaming-replication-and-django-balanc/

When I try to execute an archiving command on postgresql, I get warning asking me to wait endlessly. I am executing the commands in the following order:

SELECT pg_start_backup('base_backup');

cd /var/lib/postgresql/9.0/
sudo tar -cjf ~/postgres-data.tar.bz2 main

SELECT pg_stop_backup();

For this I get the following output:

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.

This keeps continuing further and the warning never ends. Please let me know if anyone has faced this issue.

like image 801
Bharath Avatar asked Jan 23 '11 19:01

Bharath


1 Answers

You have set up an archive_command as described in the link you specify? Is it actually copying the xlog files to a safe location correctly? The output from the server suggests that it isn't, and that a backlog is building up inside pg_xlog

I seem to remember that you don't actually need archiving enabled on the server to use it as the master in a replica. You do need to have wal_level set to hot_standby. With that setting in place, your replica can connect to the master to stream xlog records independently of the traditional xlog archiving process. So try setting archive_mode=off.

edit: reading the link in more detail, you need to set archive_mode to create the base backup, which makes sense. so either fix the archive command so that you can take the base backup properly, or take a base backup while the server is stopped.

like image 131
araqnid Avatar answered Oct 21 '22 03:10

araqnid