Signiant Support

Database fails to start after upgrade with "Could not create shared memory segment" Print


Problem

After an upgrade of the Signiant Manager the postgres database fails to start.  An error similar to the following is displayed:

----- Executing dbpostgres 'start' command (PID: 23433)

Starting Signiant Manager Database Server...

ERROR: Signiant Manager Database Server 'postmaster' failed to start properly.

The [signiant_install_dir]/log/db/postgresql.log shows messages similar to the following:

[1-1] FATAL:  could not create shared memory segment: Invalid argument

[2-1] DETAIL:  Failed system call was shmget(key=5432001, size=274399232, 03600).

[3-1] 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 274399232 bytes), reduce PostgreSQL's shared_buffers parameter (currently 30720) and/or its max_connections parameter (currently 204). 

Resolution

In the example above, the request size is set to 261 MB (274399232) which is larger than the SHMMAX value used by the Linux kernel.  The solution is to set a larger kernel SHMMAX value: 

  1. To make the SHMMAX value larger, type:
         echo 536870912 > /proc/sys/kernel/shmmax
  2. To make it persistent across reboots by adding the following to /etc/sysctl.conf, type:
         kernel.shmmax = 536870912
  3. Run the upgrade again.