Postgres failover implementation

From: "Peter Schmidt" <peterjs(at)home(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Postgres failover implementation
Date: 2000-12-09 21:41:52
Message-ID: AGxY5.5490$M5.314513@news1.frmt1.sfba.home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2000-12-09 23:21:08 Re: Unanswered questions about Postgre
Previous Message Bruce Momjian 2000-12-09 20:13:27 Re: Bug? 'psql -l' in pg_ctl?