【发布时间】:2023-08-26 00:26:01
【问题描述】:
在 Red Hat EL7 上,我从标准存储库安装了 Postgres,并以通常的方式初始化了数据库:
# postgresql-setup initdb
但是当我尝试启动服务时:
# systemctl start postgresql.service
我收到一个错误:
Job for postgresql.service failed. See 'systemctl status postgresql.service' and 'journalctl -xn' for details.
journalctl -xn 给我:
Oct 06 14:52:55 myserver systemd[1]: Starting PostgreSQL database server...
-- Subject: Unit postgresql.service has begun with start-up
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql.service has begun starting up.
Oct 06 14:52:55 myserver systemd[29267]: Failed at step USER spawning /usr/bin/postgresql-check-db-dir: No such process
-- Subject: Process /usr/bin/postgresql-check-db-dir could not be executed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- The process /usr/bin/postgresql-check-db-dir could not be executed and failed.
--
-- The error number returned while executing this process is 3.
有人有什么想法吗?
【问题讨论】:
-
检查 PostgreSQL 日志以查看 PostgreSQL 是否报告了更多详细信息。
-
没有 Postgres 日志,因为在调用 pg_ctl 之前发生了故障。
标签: postgresql redhat systemd