The master and slave servers are set up as per the tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-master-slave-replication-on-postgresql-on-an-ubuntu-12-04-vps and both servers are Ubuntu 12.04 x64 and are running PostgreSQL 9.1
below are the commands I am running and the errors I am getting, any help will be appreciated.
$ sudo su - postgres
$ psql -c "select pg_start_backup('initial_backup');"
$ rsync -cva --inplace --exclude=*pg_xlog* /var/lib/postgresql/9.1/main/ MAS.TER.SER.VER:/var/lib/postgresql/9.1/main/
$ psql -c "select pg_stop_backup();"
$ psql -c "select pg_stop_backup();"
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 canceled 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 canceled safely, but the database backup will not be usable without all the WAL segments.
^CCancel request sent
ERROR: canceling statement due to user request
After running the above on the master I then set up the recovery.conf as per the tutorial and attempt to start the slave server.
$ sudo su - postgres
$ nano /etc/postgresql/9.1/main/recovery.conf
Edit as per tutorial
$ service postgresql start
* Starting PostgreSQL 9.1 database server * Removed stale pid file.
The PostgreSQL server failed to start. Please check the log output:
2014-07-21 22:31:12 BST LOG: database system was interrupted; last known up at 2014-07-21 22:21:43 BST
2014-07-21 22:31:12 BST LOG: could not open file "pg_xlog/000000010000000000000018" (log file 0, segment 24): No such file or directory
2014-07-21 22:31:12 BST LOG: invalid checkpoint record
2014-07-21 22:31:12 BST FATAL: could not locate required checkpoint record
2014-07-21 22:31:12 BST HINT: If you are not restoring from a backup, try removing the file "/var/lib/postgresql/9.1/main/backup_label".
2014-07-21 22:31:12 BST LOG: startup process (PID 8274) exited with exit code 1
2014-07-21 22:31:12 BST LOG: aborting startup due to startup process failure
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
In the command:
rsync -cva --inplace --exclude=*pg_xlog* /var/lib/postgresql/9.1/main/ MAS.TER.SER.VER:/var/lib/postgresql/9.1/main/
I assume MAS.TER.SER.VER is the IP address of the master postgres server? If so, that should actually be the IP of the slave server.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.