无法在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.
不同的conf文件的内容如下-
[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
我在谷歌上搜索了我看到的错误。许多人都看到了同样的错误,每种情况下的根本原因都不同。通读这些帖子,我不清楚我看到的是已经报告的任何原因。
3条答案
按热度按时间cwdobuhd1#
请确保您已经正确安装了所有软件包,并在安装之前更新了yum存储库部分
[base]
和[updates]
,如guide中所述。我们有CentOS 7和PostgreSQL 9.5,它可以通过以下步骤完美地工作:最后,
systemctl status postgresql-9.5.service
应该会显示如下内容:ngynwnxp2#
最常见的问题是数据库集群未初始化。您可以通过使用
initdb
命令运行postgresql-XX-setup脚本来轻松地初始化它,例如:然后启动Postgres服务,例如
o2gm4chl3#
这些步骤对我的测试服务器很有帮助。
通过SSH连接服务器。
然后切换用户:
检查Postgres状态:
停止数据库:
检查是否不存在服务器进程:
启动Postgres服务:
或
然后检查状态: