Portál AbcLinuxu, 10. května 2025 14:22
Když mi naběhne Linux, mám PostgreSQL vypnuté. Ale rc skripty jsou nastavené správně, k pokusu o spuštění dojde, ale v logu jsem našel toto:
2009-02-13 18:22:49 CET FATAL: could not create shared memory segment: Invalid argument 2009-02-13 18:22:49 CET DETAIL: Failed system call was shmget(key=5432001, size=39288832, 03600). 2009-02-13 18:22:49 CET 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 39288832 bytes), reduce PostgreSQL's shared_buffers parameter (currently 4096) and/or its max_connections parameter (currently 103). 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.
Když ale ho dodatečně ručně spustím (init skript + start), naběhne úplně bez problému.
SHMMAX mám:
sysctl kernel.shmmax kernel.shmmax = 268435456
To by mělo stačit, ne?
Na jiném počítači se stejným systémem (Ubuntu 8.10 64b) a s menší pamětí mi databáze startuje bez problému.
Když ale ho dodatečně ručně spustím (init skript + start), naběhne úplně bez problému.Tu bude pes zakopaný: pravdepodobne sa pri štarte skôr spúšťa PostgreSQL ako sa nastavia správne hodnoty sysctl premenných. Takže stačí zariadiť opačné poradie týchto dvoch akcií pri štarte systému.
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.