PostgreSQL基于Docker部署时的shm配置注意事项
【摘要】 背景如果你使用docker启动PG时,遇到类似这样的问题,可能你需要看看docker的/dev/shm是不是不够大。"ERROR: could not resize shared memory segment "/PostgreSQL.388782411" to 50438144 bytes: No space left on device SQL state: 53100"调整docker...
背景
如果你使用docker启动PG时,遇到类似这样的问题,可能你需要看看docker的/dev/shm是不是不够大。
"ERROR: could not resize shared memory segment "/PostgreSQL.388782411" to 50438144 bytes: No space left on device SQL state: 53100"
调整docker启动参数--shm-size
Thank you Thomas,
I make it work with extra setting --shm-size=1g in my docker run script.
It works with 'none' and 'sysv'--I think the issue is that technically our
environment does support 'posix', but '/dev/shm' is indeed not mounted in
the LXC container, leading to a discrepancy between what initdb decides and
what's actually possible. Thanks for your help.
Thanks,
Maciek
docker-compose配置例子:
version: "3.1"
services:
db:
image: postgres
environment:
POSTGRES_PASSWORD: Boe888888
POSTGRES_USER: sdm-admin
POSTGRES_DB: sdm
TZ: Asia/Shanghai
shm-size: 1g
ports:
- 15432:5432
volumes:
- /home/docker/sdm/data:/var/lib/postgresql/data
【声明】本内容来自华为云开发者社区博主,不代表华为云及华为云开发者社区的观点和立场。转载时必须标注文章的来源(华为云社区)、文章链接、文章作者等基本信息,否则作者和本社区有权追究责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱:
cloudbbs@huaweicloud.com
- 点赞
- 收藏
- 关注作者
评论(0)