【发布时间】:2020-06-03 23:47:17
【问题描述】:
当我尝试启动 Ubuntu 时,它永远不会完成启动过程,因为它显示消息“无法启动 PostgreSQL Cluster 10-main”。我也收到与 9.5-main 相同的信息。但让我们专注于 10。
当我执行时:
systemctl status postgresql@10-main.service
我收到以下消息:
postgresql@10-main.service - PostgreSQL Cluster 10-main
Loaded: loaded (/lib/systemd/system/postgresql@.service; indirect; vendor preset: enabled)
Active: failed (Result: protocol) since Wed 2020-02-19 17:57:22 CET; 30 min ago
Process: 1602 ExecStart=/usr/bin/pg_ctlcluster --skip-systemctl-redirect 10-main start (code_exited, status=1/FAILURE)
PC_info systemd[1]: Starting PostgreSQL Cluster 10-main...
PC_info postgresql@10-main[1602]: Error: /usr/lib/postgresql/10/bin/pg_ctl /usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-19-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf" exit with status 1:
PC_info systemd[1]: postgresql@10-main.service: Can't open PID file /var/run/postgresql/10-main.pid (yet?) after start: No such file or directory
PC_info systemd[1]: postgresql@10-main.service: Failed with result 'protocol'.
PC_info systemd[1]: Failed to start PostgreSQL Cluster 10-main.
PC_info 是关于我的计算机的信息(用户、日期..)不相关
我从一天到另一天都收到此错误,而没有触及与数据库服务器相关的任何内容。 我试图自己修复它,但没有任何效果
编写命令
service postgresql@10-main start
我明白了
Job for postgresql@10-main.service failed because the service did not take the steps required by its unit configuration
See "systemctl status postgresql@10-main.service" and "journalctl -xe" for details.
运行这两个命令我从一开始就收到消息。
有人知道发生了什么吗?我该如何解决?
【问题讨论】:
-
我有同样的错误,但我仍然不确定原因是什么。我的临时解决方案是尝试 Systemd 错误消息中提到的命令:
/usr/lib/postgresql/10/bin/pg_ctl start -D /var/lib/postgresql/10/main -l /var/log/postgresql/postgresql-19-main.log -s -o -c config_file="/etc/postgresql/10/main/postgresql.conf"要使其成为有效命令,您实际上需要将最后一部分用单引号 (-c config_file="/etc/postgresql/10/main/postgresql.conf") 括起来,以便正确传递给 postgres 命令(参见pgctl手册页)。
标签: postgresql ubuntu pid boot