새소식

DB

[PostgreSQL] could not create shared memory segment: Invalid argument 오류

  • -
728x90


[PostgreSQL] could not create shared memory segment: Invalid argument



해결방법


1. root 계정 로그인


2. /etc/sysctl.conf 




3. kernel.shmmax = 41943040





4. sudo sysctl -p



끝.


5. Postgresql 재시작!




감사합니다.


==============================================


You need to increase the maximum size of a chunk of shared memory Linux kernel allows to allocate at once (known as SHMMAX parameter)


You need to edit /etc/sysctl.conf and add the following line:


kernel.shmmax = 41943040

(where 41943040 is the size of memory in bytes, i.e. 40 megabytes. On production system you probably want to set this value way higher - Postgres documentation recommends to start with 1/4 of available memory)


Then run


sudo sysctl -p

and restart postgres again.


Alternatively, you can edit /etc/postgresql/<version>/main/postgresql.conf and reduce the value of shared_buffers parameter.


This is a bug, more info here


https://bugs.launchpad.net/ubuntu/+source/linux/+bug/264336


(there's also /etc/sysctl.d/30-postgresql-shm.conf file which is supposed to be used for this purpose but it doesn't seem to be included from the main config so editing it has no effect)

반응형
Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.