Eric D. Schabell: JBoss Operations Network (JON) 4.2.1 - Fedora 14 setup tips

Monday, February 21, 2011

JBoss Operations Network (JON) 4.2.1 - Fedora 14 setup tips

I was installing the newest JBoss ON on my Fedora 14 laptop and ran into the following when trying to configure postgresql.conf to provide a larger memory segment:

FATAL: could not create shared memory segment: Invalid argument
DETAIL: Failed system call was shmget(key=5432001, size=88358912, 03600).
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.

Turns out you can adjust your kernels shared memory allocation size by using the following command (I upped mine from standard size to the numbers below):

# enter in a console as root the following to up the 
# allowed shared memory.
#
$ echo 88358912 > /proc/sys/kernel/shmmax


# now we can start postgresql.
#
$ service postgresql start

# to allow postgresql service to start automatically
# on boot, you need to put this in the file 
# /etc/syscntl.conf
#
kernel.shmmax = 88358912

The following problem I had with the default configuration was that the gui pgAdminIII interface for postgres would not connect due to 'ident' authentication setup. The hint is to modify the authentication mechanism to md5 as follows:

# in your database directory, mine being /var/lib/pgsql/data,
# you will find a file called pg_hba.conf. This needs to be 
# modified to use 'md5.'
#

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               md5
# IPv4 local connections:
host    all         all         127.0.0.1/32          md5

The rest of the online documentation will work just fine.

1 comment:

  1. Update on this post: note the error message gives exactly the SIZE on it is trying to create, adjust your KERNEL.SHMMAX value based on this number.

    For example, just setup a newer postgresql and it is asking for SIZE=88449024.

    ReplyDelete

Note: Only a member of this blog may post a comment.