我们有一台具有 6GB RAM 的 Ubuntu 服务器。
我们正在尝试安装 Postgres,但它建议我们增加 kernel.shmmax 和 kernel.shmmal 的值。
该服务器仅为 Postgres DB 服务器,我们想将 2 个数字更改为
shmmax 为 4GB,因此为 4294967296
1048576 的 shmall
我已经阅读了如何进行更改,并尝试过
sudo sysctl -w kernel.shmmax=4294967296
sudo sysctl -w kernel.shmmal=1048576
然后完成 cat /proc/sys/kernel/shmmax 来检查结果 - 这仍然显示旧的数字。
我究竟做错了什么?
我会将它们放入 /etc/sysctl.conf 中,以便在重启后保留它们。
我收到的错误是:
FATAL: could not create shared memory segment: No space left on device
DETAIL: Failed system call was shmget(key=1, size=36, 03600).
HINT: This error does not mean that you have run out of disk space. It occurs either if all available shared memory IDs have been taken, in which case you need to raise the SHMMNI parameter in your kernel, or because the system's overall limit for shared memory has been reached.
Error: initdb failed Error: could not create default cluster.
谢谢