pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Lockhurst <lochurst@cal2.vsnl.net.in>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Redundant databases/real-time backup-Revisited
Date: Mon, 01 Jan 2001 07:13:47 +0530
Message-ID: <3A4FE0D3.7A173E91@cal2.vsnl.net.in> (raw)
References: <00111611404600.18526@dennis.veritime.com>
	<20001123172837.B4343@vestdata.no>
	<006b01c05aa4$b4cacd60$e6211e18@mw.mediaone.net>

Hi,

Tried by modifying /etc/rc.d/init.d/postgresql with following changes:
su -l postgres -c '/usr/bin/postmaster -i -D /var/lib/pgsql
/var/lib/pgsql/query_log 2>&1 &'

The file query_log is created. But it is remaining empty even after restart and
all sorts of transactions including insert statements.

Early thanks for any help

Wish you all a vey happy new 2001.

Lockhurst


> ----- Original Message -----
> From: "Ragnar Kjørstad" <postgres@ragnark.vestdata.no>
> To: "root" <root@dennis.veritime.com>
> Cc: <pgsql-admin@postgresql.org>
> Sent: Thursday, November 23, 2000 8:28 AM
> Subject: Re: [ADMIN] Redundant databases/real-time backup
>
> > On Thu, Nov 16, 2000 at 11:14:15AM -0500, root wrote:
> > > It is necessary to create/alter the postgresql startup script.  I have
> included
> > > a copy of mine.  The database to be mirrored must start up with logging
> > > enabled:
> > >
> > > su -l postgres -c '/usr/bin/postmaster -i -D/home/postgres/data
> >/home/postgres/data/query_log 2>&1 &'
> >
> > But why do you do 2>&1 in your startup-script? This will redirect data
> > on stderr to stdout - I don't think that is a good idea.
> >
> > > Other points:
> > > The query_log can get large rather quickly.  You cannot simply issue a
> rm -rf
> > > query_log, touch query_log and chmod.  Even with the appropriate
> permissions
> > > the daemon will not write to a new file, for some reason you must
> restart
> > > postgres using the startup script.  Perhaps one of the developers has an
> answer
> > > to this problem.....
> >
> > This is becuase the postgres deamon keeps the file open, and will keep
> > on writing to the old file even after you delete it. Most deamons will
> > reopen their log-files if you send them a HUP signal, so a possible
> > solution is:
> >
> > mv logfile logfile.1
> > kill -HUP <pid>
> > process logfile.1
> > rm logfile.1
> >
> > The order is important to make sure you don't have a race-condition.
> >
> > A different alternative is to use a FIFO instead of a normal file, and
> > process it continually istead of in batch-jobs.
> >
> >
> >
> >
> > A totally different approach would be to have a "sql-proxy" relay all
> > requests to two (or more) different servers to always keep them in sync.
> >
> >
> > --
> > Ragnar Kjørstad
> >




Message-ID: <3A4FE0D3.7A173E91@cal2.vsnl.net.in>
Permalink:  ../3A4FE0D3.7A173E91@cal2.vsnl.net.in/
Also on:    postgresql.org/message-id/3A4FE0D3.7A173E91@cal2.vsnl.net.in

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: lochurst@cal2.vsnl.net.in
  Subject: Re: Redundant databases/real-time backup-Revisited
  In-Reply-To: <3A4FE0D3.7A173E91@cal2.vsnl.net.in>
  References: <00111611404600.18526@dennis.veritime.com> <20001123172837.B4343@vestdata.no> <006b01c05aa4$b4cacd60$e6211e18@mw.mediaone.net> <3A4FE0D3.7A173E91@cal2.vsnl.net.in>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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