在CentOS 7上无法启动postgresql-9.5。
我按照这个页面 - https://wiki.postgresql.org/wiki/YUM_Installation - 安装了CentOS上的数据库服务器。
我尝试了在运行setenforce 0
之后再次安装,但是依旧无法解决问题。
我使用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.
不同的配置文件内容如下 -
[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
我在谷歌上搜索了出现的错误。 许多人都遇到了同样的错误,而每种原因都不尽相同。阅读这些帖子时,我并没有看到已经报道过的任何一个导致我出现此错误的原因。
#/usr/pgsql-9.5/bin/postgresql95-setup initdb
。 指南提到了上述命令作为备选项,如果“service <name> initdb”无法运行。然而,如果“service <name> initdb”命令可以正常运行,指南没有提供关于输出是什么样子的指导。在我自己的情况中,我使用了“service <name> initdb”命令,但它只是返回了命令提示符。最终我发现,它并没有起作用。 - Muthu Palanisamy