postgresql 14-s.PGSQL.5432 没有这样的文件

postgresql 14-s.PGSQL.5432 没有这样的文件

安装了 ubuntu 22.04、postgresql v 14.9 - 一切正常。重新启动系统后,出现错误:

"connection to server on socket "/var/run/postgresql//.s.PGSQL.5432" failed: No such file or directory Is the server running locally and accepting connections on that socket?"

进一步的自我纠正尝试导致了这一点

       $service postgresql status
● postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Fri 2023-09-08 08:40:41 MSK; 1h 0min ago
Main PID: 3142 (code=exited, status=0/SUCCESS)
CPU: 3ms
systemd[1]: Starting PostgreSQL RDBMS...
systemd[1]: Finished PostgreSQL RDBMS.



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



       $sudo systemctl start postgresql@14-main
Job for [email protected] failed because the service did not take the steps required by its unit configuration.
See "systemctl status [email protected]" and "journalctl -xeu [email protected]" for details.

答案1

我们正在查看日志

journalctl -xeu [email protected]

FATAL:could not map anonymous shared memory: Cannot allocate memory

您需要进入配置并修复shared_buffershuge_pages=on(在我的情况下缓冲区太大)

相关内容