From: Ludwig Isaac Lim <ludz_lim@yahoo.com>
To: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Network Card Not Listening at Startup
Date: Wed, 9 Feb 2022 16:32:23 +0000 (UTC)
Message-ID: <1854983886.1394387.1644424343951@mail.yahoo.com> (raw)
References: <1854983886.1394387.1644424343951.ref@mail.yahoo.com>
Hello:
I'm running postgresql 12.9 on Amazon Linux in AWS.
My listen_addresses in postgresql.conf is configured like below:
listen_addresses = '172.17.1.57,localhost'
However, postgresql does not listen on 172..17.1.57. I can reproduce the phenomenon by simply rebooting the server and then run netstat -tulpn
[root@ip-172-17-1-206 data]# netstat -tulpn | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 2605/postgres
And there's nothing abnormal in the logs:
2022-02-09 15:59:36.906 UTC [2663] LOG: database system was shut down at 2022-02-09 15:59:20 UTC
2022-02-09 15:59:36.930 UTC [2605] LOG: database system is ready to accept connections
I had to run:
systemctl restart postgresql
For 172.17.1.57 to listen
[root@ip-172-17-1-206 data]# netstat -tulpn | grep 5432
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 4289/postgres
tcp 0 0 172.17.1.57:5432 0.0.0.0:* LISTEN 4289/postgres
Note that 172.17.1.57 is not the primary network interface. I created the network interface and attached it to the EC2 instance.
My systemd config file for postgresql (/etc/systemd/system/postgresql.service) was copied from 18.3. Starting the Database Server
18.3. Starting the Database Server
18.3. Starting the Database Server 18.3.1. Server Start-up Failures 18.3.2. Client Connection Problems Before an...
Extra information
------------------------------
postgres=# select version();
version
--------------------------------------------------------------------------------
PostgreSQL 12.9 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 7.3.1 20180712 (R
(1 row)
How do make sure that NIC will be listening every time I started/restarted the server?
Thanks in advance,
Ludwig Lim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ludz_lim@yahoo.com
Subject: Re: Network Card Not Listening at Startup
In-Reply-To: <1854983886.1394387.1644424343951@mail.yahoo.com>
References: <1854983886.1394387.1644424343951.ref@mail.yahoo.com> <1854983886.1394387.1644424343951@mail.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox