Невозможно подключиться к серверу, используя postgresql 11 с rails - PullRequest
1 голос
/ 19 сентября 2019

Я получаю:

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?

Вчера у меня была эта проблема , и теперь, столкнувшись с ней, я попытался решить ее, руководствуясь этим сообщением , поэтомуПока я получаю эти проблемы:

$ pg_lsclusters
Ver Cluster Port Status Owner    Data directory              Log file
11  main    5432 down   postgres /var/lib/postgresql/11/main /var/log/postgresql/postgresql-11-main.log

заходя в файл журнала (/var/log/postgresql/postgresql-11-main.log) Я нашел:

2019-09-18 15:26:41.172 CEST [17215] social@postgres DETAIL:  Connection matched pg_hba.conf line 90: "local   all             all                                     peer"
2019-09-18 23:01:36.723 CEST [11076] LOG:  received fast shutdown request
2019-09-18 23:01:36.728 CEST [11076] LOG:  aborting any active transactions

ПопыткаДля доступа к Postgresql мне будет предложено:

sudo su - postgres
postgres@sampc:~$ 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"?

Пытаясь запустить сервер, я получаю:

$ sudo systemctl start postgresql@11-main
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.

status:

 $service postgresql status
● postgresql.service - PostgreSQL RDBMS
   Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2019-09-19 13:30:51 CEST; 58min ago
  Process: 26154 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
 Main PID: 26154 (code=exited, status=0/SUCCESS)

sep 19 13:30:51 sampc systemd[1]: Starting PostgreSQL RDBMS...
sep 19 13:30:51 sampc systemd[1]: Started PostgreSQL RDBMS.

пытаюсь systemctl statuspostgresql@11-main.service

sep 19 15:13:38 sampc systemd[1]: postgresql@11-main.service: Can't open PID file /run/postgresql/11-main.pid (yet
sep 19 15:13:38 sampc systemd[1]: postgresql@11-main.service: Failed with result 'protocol'.
sep 19 15:13:38 sampc systemd[1]: Failed to start PostgreSQL Cluster 11-main.

journalctl -xe

sep 19 16:35:01 sampc CRON[6123]: pam_unix(cron:session): session closed for user root
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:35:47 sampc gvfsd-metadata[1657]: g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
sep 19 16:36:19 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:36:19 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:36:19 sampc nm-applet[1553]: Can't set a parent on widget which has a parent
sep 19 16:37:10 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:37:10 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:37:10 sampc nm-applet[1553]: Can't set a parent on widget which has a parent
sep 19 16:37:10 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:37:10 sampc nm-applet[1553]: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
sep 19 16:37:10 sampc nm-applet[1553]: Can't set a parent on widget which has a parent
sep 19 16:37:20 sampc sudo[6404]:   samuel : TTY=pts/4 ; PWD=/var/lib/postgresql/11 ; USER=root ; COMMAND=/bin/chmod -R 777 main/
sep 19 16:37:20 sampc sudo[6404]: pam_unix(sudo:session): session opened for user root by (uid=0)
sep 19 16:37:20 sampc sudo[6404]: pam_unix(sudo:session): session closed for user root
sep 19 16:38:21 sampc xfce4-terminal[2333]: gdk_window_get_window_type: assertion 'GDK_IS_WINDOW (window)' failed
sep 19 16:38:38 sampc /usr/lib/gdm3/gdm-x-session[1316]: [3303:3303:0919/163838.578602:ERROR:buffer_manager.cc(488)] [.DisplayCompositor]GL ERROR :GL_INVALID_OPERATION : glBufferData: <- error
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...