Statistics
| Branch: | Tag: | Revision:

root / docs / scale / i-db.rst @ 84809111

History | View | Annotate | Download (1.9 kB)

1
.. _i-db:
2

    
3
Synnefo
4
-------
5

    
6
:ref:`synnefo <i-synnefo>` ||
7
:ref:`ns <i-ns>` ||
8
:ref:`apt <i-apt>` ||
9
:ref:`mq <i-mq>` ||
10
db ||
11
:ref:`gunicorn <i-gunicorn>` ||
12
:ref:`apache <i-apache>` ||
13
:ref:`webproject <i-webproject>` ||
14
:ref:`astakos <i-astakos>` ||
15
:ref:`qh <i-qh>` ||
16
:ref:`cms <i-cms>` ||
17
:ref:`pithos <i-pithos>` ||
18
:ref:`cyclades <i-cyclades>` ||
19
:ref:`kamaki <i-kamaki>` ||
20
:ref:`backends <i-backends>`
21

    
22
Database Setup
23
++++++++++++++
24

    
25
The following apply to ``db`` node. For the rest of the sections we will
26
refer to its IP as ``db.example.com`` .
27

    
28
First install progresql:
29

    
30
.. code-block:: console
31

    
32
   # apt-get install postgresql
33

    
34
We create a database called ``snf_apps``, that will host all django
35
apps related tables. We also create the user ``synnefo`` and grant him all
36
privileges on the database. We do this by running:
37

    
38
.. code-block:: console
39

    
40
   # su - postgres
41
   postgres:~$ psql
42
   postgres=# CREATE DATABASE snf_apps WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
43
   postgres=# CREATE USER synnefo WITH PASSWORD 'example_passw0rd';
44
   postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_apps TO synnefo;
45

    
46
We also create the database ``snf_pithos`` needed by the pithos+ backend and
47
grant the ``synnefo`` user all privileges on the database.
48

    
49
.. code-block:: console
50

    
51
   postgres=# CREATE DATABASE snf_pithos WITH ENCODING 'UTF8' LC_COLLATE='C' LC_CTYPE='C' TEMPLATE=template0;
52
   postgres=# GRANT ALL PRIVILEGES ON DATABASE snf_pithos TO synnefo;
53

    
54
Configure the database to listen to all network interfaces. You can do this by
55
editting the file `/etc/postgresql/8.4/main/postgresql.conf` with:
56

    
57
| ``listen_addresses = '*'``
58

    
59
Furthermore, edit `/etc/postgresql/8.4/main/pg_hba.conf` to allow the nodes
60
to connect to the database. Add the following line:
61

    
62
| ``host		all	all	4.3.2.0/24	md5``
63

    
64
.. code-block:: console
65

    
66
   # /etc/init.d/postgresql restart
67

    
68

    
69
Test your Setup:
70
++++++++++++++++