Mainos / Advertisement:

Ero sivun ”PostgreSQL” versioiden välillä

Kohteesta Taisto
Siirry navigaatioon Siirry hakuun
(Ak: Uusi sivu: PostgreSQL on tietokantaohjelmisto. == Asennus == aptitude install postgresql == Konfigurointi == === Jaettu muisti === Yleinen virhe: <pre> FATAL: could not create share...)
 
Rivi 54: Rivi 54:
  
 
Tarkista sysctl -p komennolla että arvot ovat oikein.
 
Tarkista sysctl -p komennolla että arvot ovat oikein.
 +
 +
== Lähteet ==
 +
 +
http://leopard.in.ua/2013/09/05/postgresql-sessting-shared-memory/

Versio 3. lokakuuta 2015 kello 19.42

PostgreSQL on tietokantaohjelmisto.

Asennus

 aptitude install postgresql

Konfigurointi

Jaettu muisti

Yleinen virhe:

FATAL:  could not create shared memory segment: Invalid argument
DETAIL:  Failed system call was shmget(key=5440001, size=4011376640, 03600).

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 4011376640 bytes), reduce
PostgreSQL's shared_buffers parameter (currently 50000) and/or
its max_connections parameter (currently 12).

Kuinka korjata:

Sinun tulee konfiguroida Unix System jaettu muisti, jos haluat saada PostgreSQL toimimaan.

Tässä alla on scripti joka laskee shmax ja shmall arvot. Tallenna scripti esimerkiksi shcalc.sh ja aja se.

#!/bin/bash
# simple shmsetup script
page_size=`getconf PAGE_SIZE`
phys_pages=`getconf _PHYS_PAGES`
shmall=`expr $phys_pages / 2`
shmmax=`expr $shmall \* $page_size`
echo kernel.shmmax = $shmmax
echo kernel.shmall = $shmall

Tämä scripti tulostaa palvelimessa jossa on 2GB RAM muistia:

kernel.shmmax = 1055092736
kernel.shmall = 257591

Kopioi nämä ja avaa /etc/sysctl.conf tiedosto

 nano /etc/sysctl.conf

Liitä kopioidut arvot tiedostoon.

Tarkista sysctl -p komennolla että arvot ovat oikein.

Lähteet

http://leopard.in.ua/2013/09/05/postgresql-sessting-shared-memory/

Mainos / Advertisement: