Pages

Google Ads

Saturday, May 30, 2009

This error usually means that PostgreSQL's request for a shared memory segment

Bom dia amigo leitor,

Fiz o update do meu laptop com ubuntu 8.10 (64bits) para a nova versão 9.04 (64 bits) do Ubuntu e o PostgreSQL 8.3 parou de funcionar exibindo a seguinte mensagem de erro:

Extraído do meu shell script.

root@coruja-mobile:/home/caio# /etc/init.d/postgresql-8.3 start
* Starting PostgreSQL 8.3 database server * The PostgreSQL server failed to start. Please check the log output:
2009-05-30 08:23:14 BRT LOG: could not load root certificate file "root.crt": no SSL error reported
2009-05-30 08:23:14 BRT DETAIL: Will not verify client certificates.
2009-05-30 08:23:14 BRT FATAL: could not create shared memory segment: Invalid argument
2009-05-30 08:23:14 BRT DETAIL: Failed system call was shmget(key=5432001, size=39288832, 03600).
2009-05-30 08:23:14 BRT 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.
[fail]
root@coruja-mobile:/home/caio#

Como resolver?

Muito simples abaixo segue os passos:

Edite o arquivo /etc/postgresql/8.3/main/postgresql.conf

Eu gosto de utilizar o Jed, mas tanto faz podem utilizar o famoso vi

root@coruja-mobile:/home/caio# jed /etc/postgresql/8.3/main/postgresql.conf

Procure pelo parametro shared_buffers e altere o valor da variável de 32MB para 26MB.

# - Memory -

shared_buffers = 26MB # min 128kB or max_connections*16kB
# (change requires restart)


Depois de salvo, reinicie o PostgreSQL

root@coruja-mobile:/home/caio# /etc/init.d/postgresql-8.3 start
* Starting PostgreSQL 8.3 database server [ OK ]

Pronto funcionou!!!

No comments: