Hi Andreaussi,
from the output, it tells that the PostgreSQL service is running. But it seems there is a connection problem.
- Enable the service so that it comes automatically on when the Server restarts
root@ucsMaster1:~# systemctl enable postgresql
Synchronizing state for postgresql.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d postgresql defaults
Executing /usr/sbin/update-rc.d postgresql enable
root@ucsMaster1:~#
- Secondly check if the ports are open or it it is listening on the right port:
root@ucsMaster1:~# netstat -plnt | grep postgres
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 23636/postgres
tcp6 0 0 :::5432 :::* LISTEN 23636/postgres
root@ucsMaster1:~#
If it is not listening, then Stop and restart the service.
root@ucsMaster1:~# systemctl stop postgresql
root@ucsMaster1:~# systemctl start postgresql
root@ucsMaster1:~# systemctl status postgresql
Step 1 and 2 should be performed on the Server where postgresql is installed. If it is installed on a different system, then proceed to step 3
To solve the connection Problem,
-
Check if the Server is reachable with Ping, and if the Hostname is resolvable
root@ucsBackup1:~# ping -c2 ucsMaster1.testing.intranet
PING ucsMaster1.testing.intranet (10.200.6.2) 56(84) bytes of data.
64 bytes from ucsMaster1.testing.intranet (10.200.6.2): icmp_seq=1 ttl=64 time=0.641 ms
64 bytes from ucsMaster1.testing.intranet (10.200.6.2): icmp_seq=2 ttl=64 time=0.744 ms
--- ucsMaster1.testing.intranet ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1010ms
rtt min/avg/max/mdev = 0.641/0.692/0.744/0.057 ms
root@ucsBackup1:~#
root@ucsBackup1:~# nslookup ucsMaster1.testing.intranet
Server: 10.200.6.3
Address: 10.200.6.3#53
Name: ucsMaster1.testing.intranet
Address: 10.200.6.2
You can also tale a look into the log file.
less /var/log/postgresql/postgresql-9.4-main.log
Regards
Anna Takang