Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3088
  • Last Modified:

postgresql shmmax ubuntu

hi
i was configuring ubuntu to use postgresql ,i got this error,

 * Restarting PostgreSQL 8.3 database server                                     * The PostgreSQL server failed to start. Please check the log output:
2009-04-23 16:13:10 EST LOG:  could not load root certificate file "root.crt": no SSL error reported
2009-04-23 16:13:10 EST DETAIL:  Will not verify client certificates.
2009-04-23 16:13:10 EST FATAL:  could not create shared memory segment: Invalid argument
2009-04-23 16:13:10 EST DETAIL:  Failed system call was shmget(key=5432001, size=140181504, 03600).
2009-04-23 16:13:10 EST 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 140181504 bytes), reduce PostgreSQL's shared_buffers parameter (currently 16384) 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.

any ideas?
thanks
                     
0
klay8
Asked:
klay8
1 Solution
 
mahomeCommented:
That means that you request more Shared memory for Postgres than is allowed by Ubuntu.
Have a look here: http://www.postgresql.org/docs/8.1/static/kernel-resources.html

Use sysctl to increase the value:

sudo sysctl -w kernel.shmmax=256000000

Open in new window

0
 
mahomeCommented:
You can see your currently limit with the following:
It must increase the value of shared_buffers in the Postgres-Config

cat /proc/sys/kernel/shmmax 

Open in new window

0
 
ai_ja_naiCommented:
Wait. Ubuntu is an out-of-the-box distro. Is this the first time you try to start it?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
klay8Author Commented:
yes first, time to start it
0
 
gheistCommented:
It is not first time you start it - 140MB or 103 sessions is not the default postgresql.conf

0
 
ai_ja_naiCommented:
Anyway, uninstall it and reinstall and see if it comes again
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now