Linux Мята PostgreSQL 11.
Я пытаюсь: psql -U postgres
И получаю:
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"
В postgresql .conf:
listen_addresses = '*'
unix_socket_directories = '/var/run/postgresql'
unix_socket_permissions = 0777
После ps axf | grep postgres:
6575 ? Sl 0:01 | | \_ xed /etc/postgresql/11/main/postgresql.conf
4906 pts/0 S 0:00 \_ sudo su postgres
4907 pts/0 S 0:00 \_ su postgres
6586 pts/0 S+ 0:00 \_ grep --color=auto postgres
Но
root@andrej-HP-290-G1-SFF-Business-PC:/etc/postgresql/11/main# netstat -nltp | grep 5432
root@andrej-HP-290-G1-SFF-Business-PC:/etc/postgresql/11/main#
Как я пытался решить эту проблему:
ln -s / tmp / .s.PG SQL .5432 /var/run/postgresql/.s.PGSQL.5432
sudo find / tmp / -name .s.PG SQL .5432
Результат: /tmp/.s.PGSQL.5432. И попробуйте под su: psql -U postgres
Запуск pg_lsclusters, я вижу:
11 main 5432 down postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log
Итак, статус не работает. Но когда я пытаюсь запустить основной запуск pg_ctlcluster 11, я получаю:
Job for postgresql@11-main.service failed because the service did not
take the steps required by its unit configuration.
See "systemctl status postgresql@11-main.service" and "journalctl -xe"
for details.
Выполнение "journalctl -xe":
failed to create Unix-сокет in "/tmp
system bd is switched-off
failde to start server
Can't open PID file /run/postgresql/11-main.pid (yet?) after start:
No such file or dir
Failed with result 'protocol'.
Failed to start PostgreSQL Cluster 11-main.