1. 添加yum 配置
yum install -y http://download.postgresql.org/pub/repos/yum/9.2/redhat/rhel-7-x86_64/pgdg-centos92-9.2-3.noarch.rpm
2. 安装服务
yum install -y postgresql92-server postgresql92-contrib
3. 启动
systemctl start postgresql-9.2.service
4. 发现下面的报错, 按提示看报错信息, 执行
{
-- Unit postgresql-9.2.service has begun starting up.
3月 16 04:08:14 bogon postgresql92-check-db-dir[1240]: "/var/lib/pgsql/9.2/data/" is missing or empty.
3月 16 04:08:14 bogon postgresql92-check-db-dir[1240]: Use "/usr/pgsql-9.2/bin/postgresql92-setup initdb" to initialize the datab
3月 16 04:08:14 bogon postgresql92-check-db-dir[1240]: See /usr/share/doc/postgresql92-9.2.24/README.rpm-dist for more informatio
3月 16 04:08:14 bogon systemd[1]: postgresql-9.2.service: control process exited, code=exited status=1
3月 16 04:08:14 bogon systemd[1]: Failed to start PostgreSQL 9.2 database server.
-- Subject: Unit postgresql-9.2.service has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit postgresql-9.2.service has failed.
}
执行初始化解决问题:
/usr/pgsql-9.2/bin/postgresql92-setup initdb
重新启动:
systemctl restart postgresql-9.2.service
systemctl status postgresql-9.2.service
5. 调整配置文件
标签:postgresql,04,service,16,postgresql92,centos7,9.2 From: https://www.cnblogs.com/S--S/p/17223866.html