Linux:postgresql-14启动报错

一、问题

启动pg14时报错,提示Job for postgresql-14.service failed because the control process exited with error code.  

journalctl -xe 查看启动过程时发现,具体报错为could not load server certificate file “server.crt”:No such file or directory

[root@scyf-db data]# systemctl status postgresql-14
● postgresql-14.service - PostgreSQL 14 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-14.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2023-11-21 14:18:41 CST; 18min ago
     Docs: https://www.postgresql.org/docs/14/static/
  Process: 51051 ExecStart=/usr/pgsql-14/bin/postmaster -D ${PGDATA} (code=exited, status=1/FAILURE)
  Process: 51045 ExecStartPre=/usr/pgsql-14/bin/postgresql-14-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 51051 (code=exited, status=1/FAILURE)

Nov 21 14:18:41 scyf-db systemd[1]: Starting PostgreSQL 14 database server...
Nov 21 14:18:41 scyf-db postmaster[51051]: 2023-11-21 14:18:41.446 CST [51051] FATAL:  could not load server certificate file "serv...rectory
Nov 21 14:18:41 scyf-db systemd[1]: postgresql-14.service: main process exited, code=exited, status=1/FAILURE
Nov 21 14:18:41 scyf-db systemd[1]: Failed to start PostgreSQL 14 database server.
Nov 21 14:18:41 scyf-db systemd[1]: Unit postgresql-14.service entered failed state.
Nov 21 14:18:41 scyf-db systemd[1]: postgresql-14.service failed.
Hint: Some lines were ellipsized, use -l to show in full.
[root@scyf-db data]# systemctl start postgresql-14
Job for postgresql-14.service failed because the control process exited with error code. See "systemctl status postgresql-14.service" and "journalctl -xe" for details.
[root@scyf-db data]# journalctl -xe >>123.sh
[root@scyf-db data]# vim 123.sh

内容
--------------------------
-- Unit postgresql-14.service has begun starting up.
Nov 21 14:36:52 scyf-db postmaster[52011]: 2023-11-21 14:36:52.300 CST [52011] FATAL:  could not load server certificate file "server.crt": No such file or directory
Nov 21 14:36:52 scyf-db polkitd[870]: Unregistered Authentication Agent for unix-process:51999:4175129641 (system bus name :1.25052, object path /org/freedesktop/PolicyKit1/AuthenticationAgent, locale en_US.UTF-8) (disconnected from bus)
Nov 21 14:36:52 scyf-db systemd[1]: postgresql-14.service: main process exited, code=exited, status=1/FAILURE
Nov 21 14:36:52 scyf-db postmaster[52011]: 2023-11-21 14:36:52.300 CST [52011] LOG:  database system is shut down
Nov 21 14:36:52 scyf-db systemd[1]: Failed to start PostgreSQL 14 database server.
-- Subject: Unit postgresql-14.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- Unit postgresql-14.service has failed.
-- 
-- The result is failed.
Nov 21 14:36:52 scyf-db systemd[1]: Unit postgresql-14.service entered failed state.
Nov 21 14:36:52 scyf-db systemd[1]: postgresql-14.service failed.

二、解决办法

修改配置文件postgresql.conf文件中的ssl,使其为off

[root@scyf-db data]# vim postgresql.conf 
[root@scyf-db data]# systemctl start postgresql-14
[root@scyf-db data]# systemctl status postgresql-14
● postgresql-14.service - PostgreSQL 14 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-14.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2023-11-21 14:42:00 CST; 15s ago
     Docs: https://www.postgresql.org/docs/14/static/
  Process: 52271 ExecStartPre=/usr/pgsql-14/bin/postgresql-14-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 52279 (postmaster)
   CGroup: /system.slice/postgresql-14.service
           ├─52279 /usr/pgsql-14/bin/postmaster -D /u01/apps/pgsql14/data/
           ├─52280 postgres: logger 
           ├─52283 postgres: checkpointer

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值