Re: db replication and errors - Mailing list pgsql-general

From Richard Huxton
Subject Re: db replication and errors
Date
Msg-id 4215E728.8050608@archonet.com
Whole thread Raw
In response to db replication and errors  (Benjamin <benjamin@netyantra.com>)
Responses Re: db replication and errors
List pgsql-general
Benjamin wrote:
>
> Hello everyone,
>
> The scene :
> Currently, we r using,  Postgresql v 7.3, on RedHat 9
> machines.
>
> We provide a hot standby at all times for the Primary
> server.
>
> So, we have to maintain a duplicate of  the entire
> database.
> The problem arises, when the standby boots.
>
> I wanted to know, whenever the standby boots up, what
> all files shud it copy frm the Primary.
> All files, under the data directory??
> Viz., global, base, clog and xlog?

Yes - all files.

> What are those pg_internal.init, pgstat.stat files?
> What's the difference between global and base
> directories?

The "base" directory is the main data store - you can see what the
numbers refer to by using the oid2name utility in contrib/

> If the async feature is used on the primary, shud we
> copy on the xlog and clog files onto the backup as
> well?

What is the "async feature"?

> As of now, we shut down postmaster, on the Primary
> whenever the standby boots up, and then copy all the above said files,
> from the primary to the standby.
>
> Duz this ensure, all data is written onto the disk b4
> postmaster shut downs?

Provided the postmaster shuts down cleanly, and you've synced to disk
then all should be OK.

> Quite a few times, I have encountered errors, like, xlogflush is not
> satisfied,
> bogus attribute number for <some num , eg. -2>,  catalog is missing,
> cache lookup failed.

One of 4 things could be at fault:
  1. Files aren't being sync'ed to disk
  2. You aren't copying the right files
  3. The versions of PG don't match
  4. The platforms you are running on are different (e.g. Sun-Sparc vs x86)

It might be worth looking at "slony" to run a replication setup, rather
than copying files.

--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Bob Hartung
Date:
Subject: Alternate DB location continued.
Next
From: "David Gagnon"
Date:
Subject: quote_literal Simple question