gpt4 book ai didi

postgresql - Docker Postgresql 错误提示 : The server must be started by the user that owns the data directory postgresql rhel

转载 作者:行者123 更新时间:2023-12-04 11:46:27 30 4
gpt4 key购买 nike

我有一个 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。任何想法如何解决上述问题。

最佳答案

您应该使用 /var/lib/postgresql/data 中的数据库装载您的卷
而不是 /postgresql/data或者给个环境PGDATA=/postgresql/data

关于postgresql - Docker Postgresql 错误提示 : The server must be started by the user that owns the data directory postgresql rhel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52765707/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com