Received: from femail10.sdc1.sfba.home.com (femail10.sdc1.sfba.home.com [24.0.95.106]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id eBBKsEm69623 for ; Mon, 11 Dec 2000 15:54:14 -0500 (EST) (envelope-from peterjs@home.com) Received: from C525713A ([24.10.178.189]) by femail10.sdc1.sfba.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20001211205438.HDRI5639.femail10.sdc1.sfba.home.com@C525713A> for ; Mon, 11 Dec 2000 12:54:38 -0800 From: "Peter Schmidt" To: Subject: Postgres failover Date: Mon, 11 Dec 2000 12:55:30 -0800 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Importance: Normal X-Archive-Number: 200012/59 X-Sequence-Number: 251 PostgreSQL v7.0.2 My company is looking for a way to implement failover w/Postgres. I've determined that two postmasters running on different machines (FreeBSD) can share a single $PGDATA directory(NFS mount) as long as only one postmaster is running at a time. Originally I thought I might be able to use postmaster.pid to lock out the second postmaster, but the pid file is overwritten by the second postmaster when it starts. I've tested a similar approach using a "lockfile" i.e. create a file in $PGDATA and keep it locked for the duration of postmaster. If a second postmaster tries to start up, it can't because the lockfile is locked. When postmaster exits, the file is unlinked, and the second postmaster is able to start. Anyone have any thoughts or experiences with this? Comments? TIA Peter Schmidt