Solved

creating standby Postgresql database server using WAL

Posted on 2009-04-10
4
640 Views
Last Modified: 2012-05-06
I have two identical Cent OS 5.3 computers configured identically with Postgresql 8.3.7.  I'm trying to create a warm standby using WAL following the instructions at:

http://www.postgresql.org/docs/current/static/warm-standby.html

Both servers have access to the directory /path/to/archive

I configured postgresql.conf on the master server with:

archive_mode = on
archive_command = 'cp "%p" /path/to/archive/"%f"'
arvhice_timeout = 300

Then restarted postgresql.  Then I logged into the database "psql db" and created the base backup "SELECT pg_start_backup('label');"  After that was done, I issued the "SELECT pg_stop_backup();" command.  This created the backup file in "/path/to/archive".  

Then on the slave postgresql server, I shut down the database, and created the recovery.conf file with

restore_command = 'cp /path/to/archive/%f %p'


When I try to restart postgresql on the slave, I get an error.  What am I doing wrong?
0
Comment
Question by:philjones85
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 22

Expert Comment

by:earth man2
ID: 24121655
The restore command is more  complex than a simple copy.
see docs
http://www.postgresql.org/docs/8.3/static/warm-standby.html
24.4.1
"A working example of a waiting restore_command is provided as a contrib module named pg_standby. This example can be extended as needed to support specific configurations or environments."
0
 
LVL 22

Expert Comment

by:earth man2
ID: 24123136
do you know what the error message is ?
0
 
LVL 6

Author Comment

by:philjones85
ID: 24130668
The error message is:
cp cannot stat '/path/to/archive/00000001.history': No such file or directory

This file doesn't exist, but it isn't created in the backup process.

And I realize the restore command is more complex than that, I'm just trying to do a single manual restore first, then I'll add the more complex automation.
0
 
LVL 6

Accepted Solution

by:
philjones85 earned 0 total points
ID: 24229278
I realize the step I missed was copying the data directory from the primary database server to the backup server before trying to "recover".  What I was trying to do was initially load both databases the exact same way and then start reading WAL files from the 1st on the 2nd.  This obviously didn't work...  This question can be closed now.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
Steps to create a PostgreSQL RDS instance in the Amazon cloud. We will cover some of the default settings and show how to connect to the instance once it is up and running.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question