Postgres failover implementation - Mailing list pgsql-general

From Peter Schmidt
Subject Postgres failover implementation
Date
Msg-id AGxY5.5490$M5.314513@news1.frmt1.sfba.home.com
Whole thread Raw
Responses Re: Postgres failover implementation  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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




pgsql-general by date:

Previous
From: Steve Heaven
Date:
Subject: COPY doesnt work on views
Next
From: "JAMES"
Date:
Subject: Re: Query problem