Network Card Not Listening at Startup

From: Ludwig Isaac Lim <ludz_lim(at)yahoo(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Network Card Not Listening at Startup
Date: 2022-02-09 16:32:23
Message-ID: 1854983886.1394387.1644424343951@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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(at)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(at)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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2022-02-09 17:49:03 Re: Network Card Not Listening at Startup
Previous Message Laurenz Albe 2022-02-09 16:09:31 Re: Why are data files getting modified?