From: | Greg Smith <gsmith(at)gregsmith(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: changing the /tmp/ lock file? |
Date: | 2007-06-13 19:36:50 |
Message-ID: | Pine.GSO.4.64.0706131515480.29883@westnet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Wed, 13 Jun 2007, Ben wrote:
> Why would that be a problem if each is configured to listen on different
> addresses?
I'm not sure if you can even get bind() to work like that portably, but
ultimately it doesn't matter anyway. The benefit of how the current lock
scheme keeps people from screwing up and running the server twice
outweighs the value of satisfying the odd case you're asking for here even
if it were technically possible to do.
> But maybe a better question to ask would be how people are doing
> failover in the case where you have two servers, each handling a
> seperate set of data and acting as backup for each other.
A sample might be:
Server 1: Primary for DB#1 on 5432, secondary for DB#2 on 5433
Server 2: Primary for DB#2 on 5433, secondary for DB#1 on 5432
Then you would always know to reach DB#1 on port 5432 and DB#2 on port
5433, regardless of which IP address was active. Once you've got that in
place, have incoming connects go to two virtual IP address that normally
map to the two servers, but which collapses to the same underlying address
in the case of a failure. Then you can use any number of IP-based
failover schemes to implement that.
If you wanted to only expose port 5432 as being the public one, but with
two addresses, you might remap the port via the capabilities of the
virtual interface. In that case, you could actually keep both servers
running their primary on 5432, but then you'd be stuck with issues like
making sure the port number was changed every time you moved the entire
primary config to the secondary. It's just a easier to manage in several
aspects if you fix the port numbers per cluster, rather than always have
5432 be the active one and the IP address determining which cluster you
get to.
You'd need to give some more OS and general network setup information to
get any more specific or clever than that.
--
* Greg Smith gsmith(at)gregsmith(dot)com http://www.gregsmith.com Baltimore, MD
From | Date | Subject | |
---|---|---|---|
Next Message | Andrus | 2007-06-13 19:37:25 | Re: how to speed up query |
Previous Message | Stefan Kaltenbrunner | 2007-06-13 19:26:07 | Re: pointer to feature comparisons, please |