Re: BUG #6689: socket file name convention doesn't allow different IPs and the same port for different pgclusters - Mailing list pgsql-bugs

From Magnus Hagander
Subject Re: BUG #6689: socket file name convention doesn't allow different IPs and the same port for different pgclusters
Date
Msg-id CABUevEzdjbwnAPhCf_eU82q+r-7wrv5JyDL2EzD63LyeDHtbHQ@mail.gmail.com
Whole thread Raw
In response to BUG #6689: socket file name convention doesn't allow different IPs and the same port for different pgclusters  (ms@it-infrastrukturen.org)
Responses Re: BUG #6689: socket file name convention doesn't allow different IPs and the same port for different pgclusters
List pgsql-bugs
On Wed, Jun 13, 2012 at 2:45 AM,  <ms@it-infrastrukturen.org> wrote:
> The following bug has been logged on the website:
>
> Bug reference: =A0 =A0 =A06689
> Logged by: =A0 =A0 =A0 =A0 =A0Mark
> Email address: =A0 =A0 =A0ms@it-infrastrukturen.org
> PostgreSQL version: 9.1.3
> Operating system: =A0 unbuntu-server 12.04 LTS
> Description:
>
> When using /var/run/postgresql/ as unix_socket_directory for "main" and
> "second" pgcluster and different IP-interfaces (addresse) for every
> pgcluster (but the same default port number), there are different pid file
> names (like 9.1-main.pid and 9.1-secondpg.pid) *but* names of unix_sockek
> files doesn't follow such name conventions.
>
> It results in error when trying to run the second pgcluster with another =
IP
> but the same (default port 5432):
> Error: Port conflict: another instance is already running on on
> /var/run/postgresql with port 5432

First of all, this is not a bug - this is intended behaviour. Perhaps
the documentation needs to be clearified on the fact that the port
number needs to be unique across all instances though.

One reason is that the port number is used to control several other
things. Just the Unix socket is only one of the things - it also
controls the name of shared memory segments, so it still won't work if
you work around that.

All instances need to have their own ports. If you want to listen on
the same port on different IPs, you will need to use something like
kernel level ip forwarding to rewrite the access, and actually run
PostgreSQL on different ports still.

--=20
=A0Magnus Hagander
=A0Me: http://www.hagander.net/
=A0Work: http://www.redpill-linpro.com/

pgsql-bugs by date:

Previous
From: Sachin Srivastava
Date:
Subject: Re: BUG #6691: Unable to install PostgrSQL
Next
From: Magnus Hagander
Date:
Subject: Re: BUG #6689: socket file name convention doesn't allow different IPs and the same port for different pgclusters