Getting PostgreSQL installed really isn't that difficult on Gentoo Linux.
# emerge -s postgresql
# emerge postgresql
(install takes a while, didn't time it)
# ebuild /var/db/pkg/dev-db/postgresql-7.4.2-r1/postgresql-7.4.2-r1.ebuild config
(a few messages later)
* The current value of SHMMAX is too low for postgresql to run.
* Please edit /etc/sysctl.conf and set this value to at least 134217728.
*
* kernel.shmmax = 134217728
*
Fire up nano... see
for an explanation of why we need to edit sysctl.conf. The short version is that the 2.6 linux kernel has a default value (shared memory limits) that is too small to be compatible with PostgreSQL.
# nano -w /etc/sysctl.conf
(add the following lines)
#Kernel parameters for PostgreSQL
#default is 32MB, PostGreSQL needs 128MB
kernel.shmmax = 134217728
kernel.shmall = 134217728
Now manually update the current values and start the server.
# echo 134217728 >/proc/sys/kernel/shmall
# echo 134217728 >/proc/sys/kernel/shmmax
# rc-update add postgresql default
# /etc/init.d/postgresql start
Now I'm off to explore the
PostgreSQL documentation.
The default Gentoo install seems to already include a "postgres" user in /etc/passwd. To get logged in as the postgres user account, you will (I think) first need to switch to root.
# su
# cd /usr/local
# su - postgres
Now you can continue with
section 16. Skip the page about creating the database cluster, it's already been created in "
/var/lib/postgresql/data" back when you ran the "ebuild config" command. You can verify this by looking at the config file ("
cat /etc/conf.d/postgresql"), where the
PGDATA= line indicates the location of the database.
In fact, skip straight to
chapter 16.4 - Run-time Configuration, because the server is already running. To verify that the server is running, "
cat /var/lib/postgresql/data/postmaster.pid". Make a note of the PID on the first line (second line is the database location), then "
cat /proc/nnnn/status" (replacing "nnnn" with the PID).
Labels: Gentoo, PostgreSQL
posted by Thomas at
00:12