【问题标题】:postgres 9.3 moving data directory on ubuntu 14postgres 9.3 在 ubuntu 14 上移动数据目录
【发布时间】:2017-03-24 17:34:06
【问题描述】:

使用后

sudo chown -R ubuntu:ubuntu /data/psql

/usr/lib/postgresql/9.3/bin/initdb -D /database

并将data_directory = '/var/lib/postgresql/9.3/main' 更改为/data/psql'

在启动 Rails 应用程序时,nginx 日志显示:

故障安全响应期间出错:致命:无法打开关系 映射文件“global/pg_filenode.map”:权限被拒绝

有人对如何授予应用程序权限有提示吗?

谢谢

【问题讨论】:

  • 我会从sudo chown -R postgres:postgres /data/psql开始
  • 好吧,postgres 守护进程很可能会运行拥有的 postgres 用户。 /etc/postgres 中的配置通常由 root 拥有,用于使用服务。但这并不意味着数据目录应该由root或ubuntu拥有......我没有太多在ubuntu上运行postgres的经验,但我从未见过其他用户拥有的PGDATA然后是postgres。有帮助吗?..

标签: postgresql ubuntu nginx


【解决方案1】:

According to docs:

通常建议 PostgreSQL 用户不仅拥有 数据目录,但它的父目录也是如此,所以这应该 不是问题。

因此将权限更改回 postgres 将是您的解决方案:

sudo chown -R postgres:postgres /data/psql

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-03-21
    • 1970-01-01
    • 2021-12-27
    • 2018-06-30
    • 1970-01-01
    • 1970-01-01
    • 2013-05-16
    • 1970-01-01
    相关资源
    最近更新 更多