Mainos / Advertisement:

PostgreSQL

Kohteesta Taisto
Versio hetkellä 3. lokakuuta 2015 kello 19.40 – tehnyt Minh (keskustelu | muokkaukset) (Ak: Uusi sivu: PostgreSQL on tietokantaohjelmisto. == Asennus == aptitude install postgresql == Konfigurointi == === Jaettu muisti === Yleinen virhe: <pre> FATAL: could not create share...)
(ero) ← Vanhempi versio | Nykyinen versio (ero) | Uudempi versio → (ero)
Siirry navigaatioon Siirry hakuun

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.

Mainos / Advertisement: