加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

‘service postgresql start’无法在Fedora上启动postgres服务

发布时间:2020-12-13 16:02:05 所属栏目:百科 来源:网络整理
导读:postgres的新人! 我按照here的说法编辑了pg_hba.conf,但是当我尝试重启postgresql服务时,尝试失败了.下面是命令行输出,包含我可以收集的所有信息. [root@arunpc modules]# service postgresql restartRedirecting to /bin/systemctl restart postgresql.ser
postgres的新人!

我按照here的说法编辑了pg_hba.conf,但是当我尝试重启postgresql服务时,尝试失败了.下面是命令行输出,包含我可以收集的所有信息.

[root@arunpc modules]# service postgresql restart
Redirecting to /bin/systemctl  restart postgresql.service
Job failed. See system logs and 'systemctl status' for details.
[root@arunpc modules]# systemctl status postgresql.service
postgresql.service - PostgreSQL database server
      Loaded: loaded (/lib/systemd/system/postgresql.service; enabled)
      Active: failed since Sun,08 Apr 2012 21:29:06 +0530; 14s ago
     Process: 12228 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast (code=exited,status=0/SUCCESS)
     Process: 12677 ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o -p ${PGPORT} -w -t 300 (code=exited,status=1/FAILURE)
     Process: 12672 ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA} (code=exited,status=0/SUCCESS)
    Main PID: 12184 (code=exited,status=0/SUCCESS)
      CGroup: name=systemd:/system/postgresql.service
[root@arunpc modules]# tail /var/log/messages
....
Apr  8 21:29:06 arunpc systemd[1]: postgresql.service: control process exited,code=exited status=1
Apr  8 21:29:06 arunpc systemd[1]: Unit postgresql.service entered failed state.
Apr  8 21:29:06 arunpc pg_ctl[12677]: pg_ctl: could not start server
Apr  8 21:29:06 arunpc pg_ctl[12677]: Examine the log output.

FWIW,这是使用的配置文件(pg_hba.conf):

# TYPE  DATABASE        USER            ADDRESS                 METHOD

# "local" is for Unix domain socket connections only
local   all             postgres                                ident sameuser
local   all             all                                     ident sameuser
# IPv4 local connections:
host    all             all             127.0.0.1               password
# IPv6 local connections:
host    all             all             ::1                     password

这可能是什么错误?在编辑之前它曾经工作正常(因为这是一台开发机器,我出色地没有做任何备份).

我还想得到更详细的日志输出. / var / log / messages文件中的日志消息确实要求我“检查日志输出” – 这将是哪个日志输出?我可以采取哪些其他故障排除步骤?

提前谢谢了!

解决方法

根据您的启动脚本,它可能会将postmaster的输出重定向到文件.这通常是PGDATA目录中的server.log.我尝试的事情:

>在pg_hba.conf中注释掉所有内容并重试.如果问题是该文件中的语法错误,那么注释掉有问题的行将允许服务器启动,然后您将能够一次取消注释,直到找到错误.>直接从shell启动postmaster而不将其发送到后台.只需运行postmaster -D< pgdata dir>它应该喷出更多有用的日志.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读