I
I
Igor2016-12-04 15:03:31
PostgreSQL
Igor, 2016-12-04 15:03:31

PostgreSQL won't start, what needs to be fixed?

Available:
Ubuntu 16.04.1 LTS

[email protected] ~ # uname -r
4.4.0-47-generic

PostgreSQL 9.5
[email protected] ~ # service postgresql status
● postgresql.service - LSB: PostgreSQL RDBMS server
   Loaded: loaded (/etc/init.d/postgresql; bad; vendor preset: enabled)
   Active: active (exited) since Thu 2016-12-01 02:21:43 UTC; 3 days ago
     Docs: man:systemd-sysv-generator(8)

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

When trying to connect to the DBMS:
[email protected] ~ # psql -h localhost -p 5432 -U postgres -W
Password for user postgres: 
psql: could not connect to server: Connection refused
  Is the server running on host "localhost" (127.0.0.1) and accepting
  TCP/IP connections on port 5432?

Further, some details on the commands - empty output
[email protected] ~ # netstat -pant | grep postgres
[email protected] ~ #

[email protected] ~ # sudo su - postgres -c psql
psql: could not connect to server: No such file or directory
  Is the server running locally and accepting
  connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

[email protected] ~ # ps aux|grep postgres
root     29349  0.0  0.0  16976   936 pts/0    S+   12:00   0:00 grep --color=auto postgres

less /etc/postgresql/9.5/main/postgresql.conf
# - Connection Settings -

listen_addresses = '*'          # what IP address(es) to listen on;
                                        # comma-separated list of addresses;
                                        # defaults to 'localhost'; use '*' for all
                                        # (change requires restart)
port = 5432                             # (change requires restart)
max_connections = 100                   # (change requires restart)
#superuser_reserved_connections = 3     # (change requires restart)
unix_socket_directories = '/var/run/postgresql' # comma-separated list of directories
                                        # (change requires restart)

There is the necessary data in the database, so I just can’t demolish and reinstall it (
It happened when the server was rebooted.
What should I do, what should I do? How can I fix all this?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
I
Igor, 2016-12-06
@IceofHeart

Demolished. Reinstalled everything. It is not known why this happened ... and there are no ends to be found. It is written that the DBMS is 9.5, but in reality it should have been 9.4

M
Michael, 2016-12-04
@MikeDeblin

Perhaps the space in /var
df -h has run out, what does it show?
Move/remove large files, archives from /var/log, then try to start PostgreSQL again.

A
Alexander, 2016-12-05
@asand3r

So does psql start say something intelligible?
The server does not start, incl. it is clear that all attempts to connect and the output of netstat will be inconclusive.

R
rorc, 2017-11-07
@rorc

Mistake
in most cases, it shows problems with log rotation in the system using logrotate, this has nothing to do with the postgresql or mysql service.
The simplest treatment is to delete the program logs in the /var/www/log/**** folder
, then stop, start the service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question