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启动参数--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
- 点赞
- 收藏
- 关注作者
评论(0)