]> git.evergreen-ils.org Git - working/Evergreen.git/blob - 1.6/admin/installingpostgresql.xml
Move PostgreSQL ifnormation from ServersideInstallation to Admin misc.
[working/Evergreen.git] / 1.6 / admin / installingpostgresql.xml
1 <?xml version='1.0' encoding='UTF-8'?>\r
2 <chapter xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude"\r
3         xmlns:xl="http://www.w3.org/1999/xlink" version="5.0" xml:id="serversideinstallation-postgresql">\r
4                         <title>Installing PostgreSQL</title>\r
5                         <para>In production Evergreen systems, the PostgreSQL database server may reside on the same system on which Evergreen is installed or on another standalone system so, by default, PostgreSQL is not automatically installed along with Evergreen. This section details the steps needed to manually install PostgreSQL on a <systemitem class="osname">Ubuntu</systemitem> or <systemitem class="osname">Debian</systemitem> system.</para>\r
6                         <para>If your PostgreSQL server will be on the same system as your Evergreen software, return to the previous section <xref linkend="serversideinstallation-postgresql-default"/> and follow those instructions. Otherwise, to manually install PostgreSQL on a system, continue with the instructions below.</para>\r
7                         <note>\r
8                                 <para>Some <systemitem class="osname">Linux</systemitem> distributions, such as <systemitem class="osname">Debian Etch (4.0)</systemitem>, do not offer PostgreSQL version 8.2 as an installable package. Before you continue, examine the software dependencies listed in <xref linkend="serversideinstall-software-dependencies"/> to ensure that your Linux distribution supports the required version of PostgreSQL.</para>\r
9                         </note>\r
10                         <procedure>\r
11                                 <step>\r
12                                         <para>Install the application <application>"stow"</application> on your system if it is not already installed. Issue the following command as the <systemitem class="username">root</systemitem> user:</para>\r
13                                         <figure>\r
14                                                 <title>Installing <application>"stow"</application></title>\r
15                                                 <screen>\r
16                                                 $ apt-get install stow\r
17                                                 ...\r
18                                                 </screen>\r
19                                         </figure>\r
20                                 </step>\r
21                                 <step>\r
22                                         <para>Download, compile, and install the latest release for PostgreSQL 8.2 (which was version <literal>8.2.12</literal> at the time of this writing). As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
23                                         <figure>\r
24                                                 <title>Installing PostgreSQL</title>\r
25                                                 <screen>\r
26                                                 $ wget http://wwwmaster.postgresql.org/redir/198/h/source/v8.2.17/postgresql-8.2.17.tar.bz2\r
27                                                 $ tar xzf postgresql-8.2.17.tar.gz\r
28                                                 $ cd postgresql-8.2.17\r
29                                                 $ ./configure --with-perl --enable-integer-datetimes --with-openssl --prefix=/usr/local/stow/pgsql\r
30                                                 ...\r
31                                                 $ make\r
32                                                 ...\r
33                                                 $ make install\r
34                                                 ...\r
35                                                 $ cd contrib\r
36                                                 $ make\r
37                                                 ...\r
38                                                 $ make install\r
39                                                 $ cd xml2\r
40                                                 $ make\r
41                                                 ...\r
42                                                 $ make install\r
43                                                 $ cd /usr/local/stow\r
44                                                 $ stow pgsql\r
45                                                 </screen>\r
46                                         </figure>\r
47                                 </step>\r
48                                 <step>\r
49                                         <para>Create the new user <systemitem class="username">postgres</systemitem> to run the PostgreSQL processes. As the <systemitem class="username">root</systemitem> user, execute this command:</para>\r
50                                         <figure>\r
51                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
52                                                 <screen>\r
53                                                 $ adduser postgres\r
54                                                 </screen>\r
55                                         </figure>\r
56                                 </step>\r
57                                 <step>\r
58                                         <para>Initialize the database directory and start up PostgreSQL. As the <systemitem class="username">root</systemitem> user, follow these steps:</para>\r
59                                         <figure>\r
60                                                 <title>Adding <systemitem class="username">postgres</systemitem></title>\r
61                                                 <screen>\r
62                                                 $ mkdir -p /usr/local/pgsql/data\r
63                                                 $ chown postgres /usr/local/pgsql/data\r
64                                                 $ su - postgres\r
65                                                 $ initdb -D /usr/local/pgsql/data -E UNICODE --locale=C\r
66                                                 $ pg_ctl -D /usr/local/pgsql/data -l /home/postgres/logfile start\r
67                                                 </screen>\r
68                                         </figure>\r
69                                         <note>\r
70                                                 <para>If an error occurs during the final step above, review the path of the home directory for the <systemitem class="username">postgres</systemitem> user. It may be <literal>/var/lib/postresql</literal> instead of <literal>/home/postres</literal>.</para>\r
71                                         </note>\r
72                                 </step>\r
73                                 <step>\r
74                                         <para>The values of several PostreSQL configuration parameters may be changed for enhanced performance. The following table lists the default values and some suggested updates for several useful parameters:</para>\r
75                                         <table>\r
76                                                 <title>Suggested configuration values</title>\r
77                                                 <tgroup align="left" cols="3" colsep="1" rowsep="1">\r
78                                                         <colspec colnum="1" colwidth="1.0*"/>\r
79                                                         <colspec colnum="2" colwidth="1.0*"/>\r
80                                                         <colspec colnum="3" colwidth="1.0*"/>\r
81                                                         <thead>\r
82                                                                 <row>\r
83                                                                         <entry>Parameter</entry>\r
84                                                                         <entry>Default</entry>\r
85                                                                         <entry>Suggested</entry>\r
86                                                                 </row>\r
87                                                         </thead>\r
88                                                         <tbody>\r
89                                                                 <row>\r
90                                                                         <entry>default_statistics_target</entry>\r
91                                                                         <entry>10</entry>\r
92                                                                         <entry>100</entry>\r
93                                                                 </row>\r
94                                                                 <row>\r
95                                                                         <entry>work_mem</entry>\r
96                                                                         <entry>4Mb</entry>\r
97                                                                         <entry>128Mb</entry>\r
98                                                                 </row>\r
99                                                                 <row>\r
100                                                                         <entry>shared_buffers</entry>\r
101                                                                         <entry>8Mb</entry>\r
102                                                                         <entry>512Mb</entry>\r
103                                                                 </row>\r
104                                                                 <row>\r
105                                                                         <entry>effective_cache_size</entry>\r
106                                                                         <entry>128Mb</entry>\r
107                                                                         <entry>4Gb</entry>\r
108                                                                 </row>\r
109                                                         </tbody>\r
110                                                 </tgroup>\r
111                                         </table>\r
112                                         <indexterm>\r
113                                                 <primary>ZZZ-REVIEW</primary>\r
114                                                 <secondary>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS</secondary>\r
115                                         </indexterm>\r
116                                         <caution>ADD CONTENT ON HOW TO UPDATE POSTRESQL PARAMETERS </caution>\r
117                                 </step>\r
118                         </procedure>\r
119 </chapter>\r