无法在CentOS 7上启动Postgresql服务 [英] Unable to start postgresql service on CentOS 7

查看:1426
本文介绍了无法在CentOS 7上启动Postgresql服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无法在CentOS 7上启动postgresql-9.5。

Unable to start postgresql-9.5 on CentOS 7.

我关注了此页面- https://wiki.postgresql.org/wiki/YUM_Installation -用于在CentOS上安装数据库服务器。

I followed this page - https://wiki.postgresql.org/wiki/YUM_Installation - for installing the database server on CentOS.

I设置 setenforce 0 后尝试了相同的操作,但这也无济于事。

I tried the same after setting setenforce 0, and that did not help either.

我正在按照 root

systemctl start postgresql-9.5.service
Job for postgresql-9.5.service failed because the control process exited with error 
code. See "systemctl status postgresql-9.5.service" and "journalctl -xe" for details.

这就是我获得的身份-

Redirecting to /bin/systemctl status  postgresql-9.5.service
● postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-02-18 15:20:30 EST; 2min 28s ago
  Process: 15041 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)

Feb 18 15:20:30 myserver systemd[1]: Starting PostgreSQL 9.5 database server...
Feb 18 15:20:30 myserver systemd[1]: postgresql-9.5.service: control process exited, code=exited status=1
Feb 18 15:20:30 myserver systemd[1]: Failed to start PostgreSQL 9.5 database server.
Feb 18 15:20:30 myserver systemd[1]: Unit postgresql-9.5.service entered failed state.
Feb 18 15:20:30 myserver systemd[1]: postgresql-9.5.service failed.

不同conf文件的内容如下-

And the contents of the different conf files are as follows -

[root@myserver /]# cat /etc/ld.so.conf.d/postgresql-pgdg-libs.conf
/usr/pgsql-9.5/lib/

[root@myserver /]# cat /usr/lib/tmpfiles.d/postgresql-9.5.conf
d /var/run/postgresql 0755 postgres postgres -

[root@myserver /]# cat /usr/pgsql-9.5/share/postgresql-9.5-libs.conf
/usr/pgsql-9.5/lib/

[root@myserver /]# cat /etc/alternatives/pgsql-ld-conf
/usr/pgsql-9.5/lib/

[root@myserver /]# cat /var/lib/alternatives/pgsql-ld-conf
auto
/etc/ld.so.conf.d/postgresql-pgdg-libs.conf

/usr/pgsql-9.5/share/postgresql-9.5-libs.conf
950

在Googled中查找以下错误我看到了
许多人都看到了相同的错误,并且每种情况下的根本原因都不同。通读这些帖子,尚不清楚我是否看到了任何已报告的原因。

Googled for the error that I am seeing. A number of folks have seen the same error, and the underlying cause is different in each case. Reading through those posts, it is not clear that I am seeing any of the already reported causes.

推荐答案

请确保已安装正确安装所有软件包并更新yum存储库中的 [base] [updates] 之前的部分,如 指南 。我们有带有PostgreSQL 9.5的CentOS 7,它可以通过以下步骤完美运行:

Make sure you have installed all packages correctly and updated yum repository sections [base] and [updates] before installation as it mentioned in the guide . We have CentOS 7 with PostgreSQL 9.5 and it works perfectly fine with following steps:

vi /etc/yum.repos.d/CentOS-Base.repo
yum localinstall http://yum.postgresql.org/9.5/redhat/rhel-7-x86_64/pgdg-centos95-9.5-2.noarch.rpm
yum list postgres*
yum install -y postgresql95-server.x86_64 postgresql95-contrib.x86_64 postgresql95-libs.x86_64 
/usr/pgsql-9.5/bin/postgresql95-setup initdb
systemctl enable postgresql-9.5.service
systemctl start postgresql-9.5.service 

最后是 systemctl status postgresql-9.5.service 应该显示以下信息:

and finally, systemctl status postgresql-9.5.service should show you something like this:

postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled)
   Active: active (running) since Fri 2016-02-19 00:01:13 UTC; 6min ago
  Process: 10809 ExecStart=/usr/pgsql-9.5/bin/pg_ctl start -D ${PGDATA} -s -w -t 300 (code=exited, status=0/SUCCESS)
  Process: 10802 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=0/SUCCESS)
 Main PID: 10811 (postgres)
   CGroup: /system.slice/postgresql-9.5.service
           ├─10811 /usr/pgsql-9.5/bin/postgres -D /var/lib/pgsql/9.5/data
           ├─10812 postgres: logger process   
           ├─10814 postgres: checkpointer process   
           ├─10815 postgres: writer process   
           ├─10816 postgres: wal writer process   
           ├─10817 postgres: autovacuum launcher process   
           └─10818 postgres: stats collector process 

这篇关于无法在CentOS 7上启动Postgresql服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆