[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Postgres in jails


I am trying to run postgres in Debian GNU/kFreeBSD jails but I keep
getting the dreaded shared memory issues. Now, first I might have to
mention that my host system is a "normal" (i.e. non-Debian) FreeBSD
9.0 with a custom-built kernel (kernel config file is attached, I hope
that's okay).

What I am trying now is to run Debian wheezy in such a jail (I tried
with squeeze before but got the same errors). Namely, pg_createcluster

# pg_createcluster 9.1 main --start
Use of uninitialized value in socket at
/usr/share/postgresql-common/PgCommon.pm line 677.
Creating new cluster (configuration: /etc/postgresql/9.1/main, data:
FATAL:  could not create shared memory segment: Cannot allocate memory
DETAIL:  Failed system call was shmget(key=2, size=2146304, 03600).
HINT:  This error usually means that PostgreSQL's request for a shared
memory segment exceeded available memory or swap space, or exceeded
your kernel's SHMALL parameter.  You can either reduce the request
size or reconfigure the kernel with larger SHMALL.  To reduce the
request size (currently 2146304 bytes), reduce PostgreSQL's shared
memory usage, perhaps by reducing shared_buffers or max_connections.
	The PostgreSQL documentation contains more information about shared
memory configuration.
child process exited with exit code 1
initdb: removing contents of data directory "/var/lib/postgresql/9.1/main"
Error: initdb failed

I tried to follow the advice on
http://www.freebsddiary.org/jail-multiple.php and from what I can tell
sysvipc seems to be properly enabled:

# sysctl security.jail.sysvipc_allowed
security.jail.sysvipc_allowed: 1

Plus it would also seem that there should be enough memory available:

# sysctl -a|grep shm
kern.ipc.shm_allow_removed: 0
kern.ipc.shm_use_phys: 0
kern.ipc.shmall: 131072
kern.ipc.shmseg: 128
kern.ipc.shmmni: 192
kern.ipc.shmmin: 1
kern.ipc.shmmax: 536870912
kern.features.sysv_shm: 1
kern.features.posix_shm: 1

So now I'm wondering whether there's anything that I overlooked,
whether this just simply cannot work due to some incompatibility
between Debain GNU/kfreebsd and "normal" freebsd or if there's some
other crazy problem. Any input would be greatly appreciated.

Stefan Ott

"You are not Grey Squirrel?"

Attachment: KERNEL
Description: Binary data

Reply to: