You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 22.04重启后PostgreSQL 14无法启动,提示套接字文件不存在的问题求助

Ubuntu 22.04重启后PostgreSQL 14无法启动,提示套接字文件不存在的问题求助

各位大佬好,我遇到个棘手的问题:之前在Ubuntu 22.04上装了PostgreSQL 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 postgresql@14-main.service failed because the service did not take the steps required by its unit configuration.
See "systemctl status postgresql@14-main.service" and "journalctl -xeu postgresql@14-main.service" for details.

现在实在不知道该怎么继续排查了,有没有大佬能指点一下?

备注:内容来源于stack exchange,提问作者fresco

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.21 14:00:27