Postgres failover - Mailing list pgsql-admin

From Peter Schmidt
Subject Postgres failover
Date
Msg-id NEBBJGEFMKLFIKBKBDIDAEEKCCAA.peterjs@home.com
Whole thread Raw
Responses Re: Postgres failover
List pgsql-admin
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-admin by date:

Previous
From: "Jimi Thompson"
Date:
Subject: Re: Implementing mod_perl, Perl 5.004, and Postgres
Next
From: "Dana Hudes"
Date:
Subject: Re: Implementing mod_perl, Perl 5.004, and Postgres