Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id eB4Jl2G24524 for ; Mon, 4 Dec 2000 14:47:02 -0500 (EST) (envelope-from pgsql-admin-owner@postgresql.org) Received: from demai05.mw.mediaone.net (demai05.mw.mediaone.net [24.131.1.56]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eAU5AWt95487 for ; Thu, 30 Nov 2000 00:10:32 -0500 (EST) (envelope-from hamptone@mediaone.net) Received: from pavilion.mw.mediaone.net (nic-30-c33-230.mw.mediaone.net [24.30.33.230]) by demai05.mw.mediaone.net (8.8.7/8.8.7) with SMTP id AAA24588; Thu, 30 Nov 2000 00:10:18 -0500 (EST) Message-ID: <006b01c05aa4$b4cacd60$e6211e18@mw.mediaone.net> From: "hamptone" To: Cc: =?iso-8859-1?Q?Ragnar_Kj=F8rstad?= References: <00111611404600.18526@dennis.veritime.com> <20001123172837.B4343@vestdata.no> Subject: Re: Redundant databases/real-time backup Date: Thu, 30 Nov 2000 00:08:20 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 X-Archive-Number: 200012/14 X-Sequence-Number: 206 Thanks for the tips Ragnar...although I wish you would explain more about FIFO. The only thing that rings a bell on this is First In First Out from the inventory chaper of my accounting textbook..... ----- Original Message ----- From: "Ragnar Kjørstad" To: "root" Cc: 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 > 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 >