two servers on the same port

From: Eric Haszlakiewicz <erh(at)swapsimple(dot)com>
To: pgsql-hackers(at)postgrsql(dot)org
Subject: two servers on the same port
Date: 2008-10-18 05:21:49
Message-ID: 20081018052149.GA27646@poe.swapsimple.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


I just spent a couple of days trying to figure out why I couldn't start
two servers on the same port, even though I was configuring separate
listen_address values. I kept gettting errors about shmget failing with
"could not create shared memory segment: Invalid argument".

I finally noticed that the shared memory key mentioned in the error when
starting the second server was the same as what the first server was
using, which appeared to be generated based off of the port number.

Sure enough when I changed the port, it used a different shared memory
key and started right up. After searching around on the web a bit
I found some pages that suggested running under different userids
might be necessary. So, I tried that, and changed the port back to the
standard 5432, and it started up.

Anyway, everything seems to be working fine, but I figured this info
should be a bit easier to find, so here's a couple patches to the
documentation to mention how this works.

eric

Attachment Content-Type Size
config.sgml.diff text/plain 661 bytes
runtime.sgml.diff text/plain 673 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark 2008-10-18 06:41:12 PGDay.it collation discussion notes
Previous Message Nathan Boley 2008-10-18 01:54:39 Re: Cross-column statistics revisited