Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZF0mJ-0000kN-3S for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2015 14:01:47 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZF0mI-0006wF-48 for pgsql-general@arkaria.postgresql.org; Tue, 14 Jul 2015 14:01:46 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZF0k5-0004Mz-A4 for pgsql-general@postgresql.org; Tue, 14 Jul 2015 13:59:29 +0000 Received: from squeakycode.net ([96.126.114.205]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZF0k0-0002rf-8c for pgsql-general@postgresql.org; Tue, 14 Jul 2015 13:59:26 +0000 Received: from [192.168.10.81] (74-84-91-123.client.mchsi.com [74.84.91.123]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: andy) by squeakycode.net (Postfix) with ESMTPSA id 0394822988; Tue, 14 Jul 2015 08:59:22 -0500 (CDT) Message-ID: <55A515B4.1080903@squeakycode.net> Date: Tue, 14 Jul 2015 08:59:16 -0500 From: Andy Colson User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Ryan King - NOAA Affiliate , pgsql-general@postgresql.org Subject: Re: could not create shared memory segment: Invalid argument References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.3 (---) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org On 7/13/2015 7:08 PM, Ryan King - NOAA Affiliate wrote: > Apologies ahead of time for not knowing which group to send to, but I > wanted to see if anyone has encountered and resolved this type of error. > I'm setting up postgresql 9.2 streaming replication on RH and after > copying the master data directory over to the slave, the psql service > refuses start and gives the following errors. > > > > 2015-07-13 23:55:41.224 UTC FATAL: could not create shared memory > segment: Invalid argument > 2015-07-13 23:55:41.224 UTC DETAIL: Failed system call was > shmget(key=5432001, size=1146945536, 03600). > 2015-07-13 23:55:41.224 UTC 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 > 1146945536 bytes), reduce PostgreSQL's shared memory usage, perhaps by > reducing shared_buffers or max_connections. > 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. > 2015-07-13 23:56:21.344 UTC FATAL: could not create shared memory > segment: Invalid argument > 2015-07-13 23:56:21.344 UTC DETAIL: Failed system call was > shmget(key=5432001, size=58302464, 03600). > 2015-07-13 23:56:21.344 UTC 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 > 58302464 bytes), reduce PostgreSQL's shared memory usage, perhaps by > reducing shared_buffers or max_connections. > 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. > > > > I've set shared_buffer way down to next to nothing along with > kernel.shmmax and kernel.shmall per some blogs. However, the same error > persists, and I'm getting no where. I think ultimately the solution is > to upgrade, but the devs may not be ready for an upgrade at this point. > Any help would be greatly appreciated. Thanks! You don't want to decrease kernel.shmmax you want to set it to the request size: sysctl -w kernel.shmmax=1146945536 shmmax is the only thing you really need to play with. -Andy -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general