Thread: Error with tcp/ip networking
I'm getting: FATAL: StreamServerPort: bind() failed: Address already in use Is another postmaster already running on that port? If not, wait a few seconds and retry. when I use postmaster with the -i option. Yes, I already deleted the /tmp/?????.5432 files. When I run postmaster without -i, it works fine, but no tcp/ip access. I had it working with tcp/ip once, but I had a nasty crash for other reasons, and postmaster did not get a chance to exit normally. What did I miss? I'm running it on a solaris workstation. Travis Bauer
"Travis Bauer" <trbauer@cs.indiana.edu> writes: > I'm getting: > FATAL: StreamServerPort: bind() failed: Address already in use > Is another postmaster already running on that port? > If not, wait a few seconds and retry. > when I use postmaster with the -i option. Yes, I already deleted the > /tmp/?????.5432 files. When I run postmaster without -i, it works fine, but > no tcp/ip access. Well, the /tmp files are for non-TCP (Unix socket) communication, so they're not relevant to this failure. The postmaster is complaining because it can't get ownership of the 5432 TCP port number. I'm betting that you have another postmaster process still hanging around, or else (much less likely, but possible) some unrelated program that happens to have grabbed onto the 5432 TCP port number. Try using 'netstat' to see if 5432 is in use... regards, tom lane
On Thu, Aug 31, 2000 at 01:33:35AM -0400, Tom Lane wrote: > "Travis Bauer" <trbauer@cs.indiana.edu> writes: > > I'm getting: > > FATAL: StreamServerPort: bind() failed: Address already in use > > Is another postmaster already running on that port? > > If not, wait a few seconds and retry. > > > when I use postmaster with the -i option. Yes, I already deleted the > > /tmp/?????.5432 files. When I run postmaster without -i, it works fine, but > > no tcp/ip access. > > Well, the /tmp files are for non-TCP (Unix socket) communication, so > they're not relevant to this failure. The postmaster is complaining > because it can't get ownership of the 5432 TCP port number. I'm betting > that you have another postmaster process still hanging around, or else > (much less likely, but possible) some unrelated program that happens to > have grabbed onto the 5432 TCP port number. > > Try using 'netstat' to see if 5432 is in use... Note that on some OSes, a killed process's server ports aren't released for a minute or two, so it can take a minute or two before you can start postmaster again. This isn't a problem if the processes are cleanly shutdown, normally. Jules
Well, there were two other copies of postgress running, and at least one was tying up port 5432, but . . . I couldn't see them with 'ps' or 'ps -a', netstat did not list them as using a port, but it did list something as having "Active UNIX domain sockets," listing the tmp files I had deleted yesterday as the socket location (it didn't name postmaster with them). I found it by making my xterm quit long and running top. The showed up as being owned by me. Now I'm back in business, but I don't understand why they didn't show up in ps or ps -a. Thanks,. ---------------------------------------------------------------- Travis Bauer | CS Grad Student | IU |www.cs.indiana.edu/~trbauer ---------------------------------------------------------------- On Thu, 31 Aug 2000, Tom Lane wrote: > > Well, the /tmp files are for non-TCP (Unix socket) communication, so > they're not relevant to this failure. The postmaster is complaining > because it can't get ownership of the 5432 TCP port number. I'm betting > that you have another postmaster process still hanging around, or else > (much less likely, but possible) some unrelated program that happens to > have grabbed onto the 5432 TCP port number. > > Try using 'netstat' to see if 5432 is in use... > > regards, tom lane >
On Thu, Aug 31, 2000 at 07:30:36AM -0500, Travis Bauer wrote: > Well, there were two other copies of postgress running, and at least one > was tying up port 5432, but . . . > > I couldn't see them with 'ps' or 'ps -a', netstat did not list them as > using a port, but it did list something as having "Active UNIX domain > sockets," listing the tmp files I had deleted yesterday as the socket > location (it didn't name postmaster with them). I found it by making my > xterm quit long and running top. The showed up as being owned by > me. Now I'm back in business, but I don't understand why they didn't > show up in ps or ps -a. I daresay you wanted ps -ax, since they didn't have a controlling terminal. In future, always use ps -auwx before assuming a process doesn't exist -- that catches them all. (Except on some SYSV-style pses, in which case you want ps -ef, I think) Jules
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 > Now I'm back in business, but I don't understand why they didn't show > up in ps or ps -a. from the 'ps' manpage: a Select all processes on a terminal, includ- ing those of other users x Select processes without controlling ttys Generally, to get the fullest possible output from ps, you should do ps auxw. Ian -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.1 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE5rmu9fn9ub9ZE1xoRAgAIAJ9YoC1Fbvc4dNSr/i8tM3QHQRToZwCffHme MpdZ7mHHLCMDsFuVDW114Js= =J6Jj -----END PGP SIGNATURE-----
Travis Bauer <trbauer@cs.indiana.edu> writes: > Well, there were two other copies of postgress running, and at least one > was tying up port 5432, but . . . > I couldn't see them with 'ps' or 'ps -a', ps -a only lists processes that it thinks are spawned from interactive sessions. You need ps -ax to see everything on the system. > netstat did not list them as using a port, Actually I think netstat only shows open connections, not processes listening for connections. Does anyone know a (reasonably portable) way of seeing which port numbers are being accept()ed on? regards, tom lane
On Thu, Aug 31, 2000 at 10:15:50AM -0400, Tom Lane wrote: > > netstat did not list them as using a port, > > Actually I think netstat only shows open connections, not processes > listening for connections. Does anyone know a (reasonably portable) > way of seeing which port numbers are being accept()ed on? netstat -a (often netstat -an cuts out the time-consuming DNS lookups). Jules
On Thu, 31 Aug 2000, Tom Lane wrote: > Actually I think netstat only shows open connections, not processes > listening for connections. Does anyone know a (reasonably portable) > way of seeing which port numbers are being accept()ed on? > > regards, tom lane how about lsof, at: ftp://cc.vic.purdue.edu/ omni:rwp> lsof -i | grep post postgres 14054 postgres 3u inet 0x64b0f900 0t0 TCP *:5432 (LISTEN) Bob Parkinson rwp@biome.ac.uk ------------------------------------------------------------------ Technical Manager: Biome http://biome.ac.uk/ Greenfield Medical Library, Queens Medical Centre, Nottingham. 0115 9249924 x 42059 ------------------------------------------------------------------ We are stardust
At 10:15 31/08/00 -0400, Tom Lane wrote: >Actually I think netstat only shows open connections, not processes >listening for connections. Does anyone know a (reasonably portable) >way of seeing which port numbers are being accept()ed on? > netstat -a | grep LISTEN works on most UNIX flavours
On Thu, 31 Aug 2000, Tom Lane wrote: > > Actually I think netstat only shows open connections, not processes > listening for connections. Does anyone know a (reasonably portable) > way of seeing which port numbers are being accept()ed on? > > regards, tom lane netstat -l shows listening active connections and sockets (on most Linux systems). James Eric Lawson Research Publications Editor III National Simulation Resource eric@bioeng.washington.edu - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Everyday language is a part of the human organism and is no less complicated than it. - Ludwig Wittgenstein (1889-1951) [Tractatus Logico-Philosophicus, 1921] >