Talk:Streaming Replication

From PostgreSQL wiki
Jump to: navigation, search

I had some problems with this guide that I would like to point out in hopes that someone with more knowledge can make the proper corrections/clarifications. If no one acts based on my recommendations, I will make edits to the wiki where I believe I have enough knowledge to genuinely improve the article. Other areas that no one fixes and that I can't fix myself will be sadly ignored.

Firstly, in step 6, the guide says to run these commands:

$ psql -c "SELECT pg_start_backup('label', true)"
$ rsync -a ${PGDATA}/ standby:/srv/pgsql/standby/ --exclude
$ psql -c "SELECT pg_stop_backup()"

I have 2 complaints here: Firstly, the minor complaint of the rsync troubles I incurred. Basically I had issues when using rsync between machines because the postgres user is locked down. As you all know, the solution is to use ssh keys so that you can freely move files without shell interaction and permissions issues. That should AT LEAST be mentioned somewhere in the guide for the real beginners. The rsync issue may affect archiving/backup/etc, so mention the permissions issue at the top or in a footnote(whatever works best). Now onto the real issue with #6.

What the #$%& is /srv/pgsql/standby/  ?

From trial and error, I found that this means the ${PGDATA} directory of the standby. Or hell, maybe it doesn't. But if I backup to the standby's ${PGDATA}, my replication works. When I put it in /srv/pgsql/standby/ nothing happens(duh). So why give this vague backup statement? Fix this with a more detailed explanation or better example statements.


rsync -a ${PGDATA}/ user@standby:${PGDATA}/ --exclude

I guess for now that's all I have. Weird I thought there were more.

TL;DR: Explain postgres permissions and be more verbose about the backup process. Would have saved me tons of time.

postgresql.conf outside PGDATA?

I find this comment to be really strange:

  1. Note that recovery.conf must be in $PGDATA directory.
  2. It should NOT be located in the same directory as postgresql.conf

This effectively means that postgresql.conf must be outside $PGDATA. As far as I know this is impossible, or at least this should be described better than is currently done