【问题标题】:Set up Postgresql-93 on Centos 7在 Centos 7 上设置 Postgresql-93
【发布时间】:2014-09-28 07:54:22
【问题描述】:

我按照Almost idiot's guideCentos 7 上安装 postgresql 和 postgis 并使用以下命令启动数据库本身时卡住了:

[root@localhost cmaps]# service postgresql-9.3 initdb
The service command supports only basic LSB actions (start, stop, restart, try-restart, reload, force-reload, status). For other actions, please try to use systemctl.

如果我从 Centos 存储库(9.2 版)安装 postgresql 软件包,该命令可以工作,但我没有 postgis,并且 Centos 7 没有官方 posgresql-92 存储库。

知道发生了什么吗?

谢谢!

【问题讨论】:

    标签: postgresql centos postgresql-9.3


    【解决方案1】:

    我遇到了同样的问题,通过改变路径解决了

    /usr/pgsql-9.3/bin/postgresql93-setup initdb
    

    注意路径不同

    【讨论】:

    • 另外,启动服务器运行:systemctl start postgresql-9.3.service
    • 已经 3 年了,wiki 仍然没有反映这一点。
    【解决方案2】:

    CentOS 7 基于 systemd。 PostgreSQL 包对 initdb 使用不同的命令:

    /usr/lib/pgsql-9.3/bin/postgresql93-setup initdb
    

    在旧版本上,直接调用 initscript。

    /etc/init.d/postgresql-9.3 initdb
    

    【讨论】:

    • @Gaturo 啊,没注意到您使用的是 RHEL/CentOS 7。请参阅编辑。
    【解决方案3】:

    对于安装在 MS Azure 平台上的 Centos 7.3,脚本位于

    /usr/bin/postgresql-setup initdb
    

    这些名称中也没有版本号:

    • 数据库数据和配置位置:/var/lib/pgsql/data/
    • 服务名称/sbin/service postgresql statussystemctl status postgresql.service

    【讨论】:

      猜你喜欢
      • 2015-11-27
      • 2019-06-12
      • 2014-12-02
      • 1970-01-01
      • 2015-09-20
      • 1970-01-01
      • 1970-01-01
      • 2015-03-01
      • 1970-01-01
      相关资源
      最近更新 更多