Shmmax,Shmall,我就是赢不了 ;)
我试过在我的/etc/sysctl.d/30-postgresql-shm.conf文件周围更改一些注释,kernel.shmmax并kernel.shmall稍微更改和更改,但似乎没有帮助。
#/etc/sysctl.d/30-postgresql-shm.conf
# Shared memory settings for PostgreSQL
# Note that if another program uses shared memory as well, you will have to
# coordinate the size settings between the two.
# Maximum size of shared memory segment in bytes
#kernel.shmmax = 33554432 # Original
#kernel.shmmax = 41943040 # Tried this (bigger)
kernel.shmmax = 943040 # and this (smaller)
# Maximum total size of shared memory in pages (normally 4096 bytes)
#kernel.shmall = 2097152 # Tried with and without this commented out
Run Code Online (Sandbox Code Playgroud)
然后(错误):
$ sudo /etc/init.d/postgresql start
* Starting PostgreSQL 9.2 database server
* The PostgreSQL server failed to start. Please check the log output:
2013-04-27 16:21:33 EDT FATAL: could not create shared memory segment: Invalid argument
2013-04-27 16:21:33 EDT DETAIL: Failed system call was shmget(key=5432001, size=30490624, 03600).
2013-04-27 16:21:33 EDT 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 30490624 bytes), reduce PostgreSQL's shared memory usage,
perhaps by reducing shared_buffers or max_connections.
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.
Run Code Online (Sandbox Code Playgroud)
注意:我将如何“提高请求大小”,因为这是我唯一没有尝试过的内容。
经过相当多的实验后,我发现将 /etc/sysctl.conf 更改为 kernel.shmmax=89934592 (比原始 kernel.shmmax=8589934592 短两位数)只是为了好玩......有效!
* Starting PostgreSQL 9.2 database server [ OK ] durrantm$
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
21921 次 |
| 最近记录: |