Re: Postgres failover implementation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Peter Schmidt" <peterjs(at)home(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres failover implementation
Date: 2000-12-12 18:09:36
Message-ID: 2401.976644576@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Peter Schmidt" <peterjs(at)home(dot)com> writes:
> 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.

Performance across an NFS mount will doubtless suck badly. That might
be acceptable as an emergency backup mode of operation ... but if the
machine with the disk is up, you might as well be running the postmaster
there.

It sounds like you intend to have both the primary and secondary
database servers access an NFS server. Seems like this still means a
single point of failure, ie the NFS box. So what's the point?

> 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.

The lockfile code assumes that if the PID in the file doesn't belong to
a live process *on the local machine*, then it's left over from a
crashed postmaster. You could remove that check, perhaps, but then
you'd have to remove the PID file manually anytime you had a postmaster
crash. (However, postmaster crashes are rare, so this might be OK.)

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message The Hermit Hacker 2000-12-12 18:15:30 Public News Server access ...
Previous Message Stephan Szabo 2000-12-12 18:06:06 Re: help with referential integrity