我无法在Ubuntu22中启动PostgreSQL。我得到的是,
root@NOC:/var/log/postgresql# systemctl status postgresql
â— postgresql.service - PostgreSQL RDBMS
Loaded: loaded (/lib/systemd/system/postgresql.service; enabled; vendor preset: enabled)
Active: active (exited) since Tue 2023-01-03 22:51:08 PKT; 3min 56s ago
Main PID: 20422 (code=exited, status=0/SUCCESS)
CPU: 5ms
جنÙری 03 22:51:08 NOC systemd[1]: Starting PostgreSQL RDBMS...
جنÙری 03 22:51:08 NOC systemd[1]: Finished PostgreSQL RDBMS.
然而,日志文件如下所示。有人请你指点。
2023-01-03 22:02:05.015 PKT [5770] LOG: starting PostgreSQL 14.5 (Ubuntu 14.5-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, co>
2023-01-03 22:02:05.015 PKT [5770] LOG: listening on IPv4 address "127.0.0.1", port 5432
2023-01-03 22:02:05.131 PKT [5770] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-01-03 22:02:05.636 PKT [5771] LOG: database system was shut down at 2023-01-03 22:01:45 PKT
2023-01-03 22:02:05.689 PKT [5770] LOG: database system is ready to accept connections
2023-01-03 22:11:14.737 PKT [5770] LOG: received fast shutdown request
2023-01-03 22:11:16.010 PKT [5770] LOG: aborting any active transactions
2023-01-03 22:11:16.018 PKT [5770] LOG: background worker "logical replication launcher" (PID 5777) exited with exit code 1
2023-01-03 22:11:16.019 PKT [5772] LOG: shutting down
2023-01-03 22:11:16.553 PKT [5770] LOG: database system is shut down
2023-01-03 22:11:29.193 PKT [6553] LOG: starting PostgreSQL 14.5 (Ubuntu 14.5-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu, co>
2023-01-03 22:11:29.194 PKT [6553] LOG: listening on IPv4 address "127.0.0.1", port 5432
2023-01-03 22:11:29.276 PKT [6553] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2023-01-03 22:11:29.555 PKT [6554] LOG: database system was shut down at 2023-01-03 22:11:16 PKT
2023-01-03 22:11:29.950 PKT [6553] LOG: database system is ready to accept connections
2023-01-03 22:11:38.090 PKT [6553] LOG: received fast shutdown request
2023-01-03 22:11:38.437 PKT [6553] LOG: aborting any active transactions
2023-01-03 22:11:38.442 PKT [6553] LOG: background worker "logical replication launcher" (PID 6560) exited with exit code 1
2023-01-03 22:11:38.445 PKT [6555] LOG: shutting down
2023-01-03 22:11:41.103 PKT [6553] LOG: database system is shut down
发布于 2023-01-05 00:31:10
在Debian中,以及一些派生发行版(如Ubuntu )中,每个PostgreSQL实例(集群)都属于表单postgresql@version-clustername
的实例化模板服务。
例如,postgresql@14-main
表示一个PostgreSQL 14服务器实例(集群),其集群名为main
(这是默认的集群名称)。
服务postgresql
仅仅是一种无懈可击的服务.如果您启动或停止它,所有PostgreSQL实例都将被启动或停止。但是,您不能使用systemctl status postgresql
来检查是否有任何PostgreSQL服务器正在运行,即使您只有一个PostgreSQL服务器。
您应该始终检查特定实例化服务的状态,例如:systemctl status postgresql@14-main
。
要检查PostgreSQL的所有服务,可以运行systemctl list-units "postgresql*"
。
有关实例化服务的更多信息,请参见我对服务器故障的回答中的类似问题。
发布于 2023-01-05 02:07:53
使用pg_ctl启动,没关系。你可以试试。我总是用这个命令。
pg_ctl start
https://dba.stackexchange.com/questions/321671
复制相似问题