首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >无法在Ubuntu 22中启动PostgreSQL

无法在Ubuntu 22中启动PostgreSQL
EN

Database Administration用户
提问于 2023-01-03 17:56:10
回答 2查看 301关注 0票数 0

我无法在Ubuntu22中启动PostgreSQL。我得到的是,

代码语言:javascript
复制
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.

然而,日志文件如下所示。有人请你指点。

代码语言:javascript
复制
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
EN

回答 2

Database Administration用户

发布于 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*"

有关实例化服务的更多信息,请参见我对服务器故障的回答中的类似问题。

票数 1
EN

Database Administration用户

发布于 2023-01-05 02:07:53

使用pg_ctl启动,没关系。你可以试试。我总是用这个命令。

代码语言:javascript
复制
pg_ctl start
票数 0
EN
页面原文内容由Database Administration提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://dba.stackexchange.com/questions/321671

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档