title: Could not connect to server on port 5432 (PostgreSQL - CentOS 7.4)
body: <p>When trying to connect to the database I get this message "Could not connect to server.Is the server running on host 10.9.10.83 and accepting TCP/IP connections on port 5432?"
  The connection with the database was working fine yesterday, but today I have this message. I closed my computer and run out of battery and this problemn happened right after, so it might be related. How can I fix the connection?</p>
  
  <p>I run the command : postgresql-10.service status.
  The result is this : </p>
  
  <pre><code> Redirecting to /bin/systemctl status postgresql-10.service
  ● postgresql-10.service - PostgreSQL 10 database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql-10.service; enabled; vendor preset: disabled)
     Active: active (running) since sam. 2018-07-21 16:35:53 CEST; 41min ago
       Docs: https://www.postgresql.org/docs/10/static/
    Process: 4997 ExecReload=/bin/kill -HUP $MAINPID (code=exited, status=0/SUCCESS)
    Process: 4909 ExecStartPre=/usr/pgsql-10/bin/postgresql-10-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
   Main PID: 4915 (postmaster)
     CGroup: /system.slice/postgresql-10.service
             ├─4915 /usr/pgsql-10/bin/postmaster -D /var/lib/pgsql/10/data/
             ├─4917 postgres: logger process
             ├─4919 postgres: checkpointer process
             ├─4920 postgres: writer process
             ├─4921 postgres: wal writer process
             ├─4922 postgres: autovacuum launcher process
             ├─4923 postgres: stats collector process
             ├─4924 postgres: bgworker: logical replication launcher
             ├─4932 postgres: etpta etpta 127.0.0.1(60872) idle
             ├─5061 postgres: etpta etpta 127.0.0.1(33322) idle
             ├─7739 postgres: etpta etpta 10.9.10.83(35034) idle
             ├─7747 postgres: etpta etpta 10.9.10.83(35036) idle
             ├─7748 postgres: etpta etpta 10.9.10.83(35038) idle
             ├─7749 postgres: etpta etpta 10.9.10.83(35040) idle
             ├─7750 postgres: etpta etpta 10.9.10.83(35042) idle
             ├─7751 postgres: etpta etpta 10.9.10.83(35044) idle
             ├─7752 postgres: etpta etpta 10.9.10.83(35046) idle
             ├─7753 postgres: etpta etpta 10.9.10.83(35048) idle
             ├─7770 postgres: etpta etpta 10.9.10.83(35066) idle
             ├─7790 postgres: etpta etpta 10.9.10.83(35788) idle
             ├─7809 postgres: etpta etpta 10.9.10.83(35948) idle
             ├─7847 postgres: etpta etpta 10.9.10.83(35958) idle
             ├─7849 postgres: etpta etpta 10.9.10.83(35960) idle
             ├─7852 postgres: etpta etpta 10.9.10.83(35962) idle
             ├─7855 postgres: etpta etpta 10.9.10.83(35968) idle
             ├─7863 postgres: etpta etpta 10.9.10.83(35972) idle
             └─7867 postgres: etpta etpta 10.9.10.83(35978) idle
  </code></pre>
  
  <p>And :</p>
  
  <pre><code>[root@VM-ACTION telnet]# netstat -antpl | grep 5432
  tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN                                                                                   14507/postmaster
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40942        ESTABLISHED                                                                              16181/postgres: etp
  tcp      126      0 10.9.10.83:58240        10.9.10.83:5432         CLOSE_WAIT                                                                               12980/hrmtpr
  tcp      126      0 10.9.10.83:58212        10.9.10.83:5432         CLOSE_WAIT                                                                               12950/hrmtrt
  tcp      126      0 10.9.10.83:58210        10.9.10.83:5432         CLOSE_WAIT                                                                               12948/hrmdisp
  tcp        0      0 127.0.0.1:5432          127.0.0.1:41280         ESTABLISHED                                                                              14586/postgres: etp
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40936        ESTABLISHED                                                                              16178/postgres: etp
  tcp      126      0 10.9.10.83:58214        10.9.10.83:5432         CLOSE_WAIT                                                                               12951/hrmtrt
  tcp      126      0 10.9.10.83:58218        10.9.10.83:5432         CLOSE_WAIT                                                                               12953/hrmtrt
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40934        ESTABLISHED                                                                              16176/postgres: etp
  tcp        0      0 10.9.10.83:40928        10.9.10.83:5432         ESTABLISHED                                                                              16140/hrmlog
  tcp        0      0 10.9.10.83:40942        10.9.10.83:5432         ESTABLISHED                                                                              16180/hrmtra
  tcp        0      0 10.9.10.83:40932        10.9.10.83:5432         ESTABLISHED                                                                              16173/hrmsrv
  tcp        0      0 10.9.10.83:40952        10.9.10.83:5432         ESTABLISHED                                                                              16192/hrmtra
  tcp        0      0 10.9.10.83:40936        10.9.10.83:5432         ESTABLISHED                                                                              16177/hrmtra
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40928        ESTABLISHED                                                                              16141/postgres: etp
  tcp      126      0 10.9.10.83:58964        10.9.10.83:5432         CLOSE_WAIT                                                                               13017/adtacq
  tcp        0      0 127.0.0.1:5432          127.0.0.1:41236         ESTABLISHED                                                                              14520/postgres: etp
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40932        ESTABLISHED                                                                              16174/postgres: etp
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40952        ESTABLISHED                                                                              16193/postgres: etp
  tcp        0      0 10.9.10.83:40934        10.9.10.83:5432         ESTABLISHED                                                                              16175/hrmtra
  tcp      126      0 10.9.10.83:58220        10.9.10.83:5432         CLOSE_WAIT                                                                               12954/hrmtrt
  tcp        0      0 10.9.10.83:40946        10.9.10.83:5432         ESTABLISHED                                                                              16188/hrmtra
  tcp      126      0 10.9.10.83:58216        10.9.10.83:5432         CLOSE_WAIT                                                                               12952/hrmtrt
  tcp        0      0 10.9.10.83:5432         10.9.10.83:52714        TIME_WAIT                                                                                -
  tcp      126      0 10.9.10.83:58222        10.9.10.83:5432         CLOSE_WAIT                                                                               12955/hrmtrt
  tcp        0      0 10.9.10.83:5432         10.9.10.83:40946        ESTABLISHED                                                                              16189/postgres: etp
  tcp6       0      0 :::5432                 :::*                    LISTEN                                                                                   14507/postmaster
  tcp6       0      0 127.0.0.1:41236         127.0.0.1:5432          ESTABLISHED                                                                              2422/java
  tcp6       0      0 127.0.0.1:41280         127.0.0.1:5432          ESTABLISHED                                                                              2422/java
  </code></pre>