public inbox for [email protected]
help / color / mirror / Atom feedRe: Postgres listens on random port
2+ messages / 2 participants
[nested] [flat]
* Re: Postgres listens on random port
@ 2024-11-05 14:40 Ron Johnson <[email protected]>
0 siblings, 1 reply; 2+ messages in thread
From: Ron Johnson @ 2024-11-05 14:40 UTC (permalink / raw)
To: pgsql-general
On Tue, Nov 5, 2024 at 9:22 AM Kal <[email protected]> wrote:
>
> On Tue, 5 Nov 2024 at 7:42 PM, Greg Sabino Mullane <[email protected]>
> wrote:
>
>> Start by seeing where the port is actually being set by running this:
>>
>> select setting, source, sourcefile, sourceline from pg_settings where
>> name = 'port';
>> Cheers,
>> Greg
>>
>> Hi Greg,
>
> The query output states the source as command line. Event the port value
> output from show port is same as given in pg_ctl command.
>
> But the database is listening on some other random port.
>
*Client* applications use a random port on *their* host: In this case,
10.176.242.216 is the client, and 10.109.165.4, and 10.176.252.201 are the
DB servers:
$ netstat -an | grep :5432
tcp 0 0 10.176.242.216:37086 10.109.165.4:5432
ESTABLISHED
tcp 0 0 10.176.242.216:43256 10.176.252.201:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36172 10.143.170.55:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36142 10.143.170.55:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36156 10.143.170.55:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36174 10.143.170.55:5432
TIME_WAIT
tcp 0 0 10.176.242.216:38998 10.109.165.4:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36186 10.143.170.55:5432
TIME_WAIT
tcp 0 0 10.176.242.216:36188 10.143.170.55:5432
ESTABLISHED
tcp 19 0 10.176.242.216:36196 10.143.170.55:5432
ESTABLISHED
tcp 19 0 10.176.242.216:36208 10.143.170.55:5432
ESTABLISHED
tcp 0 0 10.176.242.216:36210 10.143.170.55:5432
ESTABLISHED
--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> crustacean!
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Postgres listens on random port
@ 2024-11-05 15:25 Saul Perdomo <[email protected]>
parent: Ron Johnson <[email protected]>
0 siblings, 0 replies; 2+ messages in thread
From: Saul Perdomo @ 2024-11-05 15:25 UTC (permalink / raw)
To: Ron Johnson <[email protected]>; +Cc: pgsql-general
Agreed - it sounds like OP found a *client *process and mistook it for a
server process, which is why I wanted to know where exactly he saw this.
On Tue, Nov 5, 2024 at 9:41 AM Ron Johnson <[email protected]> wrote:
> On Tue, Nov 5, 2024 at 9:22 AM Kal <[email protected]> wrote:
>
>>
>> On Tue, 5 Nov 2024 at 7:42 PM, Greg Sabino Mullane <[email protected]>
>> wrote:
>>
>>> Start by seeing where the port is actually being set by running this:
>>>
>>> select setting, source, sourcefile, sourceline from pg_settings where
>>> name = 'port';
>>> Cheers,
>>> Greg
>>>
>>> Hi Greg,
>>
>> The query output states the source as command line. Event the port value
>> output from show port is same as given in pg_ctl command.
>>
>> But the database is listening on some other random port.
>>
>
> *Client* applications use a random port on *their* host: In this case,
> 10.176.242.216 is the client, and 10.109.165.4, and 10.176.252.201 are
> the DB servers:
>
> $ netstat -an | grep :5432
> tcp 0 0 10.176.242.216:37086 10.109.165.4:5432
> ESTABLISHED
> tcp 0 0 10.176.242.216:43256 10.176.252.201:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36172 10.143.170.55:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36142 10.143.170.55:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36156 10.143.170.55:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36174 10.143.170.55:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:38998 10.109.165.4:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36186 10.143.170.55:5432
> TIME_WAIT
> tcp 0 0 10.176.242.216:36188 10.143.170.55:5432
> ESTABLISHED
> tcp 19 0 10.176.242.216:36196 10.143.170.55:5432
> ESTABLISHED
> tcp 19 0 10.176.242.216:36208 10.143.170.55:5432
> ESTABLISHED
> tcp 0 0 10.176.242.216:36210 10.143.170.55:5432
> ESTABLISHED
>
> --
> Death to <Redacted>, and butter sauce.
> Don't boil me, I'm still alive.
> <Redacted> crustacean!
>
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2024-11-05 15:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-11-05 14:40 Re: Postgres listens on random port Ron Johnson <[email protected]>
2024-11-05 15:25 ` Saul Perdomo <[email protected]>
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox