pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Schmidt <peterjs@home.com>
To: pgsql-admin@postgresql.org
Subject: Postgres failover
Date: Mon, 11 Dec 2000 12:55:30 -0800
Message-ID: <NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com> (raw)

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




view thread (2+ messages)  latest in thread

Message-ID: <NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com>
Permalink:  ../NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com/
Also on:    postgresql.org/message-id/NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com

 · 

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: peterjs@home.com
  Subject: Re: Postgres failover
  In-Reply-To: <NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com>
  References: <NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com>

* 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