【问题标题】:Docker Postgresql ERROR HINT: The server must be started by the user that owns the data directory postgresql rhelDocker Postgresql 错误提示:服务器必须由拥有数据目录 postgresql rhel 的用户启动
【发布时间】:2019-03-16 20:51:54
【问题描述】:

我有一个 docker compose 文件,我在其中使用共享卷启动 PostgreSQL。但我不断收到以下错误。

2018-10-11 14:57:01.757 GMT [81] LOG:  skipping missing configuration 
file "/postgresql/data/postgresql.auto.conf"
| 2018-10-11 14:57:01.768 GMT [81] FATAL:  data directory "/postgresql/data" has wrong ownership
| 2018-10-11 14:57:01.768 GMT [81] HINT:  The server must be started by the user that owns the data directory.

我的docker compose文件如下

addb:
image : postgres
networks:
  - private
ports:
  - "5432:5432"
volumes:
  - /mnt/shared/app_data/db/postgres/data_db:/postgresql/data
depends_on:
  - sol-server

我正在使用 RHEL 7.5 和 Docker 版本 18.06.1-ce,构建 e68fc7。任何想法我可以如何解决上述问题。

【问题讨论】:

    标签: postgresql docker rhel7


    【解决方案1】:

    您应该使用/var/lib/postgresql/data 中的数据库挂载您的卷 而不是/postgresql/data 或提供环境PGDATA=/postgresql/data

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-17
      • 2013-04-21
      • 2021-08-22
      • 1970-01-01
      • 1970-01-01
      • 2021-11-21
      • 1970-01-01
      相关资源
      最近更新 更多