Unix Technical Forum

warm standby issues

This is a discussion on warm standby issues within the pgsql Admins forums, part of the PostgreSQL category; --> Hi List; I'm setting up a warm standby server on version 8.1.9 I setup a recovery.sh script to keep ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-29-2008, 09:29 PM
kevin kempter
 
Posts: n/a
Default warm standby issues

Hi List;

I'm setting up a warm standby server on version 8.1.9

I setup a recovery.sh script to keep the standby cluster in recovery
mode waiting for the next WAL segment. everything works fine as long
as the standby server is in recovery mode. I see the recovery taking
place in the postgres log of the standby server. I've set it up to
exit the recovery.sh script if it see's a trigger file (to bring the
standby online).

when I create the trigger file I see this:

copy /home/postgres/healthCareCoding/WAL/000000010000000000000004
pg_xlog/RECOVERYXLOG
`/home/postgres/healthCareCoding/WAL/000000010000000000000004' ->
`pg_xlog/RECOVERYXLOG'
LOG: restored log file "000000010000000000000004" from archive
LOG: could not open file "pg_xlog/000000010000000000000005" (log file
0, segment 5): No such file or directory
LOG: redo done at 0/4FFFE90
PANIC: could not open file "pg_xlog/000000010000000000000004" (log
file 0, segment 4): No such file or directory
LOG: startup process (PID 9348) was terminated by signal 6
LOG: aborting startup due to startup process failure
LOG: logger shutting down


I see that the log 000000010000000000000004 was restored, but then
when it tags the redo as done it complains that it cannot find the
same log.

If I re-start the standby cluster and select count(*) from my test
table (the table I'm inserting data into to fill the logs) I get this:

postgres=# select count(*) from t1 ;
ERROR: xlog flush request 0/113730C is not satisfied --- flushed only
to 0/1135018
CONTEXT: writing block 1500 of relation 1663/10819/16384
postgres=#



My recovery.sh code is below, thanks in advance for any help...

/Kevin




#!/bin/bash

#DELAY=400000
DELAY=100
SEG_SIZE=16777216
TRIGGERED=0
TRIGGER_FILE="/home/postgres/healthCareCoding/trigger"
WAL_PATH="/home/postgres/healthCareCoding/WAL"
COPY_FLAG=0
RESTORE_FROM="${WAL_PATH}/$2"
RESTORE_TO=$1


echo "$1" | grep -i history
if [ $? -eq 0 ]
then
if [ -f "$RESTORE_FROM" ]
then
echo "copy $RESTORE_FROM $RESTORE_TO"
cp -v -i $RESTORE_FROM $RESTORE_TO
fi
exit
fi

while [ ! -f "$TRIGGER_FILE" -a $COPY_FLAG -eq 0 ]
do
usleep $DELAY;
if [ -f "$RESTORE_FROM" ]
then
fs=`ls -l $RESTORE_FROM`
set - $fs
echo "size= [$5]"
if [ "$5" == "$SEG_SIZE" ]
then
COPY_FLAG=1
fi
fi
done

if [ -f "$TRIGGER_FILE" ]
then
exit
fi

if [ ! -f "$TRIGGER_FILE" ]
then
echo "copy $RESTORE_FROM $RESTORE_TO"
cp -v -i $RESTORE_FROM $RESTORE_TO
exit
fi



--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 09:29 PM
Charles Duffy
 
Posts: n/a
Default Re: warm standby issues

Hi Kevin,

On Mon, Apr 28, 2008 at 7:34 AM, kevin kempter
<kevin@kevinkempterllc.com> wrote:
> Hi List;
>
> I'm setting up a warm standby server on version 8.1.9
>


I didn't think 8.1 supported warm-standby...

> I setup a recovery.sh script to keep the standby cluster in recovery mode
> waiting for the next WAL segment. everything works fine as long as the
> standby server is in recovery mode. I see the recovery taking place in the
> postgres log of the standby server. I've set it up to exit the recovery.sh
> script if it see's a trigger file (to bring the standby online).
>
> when I create the trigger file I see this:
>
> copy /home/postgres/healthCareCoding/WAL/000000010000000000000004
> pg_xlog/RECOVERYXLOG


Try with 8.2 or above, and see if that makes your problem go away. Use
pg_standby instead of shell scripts.

Thanks,

Charles Duffy

--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-29-2008, 09:29 PM
Julio Leyva
 
Posts: n/a
Default Re: warm standby issues

I have setup this feature using postgresql 8.3.1 on a suse linux version and pg_standby as a recovery script, works very good and I use rsync as ascript to ship logs

This is my configuration in the primary D.B


archive_mode = on
archive_command = 'rsync -atz %p backup:/data01/wal_files/%f'
archive_timeout = 60

This is the recovery.conf in the backup server
restore_command = 'pg_standby -l /data01/wal_files %f %p %r -t /tmp/pgsql..trigger.5432 2>>/tmp/standby.log'


Hope this help you



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:42 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com