Hello!

On Wed, 25 Apr 2012 at 02:54:20 (+0300), Taras Heychenko wrote:

>     Доброе время суток.
> На машине стоит  FreeBSD 8.2-STABLE #1. Столкнулся с проблемой при попытке 
> перейти на более свежую версию postgresql. Работала 8.2 и не жужжала. Сделал 
> backup, 8.2 убрал, попробовал поставить 9.0 (потом заменил на 8.4, но 
> ситуацию это не изменило). При попытке инициализировать базу данных получаю 
> следующее:

> root@gw:~>/usr/local/etc/rc.d/postgresql initdb
> The files belonging to this database system will be owned by user "pgsql".
> This user must also own the server process.

> The database cluster will be initialized with locale C.
> The default text search configuration will be set to "english".

> creating directory /usr/local/pgsql/data ... ok
> creating subdirectories ... ok
> selecting default max_connections ... 10
> selecting default shared_buffers ... 400kB
> creating configuration files ... ok
> creating template1 database in /usr/local/pgsql/data/base/1 ... FATAL:  could 
> not create shared memory segment: Cannot allocate memory
> DETAIL:  Failed system call was shmget(key=1, size=1507328, 03600).

Не знаю, как сейчас, но раньше postgres нормально не работал без вот
такого в кернеле:
options         SYSVSHM                 # SYSV-style shared memory
options         SYSVMSG                 # SYSV-style message queues
options         SYSVSEM                 # SYSV-style semaphores
options         SHMMAXPGS=65536         # PostgreSQL (up to 180 clients)
options         SEMMNI=40               # PostgreSQL (up to 180 clients)
options         SEMMNS=240              # PostgreSQL (up to 180 clients)
options         SEMUME=40               # PostgreSQL (up to 180 clients)
options         SEMMNU=120              # PostgreSQL (up to 180 clients)


> HINT:  This error usually means that PostgreSQL's request for a shared memory 
> segment exceeded available memory or swap space. To reduce the request size 
> (currently 1507328 bytes), reduce PostgreSQL's shared_buffers parameter 
> (currently 50) and/or its max_connections parameter (currently 13).
>         The PostgreSQL documentation contains more information about shared 
> memory configuration.
> child process exited with exit code 1
> initdb: removing data directory "/usr/local/pgsql/data"

> Увеличить параметры 
> kern.ipc.shmall: 8192
> kern.ipc.shmmax: 33554432
> пробовал -- меняет ошибку, но общую ситуацию не улучшает. Я бы попробовал 
> уменьшить shared_buffers или max_connections, но эти параметры 
> устанавливаются в data/postgresql.conf, которое, среди остального, и 
> создается командой initdb. Соответственно там выставить это нельзя. 
> Кто-нибудь сталкивался с такой ситуацией? Буду благодарен любым советам, а то 
> свои идеи "что делать" пока закончились, а базу нужно бы поднять.

> --
> Taras Heychenko

-- 
George L. Yermulnik
[YZ-RIPE]

Ответить