pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Warm standby
3+ messages / 3 participants
[nested] [flat]

* Warm standby
@ 2007-02-27 08:34 Johann Spies <jspies@sun.ac.za>
  0 siblings, 0 replies; 3+ messages in thread

From: Johann Spies @ 2007-02-27 08:34 UTC (permalink / raw)
  To: pgsql-admin

I want to setup a form of replication for postgresql using the warm
standby option
(http://www.postgresql.org/docs/8.2/static/warm-standby.html)

I have had success to let server A to copy the WAL logs to server B (the
standby server).  But I have had no success on the recovery side of
things. I might just be overlooking something.  You help will be
appreciated.

I have the following in the /etc/postgresql/8.2/main/recovery.conf on
server B:

restore_command = '/var/lib/postgresql/8.2/main/restore.sh /var/lib/postgresql/8.2/main/wal/%f "%p"'

and  /var/lib/postgresql/8.2/main/restore.sh looks like this:


#!/bin/bash

RESTORE_FROM=$1
RESTORE_TO=$2
DELAY=100000
TRIGGERED=0
TRIGGER_FILE="/var/lib/postgresql/8.2/main/trigger"

copyfunc() {
if [ "$TRIGGERED" -eq "0" ]; then
	cp -v -i $RESTORE_FROM $RESTORE_TO
fi
}

k=`expr $1 : '.*\(history\)'`

if [ "$k" == "history" ]; then
copyfunc;
exit $?;
fi	

while [ ! -f "$RESTORE_FROM" -a "$TRIGGERED" -eq "0" ]; do
		usleep $DELAY;
		if [ -e $TRIGGER_FILE ]; then
			TRIGGERED=1;	
		fi
done

copyfunc;

This was adapted from a howto at 
http://www.postgresql.org/docs/8.2/static/warm-standby.html

The content of /var/lib/postgresql/8.2/main/wal/ looks like this:

$ ls wal
000000010000000000000000  00000001000000000000000E  00000001000000000000001C
000000010000000000000001  00000001000000000000000F  00000001000000000000001D
000000010000000000000002  000000010000000000000010  00000001000000000000001E
000000010000000000000003  000000010000000000000011  00000001000000000000001F
000000010000000000000004  000000010000000000000012  000000010000000000000020
000000010000000000000005  000000010000000000000013  000000010000000000000021
000000010000000000000006  000000010000000000000014  000000010000000000000022
000000010000000000000007  000000010000000000000015  000000010000000000000023
000000010000000000000008  000000010000000000000016  000000010000000000000024
000000010000000000000009  000000010000000000000017  000000010000000000000025
00000001000000000000000A  000000010000000000000018  000000010000000000000026
00000001000000000000000B  000000010000000000000019  000000010000000000000027
00000001000000000000000C  00000001000000000000001A  000000010000000000000028
00000001000000000000000D  00000001000000000000001B


And the postgresql-log shows:



2007-02-26 15:58:54 SAST LOG:  database system was shut down at 2007-02-26 15:58:53 SAST
2007-02-26 15:58:54 SAST LOG:  checkpoint record is at 0/42C9BC
2007-02-26 15:58:54 SAST LOG:  redo record is at 0/42C9BC; undo record is at 0/0; shutdown TRUE
2007-02-26 15:58:54 SAST LOG:  next transaction ID: 0/1098; next OID: 16385
2007-02-26 15:58:54 SAST LOG:  next MultiXactId: 1; next MultiXactOffset: 0
2007-02-26 15:58:54 SAST LOG:  database system is ready
2007-02-26 15:58:55 SAST LOG:  incomplete startup packet

It does not seem to do anything about the WAL logs from the other
server.

What am I missing?

Regards
Johann
-- 
Johann Spies          Telefoon: 021-808 4036
Informasietegnologie, Universiteit van Stellenbosch

     "If we confess our sins, he is faithful and just to 
      forgive us our sins, and to cleanse us from all  
      unrighteousness."       I John 1:9 



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* warm standby
@ 2008-11-28 19:22 Mark Steben <msteben@autorevenue.com>
  2008-11-28 19:37 ` Re: warm standby Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Mark Steben @ 2008-11-28 19:22 UTC (permalink / raw)
  To: pgsql-admin

I'm attempting a warm standby setup.  I'm running Postgres 8.3 on both
master and slave.

Unfortunately the master is a 32 bit machine and the slave is a 64 bit
machine.  Both running

Linux Redhat.  After I bring in the master base file copy into the slave and
attempt to

Start postgres I get an 'incorrect checksum' error.  I begin researching.
Am I correct

In assuming that I must match the machine architecture (eg 32 bit  to 32 bit


Or 64 bit to 64 bit) on both machines for warm standby to work?

 

Thank you,

 

 <mailto:autoenthusiasts@autorevenue.com?subject=Feedback> Committed to
Creating @utoEnthusiasts. Please provide us with your feedback. 

  _____  

Mark Steben│Database Administrator│  <http://www.autorevenue.com/;
@utoRevenueT
95 Ashley Ave. West Springfield, MA., 01089 
413-243-4800 x1512 (Phone) │ 413-732-1824 (Fax)

A Division of Dominion Enterprises

 

 

 

 

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: warm standby
  2008-11-28 19:22 warm standby Mark Steben <msteben@autorevenue.com>
@ 2008-11-28 19:37 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2008-11-28 19:37 UTC (permalink / raw)
  To: Mark Steben <msteben@autorevenue.com>; +Cc: pgsql-admin

"Mark Steben" <msteben@autorevenue.com> writes:
> I'm attempting a warm standby setup.  I'm running Postgres 8.3 on both
> master and slave.

> Unfortunately the master is a 32 bit machine and the slave is a 64 bit
> machine.

You do need the same architecture on both ends.  You might be able to
run a 32-bit build of Postgres on the slave, though.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2008-11-28 19:37 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-02-27 08:34 Warm standby Johann Spies <jspies@sun.ac.za>
2008-11-28 19:22 warm standby Mark Steben <msteben@autorevenue.com>
2008-11-28 19:37 ` Re: warm standby Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox