【发布时间】:2023-07-29 10:04:01
【问题描述】:
我正在尝试在我的本地机器上启动我的 PostgreSQL 服务器。 但我收到一条错误消息:
FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=5432001, size=9781248, 03600).
HINT: This error usually means that PostgreSQL's request for a shared memory segment exceeded your kernel's SHMMAX parameter. You can either reduce the request size or reconfigure the kernel with larger SHMMAX. To reduce the request size (currently 9781248 bytes), reduce PostgreSQL's shared_buffers parameter (currently 1024) and/or its max_connections parameter (currently 13).
If the request size is already small, it's possible that it is less than your kernel's SHMMIN parameter, in which case raising the request size or reconfiguring SHMMIN is called for.
The PostgreSQL documentation contains more information about shared memory configuration.
我搜索并查看了文档,但我尝试设置 kern.sysv.shmmax 和 kern.sysv.shmall 的所有内容都有效。 Snow Leopard 的正确设置是什么?我用 macports 安装了 postgres。
【问题讨论】:
-
尝试在 serverfault.com 上询问。
-
这里是 serverfault 上相同问题的链接:serverfault.com/questions/10226/…
-
更新:Postgres 9.3 及更高版本已被重写为只需要少量的共享内存。使用 >= 9.3 时,不再需要调整内核共享内存限制。 depesz.com/2012/07/12/…
标签: postgresql configuration macos